diff --git a/17.1_variable/host_vars/cible1 b/17.1_variable/host_vars/cible1 index 80b2caa..f13ad40 100644 --- a/17.1_variable/host_vars/cible1 +++ b/17.1_variable/host_vars/cible1 @@ -1,5 +1,5 @@ -servername: cines.fr -serveralias: www.{{ servername }} -documentroot: /var/www/html/{{ servername }} -accesslog: /var/log/httpd/access_{{ servername }}_log -errorlog: /var/log/httpd/error_{{ servername }}_log \ No newline at end of file +apache_servername: cines.fr +apache_serveralias: www.{{ servername }} +apache_documentroot: /var/www/html/{{ servername }} +apache_accesslog: /var/log/httpd/access_{{ servername }}_log +apache_errorlog: /var/log/httpd/error_{{ servername }}_log \ No newline at end of file diff --git a/17.1_variable/host_vars/cible2 b/17.1_variable/host_vars/cible2 index 10d326f..804739b 100644 --- a/17.1_variable/host_vars/cible2 +++ b/17.1_variable/host_vars/cible2 @@ -1,5 +1,5 @@ -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 \ No newline at end of file +apache_servername: orsys.fr +apache_serveralias: www.orsys.fr +apache_documentroot: /var/www/html/orsys.fr +apache_accesslog: /var/log/httpd/access_orsys.fr_log +apache_errorlog: /var/log/httpd/error_orsys.fr_log \ No newline at end of file diff --git a/17.1_variable/myapache/README.md b/17.1_variable/myapache/README.md index 69f2bca..f6a79dd 100644 --- a/17.1_variable/myapache/README.md +++ b/17.1_variable/myapache/README.md @@ -19,11 +19,11 @@ http_port: 80 Hosts Variables: --------------- -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 +apache_servername: orsys.fr +apache_serveralias: "www.orsys.fr" +apache_documentroot: /var/www/html/orsys.fr +apache_accesslog: /var/log/httpd/access_orsys.fr_log +apache_errorlog: /var/log/httpd/error_orsys.fr_log Dependencies ------------ diff --git a/17.1_variable/myapache/defaults/main.yml b/17.1_variable/myapache/defaults/main.yml index 8c667e1..23578c8 100644 --- a/17.1_variable/myapache/defaults/main.yml +++ b/17.1_variable/myapache/defaults/main.yml @@ -1,2 +1,3 @@ --- -# defaults file for myapache \ No newline at end of file +# defaults file for myapache +http_port: 80 \ No newline at end of file diff --git a/17.1_variable/myapache/tasks/main.yml b/17.1_variable/myapache/tasks/main.yml index 83c9a22..535a553 100644 --- a/17.1_variable/myapache/tasks/main.yml +++ b/17.1_variable/myapache/tasks/main.yml @@ -19,7 +19,7 @@ notify: reload httpd template: src: vhost.conf.jj - dest: /etc/httpd/conf.d/vhost_{{ servername }}.conf + dest: /etc/httpd/conf.d/vhost_{{ apache_servername }}.conf mode: 0640 owner: root group: apache @@ -40,11 +40,11 @@ - name: create documentroot file: - name: "{{ documentroot }}" + name: "{{ apache_documentroot }}" state: directory - name: create index file template: src: index.html - dest: "{{ documentroot }}/index.html" + dest: "{{ apache_documentroot }}/index.html" mode: 0644 \ No newline at end of file diff --git a/17.1_variable/myapache/templates/index.html b/17.1_variable/myapache/templates/index.html index 14125e9..74918d6 100644 --- a/17.1_variable/myapache/templates/index.html +++ b/17.1_variable/myapache/templates/index.html @@ -1 +1 @@ -

hello World this is {{ servername}}

\ No newline at end of file +

hello World this is {{ apache_servername}}

\ No newline at end of file diff --git a/17.1_variable/myapache/templates/vhost.conf.jj b/17.1_variable/myapache/templates/vhost.conf.jj index 2d2bc01..f8b6d9e 100644 --- a/17.1_variable/myapache/templates/vhost.conf.jj +++ b/17.1_variable/myapache/templates/vhost.conf.jj @@ -1,17 +1,17 @@ - ServerName {{ servername }} - ServerAlias {{ serveralias }} + ServerName {{ apache_servername }} + ServerAlias {{ apache_serveralias }} ServerAlias {{ inventory_hostname }} - DocumentRoot {{ documentroot }} - CustomLog {{ accesslog }} combined - ErrorLog {{ errorlog }} + DocumentRoot {{ apache_documentroot }} + CustomLog {{ apache_accesslog }} combined + ErrorLog {{ apache_errorlog }} Options none Allowoverride none Require all denied - + Require all granted \ No newline at end of file diff --git a/17.1_variable/myapache/vars/main.yml b/17.1_variable/myapache/vars/main.yml index 8c4b0a1..3e650be 100644 --- a/17.1_variable/myapache/vars/main.yml +++ b/17.1_variable/myapache/vars/main.yml @@ -1,3 +1,2 @@ --- -# vars file for myapache -http_port: 80 \ No newline at end of file +# vars file for myapache \ No newline at end of file