From d4f58b9395096039e6cb14419cf4ca9ff15ff319 Mon Sep 17 00:00:00 2001 From: David Prevot Date: Mon, 12 Dec 2022 14:29:07 +0100 Subject: [PATCH] Drop duplicate when keys introduced in fafff25c202095e7d140fb70ba6c4c7461bb1c05 --- evolinux-users/tasks/user.yml | 5 +++-- lxc/tasks/create-container.yml | 20 ++++++++++++-------- munin/tasks/main.yml | 5 +++-- mysql/tasks/utils.yml | 5 +++-- php/tasks/config_cli.yml | 5 +++-- php/tasks/main_bookworm.yml | 10 ++++++---- php/tasks/main_buster.yml | 10 ++++++---- php/tasks/main_jessie.yml | 10 ++++++---- php/tasks/main_stretch.yml | 10 ++++++---- php/tasks/sury_post.yml | 10 ++++++---- 10 files changed, 54 insertions(+), 36 deletions(-) diff --git a/evolinux-users/tasks/user.yml b/evolinux-users/tasks/user.yml index 50af1812..d6bcde9b 100644 --- a/evolinux-users/tasks/user.yml +++ b/evolinux-users/tasks/user.yml @@ -160,8 +160,9 @@ dest: '/home/{{ user.name }}/.profile' insertafter: EOF line: 'trap "sudo /usr/share/scripts/evomaintenance.sh" 0' - when: grep_profile_evomaintenance.rc != 0 - when: not ansible_check_mode + when: + - grep_profile_evomaintenance.rc != 0 + - not ansible_check_mode # SSH keys diff --git a/lxc/tasks/create-container.yml b/lxc/tasks/create-container.yml index b841bb67..24e009f9 100644 --- a/lxc/tasks/create-container.yml +++ b/lxc/tasks/create-container.yml @@ -13,23 +13,26 @@ template: debian state: stopped template_options: "--arch amd64 --release {{ release }}" - when: container_exists.stdout_lines | length == 0 - when: not ansible_check_mode + when: + - container_exists.stdout_lines | length == 0 + - not ansible_check_mode - name: "Disable network configuration inside container {{ name }}" replace: name: "/var/lib/lxc/{{ name }}/rootfs/etc/default/networking" regexp: "^#CONFIGURE_INTERFACES=yes" replace: CONFIGURE_INTERFACES=no - when: lxc_network_type == "none" - when: not ansible_check_mode + when: + - lxc_network_type == "none" + - not ansible_check_mode - name: "Disable interface shut down on halt inside container {{ name }} (Jessie container)" lineinfile: name: "/var/lib/lxc/{{ name }}/rootfs/etc/default/halt" line: "NETDOWN=no" - when: lxc_network_type == "none" and release == "jessie" - when: not ansible_check_mode + when: + - lxc_network_type == "none" and release == "jessie" + - not ansible_check_mode - name: "Make the container {{ name }} poweroff on SIGPWR sent by lxc-stop (Jessie container)" file: @@ -55,8 +58,9 @@ name: "/var/lib/lxc/{{ name }}/rootfs/etc/rc.local" line: "chmod 755 /dev" insertbefore: "^exit 0$" - when: release == 'jessie' - when: not ansible_check_mode + when: + - release == 'jessie' + - not ansible_check_mode - name: "Ensure that {{ name }} container is running" lxc_container: diff --git a/munin/tasks/main.yml b/munin/tasks/main.yml index f4aab7c6..93f50e07 100644 --- a/munin/tasks/main.yml +++ b/munin/tasks/main.yml @@ -32,8 +32,9 @@ removes: /var/lib/munin/localdomain notify: restart munin-node - when: not ansible_hostname == "localdomain" - when: not ansible_check_mode + when: + - not ansible_hostname == "localdomain" + - not ansible_check_mode tags: - munin diff --git a/mysql/tasks/utils.yml b/mysql/tasks/utils.yml index 9ae7fd15..e3fe76da 100644 --- a/mysql/tasks/utils.yml +++ b/mysql/tasks/utils.yml @@ -155,8 +155,9 @@ src: "{{ _mysql_scripts_dir }}/mysql-optimize.sh" dest: /etc/cron.{{ mysql_cron_optimize_frequency | mandatory }}/mysql-optimize.sh state: link - when: mysql_cron_optimize | bool - when: not ansible_check_mode + when: + - mysql_cron_optimize | bool + - not ansible_check_mode tags: - mysql diff --git a/php/tasks/config_cli.yml b/php/tasks/config_cli.yml index 19030c0c..e4fac4a7 100644 --- a/php/tasks/config_cli.yml +++ b/php/tasks/config_cli.yml @@ -36,5 +36,6 @@ mode: "0644" loop: - { option: "date.timezone", value: "Europe/Paris" } - when: php_symfony_requirements | bool - when: not ansible_check_mode + when: + - php_symfony_requirements | bool + - not ansible_check_mode diff --git a/php/tasks/main_bookworm.yml b/php/tasks/main_bookworm.yml index b9dd9ac2..49c91719 100644 --- a/php/tasks/main_bookworm.yml +++ b/php/tasks/main_bookworm.yml @@ -95,8 +95,9 @@ file: dest: /etc/php/{{ php_version }}/fpm mode: "0755" - when: php_fpm_enable - when: not ansible_check_mode + when: + - php_fpm_enable + - not ansible_check_mode - include: config_apache.yml when: php_apache_enable @@ -105,8 +106,9 @@ file: dest: /etc/php/{{ php_version }}/apache2 mode: "0755" - when: php_apache_enable - when: not ansible_check_mode + when: + - php_apache_enable + - not ansible_check_mode - include: sury_post.yml when: php_sury_enable diff --git a/php/tasks/main_buster.yml b/php/tasks/main_buster.yml index ff27e410..eff2dc8f 100644 --- a/php/tasks/main_buster.yml +++ b/php/tasks/main_buster.yml @@ -84,8 +84,9 @@ file: dest: /etc/php/7.3/fpm mode: "0755" - when: php_fpm_enable | bool - when: not ansible_check_mode + when: + - php_fpm_enable | bool + - not ansible_check_mode - include: config_apache.yml when: php_apache_enable | bool @@ -94,8 +95,9 @@ file: dest: /etc/php/7.3/apache2 mode: "0755" - when: php_apache_enable | bool - when: not ansible_check_mode + when: + - php_apache_enable | bool + - not ansible_check_mode - include: sury_post.yml when: php_sury_enable | bool diff --git a/php/tasks/main_jessie.yml b/php/tasks/main_jessie.yml index 1082dcf5..a5aecdb7 100644 --- a/php/tasks/main_jessie.yml +++ b/php/tasks/main_jessie.yml @@ -73,8 +73,9 @@ file: dest: /etc/php5/fpm mode: "0755" - when: php_fpm_enable | bool - when: not ansible_check_mode + when: + - php_fpm_enable | bool + - not ansible_check_mode - include: config_apache.yml when: php_apache_enable | bool @@ -83,5 +84,6 @@ file: dest: /etc/php5/apache2 mode: "0755" - when: php_apache_enable | bool - when: not ansible_check_mode + when: + - php_apache_enable | bool + - not ansible_check_mode diff --git a/php/tasks/main_stretch.yml b/php/tasks/main_stretch.yml index 6188877c..6934fa6a 100644 --- a/php/tasks/main_stretch.yml +++ b/php/tasks/main_stretch.yml @@ -85,8 +85,9 @@ file: dest: /etc/php/7.0/fpm mode: "0755" - when: php_fpm_enable | bool - when: not ansible_check_mode + when: + - php_fpm_enable | bool + - not ansible_check_mode - include: config_apache.yml when: php_apache_enable | bool @@ -95,8 +96,9 @@ file: dest: /etc/php/7.0/apache2 mode: "0755" - when: php_apache_enable | bool - when: not ansible_check_mode + when: + - php_apache_enable | bool + - not ansible_check_mode - include: sury_post.yml when: php_sury_enable | bool diff --git a/php/tasks/sury_post.yml b/php/tasks/sury_post.yml index 14ffabab..6855214b 100644 --- a/php/tasks/sury_post.yml +++ b/php/tasks/sury_post.yml @@ -31,8 +31,9 @@ file: dest: /etc/php/7.4/apache2 mode: "0755" - when: php_apache_enable | bool - when: not ansible_check_mode + when: + - php_apache_enable | bool + - not ansible_check_mode - name: Symlink Evolix FPM config files from 7.4 to 7.0 file: @@ -51,5 +52,6 @@ file: dest: /etc/php/7.4/fpm mode: "0755" - when: php_fpm_enable | bool - when: not ansible_check_mode + when: + - php_fpm_enable | bool + - not ansible_check_mode