make it work on almlinux and debian, really
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# tasks file for myapache
|
||||
#
|
||||
- name: include distribution specific variables
|
||||
include_vars: "{{ ansible_distribution|lower }}.yml"
|
||||
include_vars: "{{ ansible_os_family|lower }}.yml"
|
||||
|
||||
- name: install apache almost anywhere
|
||||
tags: httpd
|
||||
@@ -18,7 +18,7 @@
|
||||
dest: "{{ apache_conf_dir}}/vhost.conf"
|
||||
mode: 0640
|
||||
owner: root
|
||||
group: apache
|
||||
group: "{{ apache_group_name }}"
|
||||
|
||||
- name: activate apache
|
||||
tags: httpd
|
||||
@@ -35,23 +35,21 @@
|
||||
state: enabled
|
||||
ignore_errors: yes
|
||||
notify: reload firewalld
|
||||
when: ansible_distribution=="CentOS" or "RedHat"
|
||||
when: ansible_os_family=="RedHat"
|
||||
|
||||
- name: create documentroot
|
||||
tags: httpd
|
||||
file:
|
||||
name: "{{ item.documentroot }}"
|
||||
state: directory
|
||||
loop:
|
||||
- "{{ apache_vhosts }}"
|
||||
loop: "{{ apache_vhosts }}"
|
||||
|
||||
- name: create documentroot/Private
|
||||
tags: httpd
|
||||
file:
|
||||
name: "{{ item.documentroot }}/Private"
|
||||
state: directory
|
||||
loop:
|
||||
- "{{ apache_vhosts }}"
|
||||
loop: "{{ apache_vhosts }}"
|
||||
|
||||
- name: create index file
|
||||
tags: httpd
|
||||
@@ -59,5 +57,4 @@
|
||||
src: index.html
|
||||
dest: "{{ item.documentroot }}/index.html"
|
||||
mode: 0644
|
||||
loop:
|
||||
- "{{ apache_vhosts }}"
|
||||
loop: "{{ apache_vhosts }}"
|
||||
@@ -1,3 +1,4 @@
|
||||
apache_package_name: apache2
|
||||
apache_group_name: www-data
|
||||
apache_service_name: apache2
|
||||
apache_conf_dir: /etc/apache2/sites-enabled/
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
apache_package_name: httpd
|
||||
apache_group_name: apache
|
||||
apache_service_name: httpd
|
||||
apache_conf_dir: /etc/httpd/conf.d
|
||||
Reference in New Issue
Block a user