From aa1dac8c30203224d37b2b4ef5719a73d9245a36 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 26 Nov 2019 11:19:22 +0200 Subject: [PATCH] roles: Fix syntax for testing booleans ansible-lint told me not to test equality with booleans using literal "True" and "False", but it Ansible complains if I use "is True" also. It seems that I need to adjust the syntax slightly. --- roles/nginx/tasks/main.yml | 2 +- roles/nginx/tasks/wordpress.yml | 4 ++-- roles/php-fpm/tasks/Debian_10.yml | 2 +- roles/php-fpm/tasks/Ubuntu.yml | 2 +- roles/php-fpm/tasks/Ubuntu_18.04.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/nginx/tasks/main.yml b/roles/nginx/tasks/main.yml index 85bc9e0..db65c8f 100644 --- a/roles/nginx/tasks/main.yml +++ b/roles/nginx/tasks/main.yml @@ -71,7 +71,7 @@ - name: Configure Let's Encrypt include_tasks: letsencrypt.yml - when: use_letsencrypt is defined and use_letsencrypt is True + when: use_letsencrypt is defined and use_letsencrypt tags: letsencrypt # vim: set ts=2 sw=2: diff --git a/roles/nginx/tasks/wordpress.yml b/roles/nginx/tasks/wordpress.yml index 8cf7840..11d7a2c 100644 --- a/roles/nginx/tasks/wordpress.yml +++ b/roles/nginx/tasks/wordpress.yml @@ -3,12 +3,12 @@ - block: - name: Install WordPress git: repo=https://github.com/WordPress/WordPress.git dest={{ nginx_root_prefix }}/{{ item.domain_name }}/wordpress version={{ item.wordpress_version }} depth=1 force=yes - when: item.has_wordpress is defined and item.has_wordpress is True + when: item.has_wordpress is defined and item.has_wordpress loop: "{{ nginx_vhosts }}" - name: Fix WordPress directory permissions file: path={{ nginx_root_prefix }}/{{ item.domain_name }} state=directory owner=nginx group=nginx recurse=yes - when: item.has_wordpress is defined and item.has_wordpress is True + when: item.has_wordpress is defined and item.has_wordpress loop: "{{ nginx_vhosts }}" tags: wordpress diff --git a/roles/php-fpm/tasks/Debian_10.yml b/roles/php-fpm/tasks/Debian_10.yml index 6e4affe..cee0af5 100644 --- a/roles/php-fpm/tasks/Debian_10.yml +++ b/roles/php-fpm/tasks/Debian_10.yml @@ -20,7 +20,7 @@ - name: Copy php-fpm pool config template: src=php7.3-pool.conf.j2 dest=/etc/php/7.3/fpm/pool.d/{{ item.domain_name }}.conf owner=root group=root mode=0644 loop: "{{ nginx_vhosts }}" - when: (item.has_wordpress is defined and item.has_wordpress is True) or (item.needs_php is defined and item.needs_php is True) + when: (item.has_wordpress is defined and item.has_wordpress) or (item.needs_php is defined and item.needs_php) notify: reload php7.3-fpm - name: Remove default www pool diff --git a/roles/php-fpm/tasks/Ubuntu.yml b/roles/php-fpm/tasks/Ubuntu.yml index 28f5715..15a448f 100644 --- a/roles/php-fpm/tasks/Ubuntu.yml +++ b/roles/php-fpm/tasks/Ubuntu.yml @@ -20,7 +20,7 @@ - name: Copy php-fpm pool config template: src=php7.0-pool.conf.j2 dest=/etc/php/7.0/fpm/pool.d/{{ item.domain_name }}.conf owner=root group=root mode=0644 loop: "{{ nginx_vhosts }}" - when: (item.has_wordpress is defined and item.has_wordpress is True) or (item.needs_php is defined and item.needs_php is True) + when: (item.has_wordpress is defined and item.has_wordpress) or (item.needs_php is defined and item.needs_php) notify: reload php7.0-fpm - name: Remove default www pool diff --git a/roles/php-fpm/tasks/Ubuntu_18.04.yml b/roles/php-fpm/tasks/Ubuntu_18.04.yml index 481d0a1..4b53dc4 100644 --- a/roles/php-fpm/tasks/Ubuntu_18.04.yml +++ b/roles/php-fpm/tasks/Ubuntu_18.04.yml @@ -20,7 +20,7 @@ - name: Copy php-fpm pool config template: src=php7.2-pool.conf.j2 dest=/etc/php/7.2/fpm/pool.d/{{ item.domain_name }}.conf owner=root group=root mode=0644 loop: "{{ nginx_vhosts }}" - when: (item.has_wordpress is defined and item.has_wordpress is True) or (item.needs_php is defined and item.needs_php is True) + when: (item.has_wordpress is defined and item.has_wordpress) or (item.needs_php is defined and item.needs_php) notify: reload php7.2-fpm - name: Remove default www pool