make it work on almlinux and debian, really
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- name: install apache via ansible playbook
|
||||
hosts: cibles
|
||||
hosts: all
|
||||
roles:
|
||||
- apache
|
||||
|
||||
@@ -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
|
||||
12
host_vars/debian1.formation.opendoor.fr
Normal file
12
host_vars/debian1.formation.opendoor.fr
Normal file
@@ -0,0 +1,12 @@
|
||||
apache_vhosts:
|
||||
- servername: tartempion.fr
|
||||
serveralias: www.tartempion.fr
|
||||
documentroot: /var/www/html/tartempion.fr
|
||||
accesslog: /var/log/apache2/access_tartempion.fr_log
|
||||
errorlog: /var/log/apache2/error_tartempion.fr_log
|
||||
- servername: delphine.fr
|
||||
serveralias: www.delphine.fr
|
||||
documentroot: /var/www/html/delphine.fr
|
||||
accesslog: /var/log/apache2/access_delphine.fr_log
|
||||
errorlog: /var/log/apache2/error_delphine.fr_log
|
||||
|
||||
Reference in New Issue
Block a user