From 69ef0c5a4677b9a73248931bce5165fd4eaf3bec Mon Sep 17 00:00:00 2001 From: Hector Akamine Date: Fri, 19 Feb 2016 14:39:24 -0800 Subject: [PATCH 1/2] Fix bare variables (ansible 2 warnings) --- tasks/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 97e4260..6ae3da1 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,13 +8,13 @@ - name: Install the nginx packages yum: name={{ item }} state=present - with_items: redhat_pkg + with_items: {{ redhat_pkg }} when: ansible_distribution == 'CentOS' tags: [packages,nginx] - name: Install the nginx packages apt: name={{ item }} state=present update_cache=yes - with_items: ubuntu_pkg + with_items: {{ ubuntu_pkg }} when: ansible_os_family == "Debian" tags: [packages,nginx] @@ -38,19 +38,19 @@ - name: Ensure auth_basic files created template: src=auth_basic.j2 dest=/etc/nginx/auth_basic/{{ item }} owner=root group={{nginx_group}} mode=0750 - with_items: nginx_auth_basic_files.keys() + with_items: {{ nginx_auth_basic_files.keys() }} tags: [configuration,nginx] - name: Create the configurations for sites template: src=site.conf.j2 dest=/etc/nginx/sites-available/{{ item }}.conf - with_items: nginx_sites.keys() + with_items: {{ nginx_sites.keys() }} notify: - Reload nginx tags: [configuration,nginx] - name: Create links for sites-enabled file: state=link src=/etc/nginx/sites-available/{{ item }}.conf dest=/etc/nginx/sites-enabled/{{ item }}.conf - with_items: nginx_sites.keys() + with_items: {{ nginx_sites.keys() }} notify: - Reload nginx tags: [configuration,nginx] @@ -64,7 +64,7 @@ - name: Create the configurations for independante config file template: src=config.conf.j2 dest=/etc/nginx/conf.d/{{ item }}.conf - with_items: nginx_configs.keys() + with_items: {{ nginx_configs.keys() }} notify: - Reload nginx tags: [configuration,nginx] From d2916a3ba2b85260a97c37f574b4e7408427d4a8 Mon Sep 17 00:00:00 2001 From: Hector Akamine Date: Fri, 19 Feb 2016 17:36:51 -0800 Subject: [PATCH 2/2] Fix missing quotation marks --- tasks/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 6ae3da1..e0a5ef0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,13 +8,13 @@ - name: Install the nginx packages yum: name={{ item }} state=present - with_items: {{ redhat_pkg }} + with_items: "{{ redhat_pkg }}" when: ansible_distribution == 'CentOS' tags: [packages,nginx] - name: Install the nginx packages apt: name={{ item }} state=present update_cache=yes - with_items: {{ ubuntu_pkg }} + with_items: "{{ ubuntu_pkg }}" when: ansible_os_family == "Debian" tags: [packages,nginx] @@ -38,19 +38,19 @@ - name: Ensure auth_basic files created template: src=auth_basic.j2 dest=/etc/nginx/auth_basic/{{ item }} owner=root group={{nginx_group}} mode=0750 - with_items: {{ nginx_auth_basic_files.keys() }} + with_items: "{{ nginx_auth_basic_files.keys() }}" tags: [configuration,nginx] - name: Create the configurations for sites template: src=site.conf.j2 dest=/etc/nginx/sites-available/{{ item }}.conf - with_items: {{ nginx_sites.keys() }} + with_items: "{{ nginx_sites.keys() }}" notify: - Reload nginx tags: [configuration,nginx] - name: Create links for sites-enabled file: state=link src=/etc/nginx/sites-available/{{ item }}.conf dest=/etc/nginx/sites-enabled/{{ item }}.conf - with_items: {{ nginx_sites.keys() }} + with_items: "{{ nginx_sites.keys() }}" notify: - Reload nginx tags: [configuration,nginx] @@ -64,7 +64,7 @@ - name: Create the configurations for independante config file template: src=config.conf.j2 dest=/etc/nginx/conf.d/{{ item }}.conf - with_items: {{ nginx_configs.keys() }} + with_items: "{{ nginx_configs.keys() }}" notify: - Reload nginx tags: [configuration,nginx]