From db9f049e681b74fe2f571530395f6c800e402d6b Mon Sep 17 00:00:00 2001 From: Thomas Constans Date: Tue, 30 Nov 2021 15:05:35 +0100 Subject: [PATCH] with_items -> loop et adaptation nouvelle infra --- apache/tasks/main.yml | 13 ++++++++++--- .../{cible1 => centos1.formation.opendoor.fr.yml} | 0 host_vars/cible2 | 11 ----------- 3 files changed, 10 insertions(+), 14 deletions(-) rename host_vars/{cible1 => centos1.formation.opendoor.fr.yml} (100%) delete mode 100644 host_vars/cible2 diff --git a/apache/tasks/main.yml b/apache/tasks/main.yml index cc71c22..10ecfae 100644 --- a/apache/tasks/main.yml +++ b/apache/tasks/main.yml @@ -10,7 +10,6 @@ name: "{{ apache_package_name}}" state: latest - - name: conf httpd tags: httpd notify: reload httpd @@ -43,7 +42,15 @@ file: name: "{{ item.documentroot }}" state: directory - with_items: + loop: + - "{{ apache_vhosts }}" + +- name: create documentroot/Private + tags: httpd + file: + name: "{{ item.documentroot }}/Private" + state: directory + loop: - "{{ apache_vhosts }}" - name: create index file @@ -52,5 +59,5 @@ src: index.html dest: "{{ item.documentroot }}/index.html" mode: 0644 - with_items: + loop: - "{{ apache_vhosts }}" \ No newline at end of file diff --git a/host_vars/cible1 b/host_vars/centos1.formation.opendoor.fr.yml similarity index 100% rename from host_vars/cible1 rename to host_vars/centos1.formation.opendoor.fr.yml diff --git a/host_vars/cible2 b/host_vars/cible2 deleted file mode 100644 index 213ca4e..0000000 --- a/host_vars/cible2 +++ /dev/null @@ -1,11 +0,0 @@ -apache_vhosts: -- servername: foobar.com - serveralias: www.foobar.com - documentroot: /var/www/html/foobar.com - accesslog: /var/log/httpd/access_foobar.com_log - errorlog: /var/log/httpd/error_foobar.com_log -- servername: AllYourBaseAreBelong2.us - serveralias: www.AllYourBaseAreBelong2.us - documentroot: /var/www/html/AllYourBaseAreBelong2.us - accesslog: /var/log/httpd/access_AllYourBaseAreBelong2.us_log - errorlog: /var/log/httpd/error_AllYourBaseAreBelong2.us_log \ No newline at end of file