roles: use longer format for when conditionals
When the condition is an AND we can use this more succinct format.
This commit is contained in:
@ -44,7 +44,9 @@
|
||||
ansible.builtin.file:
|
||||
dest: "{{ letsencrypt_acme_script_temp }}"
|
||||
state: absent
|
||||
when: acme_install.rc is defined and acme_install.rc == 0
|
||||
when:
|
||||
- acme_install.rc is defined
|
||||
- acme_install.rc == 0
|
||||
|
||||
- name: Set default certificate authority for acme.sh
|
||||
ansible.builtin.command:
|
||||
|
@ -3,12 +3,16 @@
|
||||
- block:
|
||||
- name: Install WordPress
|
||||
ansible.builtin.git: repo=https://github.com/WordPress/WordPress.git dest={{ nginx_root_prefix }}/{{ item.domain_name }}/wordpress version={{ item.wordpress_version }} depth=1 force=true
|
||||
when: item.has_wordpress is defined and item.has_wordpress
|
||||
when:
|
||||
- item.has_wordpress is defined
|
||||
- item.has_wordpress == true
|
||||
loop: "{{ nginx_vhosts }}"
|
||||
|
||||
- name: Fix WordPress directory permissions
|
||||
ansible.builtin.file: path={{ nginx_root_prefix }}/{{ item.domain_name }} state=directory owner=nginx group=nginx recurse=true
|
||||
when: item.has_wordpress is defined and item.has_wordpress
|
||||
when:
|
||||
- item.has_wordpress is defined
|
||||
- item.has_wordpress == true
|
||||
loop: "{{ nginx_vhosts }}"
|
||||
tags: wordpress
|
||||
|
||||
|
Reference in New Issue
Block a user