diff --git a/17.3_variable/apache.yml b/17.3_variable/apache.yml index 48a17d7..7e74290 100644 --- a/17.3_variable/apache.yml +++ b/17.3_variable/apache.yml @@ -1,7 +1,7 @@ --- - name: install apache via ansible playbook - hosts: test - user: ansible - become: true + hosts: all + user: root + become: false roles: - myapache3 diff --git a/17.3_variable/host_vars/100.0.0.102 b/17.3_variable/host_vars/100.0.0.102 new file mode 100644 index 0000000..d2699a6 --- /dev/null +++ b/17.3_variable/host_vars/100.0.0.102 @@ -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 \ No newline at end of file diff --git a/17.3_variable/inventaire b/17.3_variable/inventaire new file mode 100644 index 0000000..1ad351f --- /dev/null +++ b/17.3_variable/inventaire @@ -0,0 +1 @@ +100.0.0.102 diff --git a/17.3_variable/myapache3/templates/.vhost.conf.jj.swp b/17.3_variable/myapache3/templates/.vhost.conf.jj.swp deleted file mode 100644 index 822844e..0000000 Binary files a/17.3_variable/myapache3/templates/.vhost.conf.jj.swp and /dev/null differ diff --git a/17.3_variable/myapache3/templates/vhost.conf.jj b/17.3_variable/myapache3/templates/vhost.conf.jj index 99de51e..50b2487 100644 --- a/17.3_variable/myapache3/templates/vhost.conf.jj +++ b/17.3_variable/myapache3/templates/vhost.conf.jj @@ -1,7 +1,9 @@ {% for vhost in apache_vhosts %} ServerName {{ vhost.servername }} - ServerAlias {{ vhost.serveralias }} + {% for alias in vhost.serveralias %} + ServerAlias {{ alias }} + {% endfor %} DocumentRoot {{ vhost.documentroot }} CustomLog {{ vhost.accesslog }} combined ErrorLog {{ vhost.errorlog }} diff --git a/17.3_variable/myapache3/vars/.main.yml.swp b/17.3_variable/myapache3/vars/.main.yml.swp deleted file mode 100644 index fa7436b..0000000 Binary files a/17.3_variable/myapache3/vars/.main.yml.swp and /dev/null differ diff --git a/17.3_variable/myapache3/vars/main.yml b/17.3_variable/myapache3/vars/main.yml index aa1871c..8c4b0a1 100644 --- a/17.3_variable/myapache3/vars/main.yml +++ b/17.3_variable/myapache3/vars/main.yml @@ -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 \ No newline at end of file +http_port: 80 \ No newline at end of file