exercice variable: mise au point 17.3, qui devrait remplacer les autres
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: install apache via ansible playbook
|
||||
hosts: test
|
||||
user: ansible
|
||||
become: true
|
||||
hosts: all
|
||||
user: root
|
||||
become: false
|
||||
roles:
|
||||
- myapache3
|
||||
|
||||
18
17.3_variable/host_vars/100.0.0.102
Normal file
18
17.3_variable/host_vars/100.0.0.102
Normal file
@@ -0,0 +1,18 @@
|
||||
apache_vhosts:
|
||||
- servername: cines.fr
|
||||
serveralias:
|
||||
- www.cines.fr
|
||||
- cines.org
|
||||
- www.cines.org
|
||||
documentroot: /var/www/html/cines.fr
|
||||
accesslog: /var/log/httpd/access_cines.fr_log
|
||||
errorlog: /var/log/httpd/error_cines.fr_log
|
||||
- servername: thomas.fr
|
||||
serveralias:
|
||||
- www.thomas.fr
|
||||
- thomas.com
|
||||
- www.thomas.cm
|
||||
documentroot: /var/www/html/thomas.fr
|
||||
accesslog: /var/log/httpd/access_thomas.fr_log
|
||||
errorlog: /var/log/httpd/error_thomas.fr_log
|
||||
documentrootoptions: indexes
|
||||
1
17.3_variable/inventaire
Normal file
1
17.3_variable/inventaire
Normal file
@@ -0,0 +1 @@
|
||||
100.0.0.102
|
||||
Binary file not shown.
@@ -1,7 +1,9 @@
|
||||
{% for vhost in apache_vhosts %}
|
||||
<VirtualHost *:{{ http_port }}>
|
||||
ServerName {{ vhost.servername }}
|
||||
ServerAlias {{ vhost.serveralias }}
|
||||
{% for alias in vhost.serveralias %}
|
||||
ServerAlias {{ alias }}
|
||||
{% endfor %}
|
||||
DocumentRoot {{ vhost.documentroot }}
|
||||
CustomLog {{ vhost.accesslog }} combined
|
||||
ErrorLog {{ vhost.errorlog }}
|
||||
|
||||
Binary file not shown.
@@ -1,15 +1,3 @@
|
||||
---
|
||||
# vars file for myapache
|
||||
http_port: 80
|
||||
apache_vhosts:
|
||||
- servername: orsys.fr
|
||||
serveralias: www.orsys.fr
|
||||
documentroot: /var/www/html/orsys.fr
|
||||
accesslog: /var/log/httpd/access_orsys.fr_log
|
||||
errorlog: /var/log/httpd/error_orsys.fr_log
|
||||
- servername: thomas.fr
|
||||
serveralias: www.thomas.fr
|
||||
documentroot: /var/www/html/thomas.fr
|
||||
accesslog: /var/log/httpd/access_thomas.fr_log
|
||||
errorlog: /var/log/httpd/error_thomas.fr_log
|
||||
documentrootoptions: indexes
|
||||
Reference in New Issue
Block a user