From 5138065059263e0eb0c7fe39df2c311fa2f6d7c9 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Tue, 4 May 2021 14:18:40 +0200 Subject: [PATCH] Use 'loop' syntax instead of 'with_items' --- CHANGELOG.md | 2 +- amazon-ec2/tasks/create-instance.yml | 6 +++--- apache/tasks/auth.yml | 4 ++-- apache/tasks/ip_whitelist.yml | 4 ++-- apache/tasks/main.yml | 6 +++--- apache/tasks/munin.yml | 2 +- apt/tasks/basics.yml | 2 +- apt/tasks/config.yml | 4 ++-- bind/tasks/munin.yml | 4 ++-- clamav/tasks/main.yml | 4 ++-- docker-host/tasks/main.yml | 2 +- dovecot/tasks/main.yml | 2 +- etc-git/tasks/repository.yml | 2 +- evoacme/tasks/conf.yml | 4 ++-- evoacme/tasks/scripts.yml | 2 +- evobackup-client/tasks/open_ssh_ports.yml | 2 +- evolinux-base/tasks/kernel.yml | 6 +++--- evolinux-base/tasks/packages.yml | 2 +- evolinux-base/tasks/postfix.yml | 4 ++-- evolinux-base/tasks/provider_orange_fce.yml | 2 +- evolinux-base/tasks/root.yml | 4 ++-- evolinux-base/tasks/system.yml | 4 ++-- evolinux-users/tasks/user.yml | 4 ++-- evomaintenance/tasks/install_vendor_debian.yml | 2 +- evomaintenance/tasks/install_vendor_openbsd.yml | 2 +- evomaintenance/tasks/minifirewall.yml | 2 +- fail2ban/tasks/main.yml | 4 ++-- filebeat/tasks/main.yml | 2 +- java/tasks/oracle.yml | 2 +- kibana/tasks/main.yml | 2 +- kvm-host/tasks/munin.yml | 2 +- kvm-host/tasks/ssh.yml | 4 ++-- ldap/tasks/nagios.yml | 4 ++-- lxc-php/tasks/php56.yml | 2 +- lxc-php/tasks/php70.yml | 2 +- lxc-php/tasks/php73.yml | 2 +- lxc-php/tasks/php74.yml | 4 ++-- lxc-solr/tasks/main.yml | 4 ++-- memcached/tasks/munin.yml | 2 +- metricbeat/tasks/main.yml | 2 +- minifirewall/tasks/config.yml | 2 +- mongodb/tasks/main_buster.yml | 4 ++-- munin/tasks/main.yml | 4 ++-- mysql-oracle/tasks/munin.yml | 4 ++-- mysql-oracle/tasks/nrpe.yml | 2 +- mysql-oracle/tasks/users.yml | 2 +- mysql/tasks/munin.yml | 4 ++-- mysql/tasks/nrpe.yml | 2 +- mysql/tasks/users_jessie.yml | 2 +- mysql/tasks/users_stretch.yml | 2 +- nameserver/tasks/main.yml | 4 ++-- newrelic/tasks/php.yml | 4 ++-- nginx/tasks/ip_whitelist.yml | 4 ++-- nginx/tasks/main.yml | 4 ++-- nginx/tasks/munin_graphs.yml | 2 +- opendkim/tasks/main.yml | 2 +- packweb-apache/tasks/apache.yml | 4 ++-- packweb-apache/tasks/fhs_retrictions.yml | 8 ++++---- packweb-apache/tasks/main.yml | 7 +++---- php/tasks/config_apache.yml | 4 ++-- php/tasks/config_cli.yml | 4 ++-- php/tasks/config_fpm.yml | 6 +++--- php/tasks/main_buster.yml | 2 +- php/tasks/main_stretch.yml | 2 +- php/tasks/sury_post.yml | 6 +++--- postfix/tasks/common.yml | 2 +- postfix/tasks/packmail.yml | 6 +++--- postfix/tasks/slow_transport.yml | 2 +- postgresql/tasks/locales.yml | 2 +- postgresql/tasks/munin.yml | 2 +- postgresql/tasks/packages_jessie.yml | 2 +- postgresql/tests/test.yml | 2 +- proftpd/tasks/accounts.yml | 12 ++++++------ rbenv/tasks/main.yml | 4 ++-- redis/tasks/default-munin.yml | 2 +- redis/tasks/instance-munin.yml | 2 +- redis/tasks/instance-server.yml | 8 ++++---- redmine/tasks/config.yml | 4 ++-- redmine/tasks/mysql.yml | 2 +- redmine/tasks/source.yml | 12 ++++++------ redmine/tasks/user.yml | 2 +- squid/tasks/main.yml | 4 ++-- squid/tasks/minifirewall.yml | 2 +- tomcat-instance/tasks/bootstrap.yml | 2 +- varnish/tasks/main.yml | 2 +- varnish/tasks/munin.yml | 2 +- vrrpd/tasks/main.yml | 2 +- webapps/evoadmin-web/tasks/packages.yml | 2 +- webapps/evoadmin-web/tasks/user.yml | 2 +- webapps/nextcloud/tasks/mysql.yml | 2 +- webapps/nextcloud/tasks/user.yml | 2 +- webapps/roundcube/tasks/main.yml | 2 +- webapps/wordpress/tasks/main.yml | 6 +++--- 93 files changed, 154 insertions(+), 155 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6bbfc1e..8d8b9417 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ The **patch** part changes incrementally at each release. ### Changed -* Use 'loop' syntax instead of 'with_first_found' +* Use 'loop' syntax instead of 'with_first_found/with_items' * apt: store keys in /etc/apt/trusted.gpg.d in ascii format * evolinux-base: copy GPG key instead of using apt-key * ntpd: Add leapfile configuration setting to ntpd on debian 10+ diff --git a/amazon-ec2/tasks/create-instance.yml b/amazon-ec2/tasks/create-instance.yml index 470cac72..a3f84b1a 100644 --- a/amazon-ec2/tasks/create-instance.yml +++ b/amazon-ec2/tasks/create-instance.yml @@ -21,11 +21,11 @@ groupname: launched-instances ansible_user: admin ansible_ssh_common_args: "-o StrictHostKeyChecking=no" - with_items: "{{ec2.instances}}" + loop: "{{ec2.instances}}" - debug: msg: "Your newly created instance is reachable at: {{item.public_dns_name}}" - with_items: "{{ec2.instances}}" + loop: "{{ec2.instances}}" - name: Wait for SSH to come up on all instances (give up after 2m) wait_for: @@ -33,4 +33,4 @@ host: "{{item.public_dns_name}}" port: 22 timeout: 120 - with_items: "{{ec2.instances}}" + loop: "{{ec2.instances}}" diff --git a/apache/tasks/auth.yml b/apache/tasks/auth.yml index b785c704..b66fbe98 100644 --- a/apache/tasks/auth.yml +++ b/apache/tasks/auth.yml @@ -40,7 +40,7 @@ dest: /etc/apache2/private_htpasswd line: "{{ item }}" state: present - with_items: "{{ apache_private_htpasswd_present }}" + loop: "{{ apache_private_htpasswd_present }}" notify: reload apache tags: - apache @@ -50,7 +50,7 @@ dest: /etc/apache2/private_htpasswd line: "{{ item }}" state: absent - with_items: "{{ apache_private_htpasswd_absent }}" + loop: "{{ apache_private_htpasswd_absent }}" notify: reload apache tags: - apache diff --git a/apache/tasks/ip_whitelist.yml b/apache/tasks/ip_whitelist.yml index ac2b6f87..18f4a681 100644 --- a/apache/tasks/ip_whitelist.yml +++ b/apache/tasks/ip_whitelist.yml @@ -5,7 +5,7 @@ dest: /etc/apache2/ipaddr_whitelist.conf line: "Require ip {{ item }}" state: present - with_items: "{{ apache_ipaddr_whitelist_present }}" + loop: "{{ apache_ipaddr_whitelist_present }}" notify: reload apache tags: - apache @@ -16,7 +16,7 @@ dest: /etc/apache2/ipaddr_whitelist.conf line: "Require ip {{ item }}" state: absent - with_items: "{{ apache_ipaddr_whitelist_absent }}" + loop: "{{ apache_ipaddr_whitelist_absent }}" notify: reload apache tags: - apache diff --git a/apache/tasks/main.yml b/apache/tasks/main.yml index 7be38e1f..a52bd886 100644 --- a/apache/tasks/main.yml +++ b/apache/tasks/main.yml @@ -42,7 +42,7 @@ apache2_module: name: '{{ item }}' state: present - with_items: + loop: - rewrite - expires - headers @@ -58,7 +58,7 @@ apache2_module: name: '{{ item }}' state: present - with_items: + loop: - cgi notify: reload apache when: apache_mpm == "prefork" or apache_mpm == "itk" @@ -102,7 +102,7 @@ command: "a2enconf {{ item }}" register: command_result changed_when: "'Enabling' in command_result.stderr" - with_items: + loop: - z-evolinux-defaults.conf - zzz-evolinux-custom.conf notify: reload apache diff --git a/apache/tasks/munin.yml b/apache/tasks/munin.yml index 144ae0f8..fe07a5cf 100644 --- a/apache/tasks/munin.yml +++ b/apache/tasks/munin.yml @@ -15,7 +15,7 @@ src: "/usr/share/munin/plugins/{{ item }}" dest: "/etc/munin/plugins/{{ item }}" state: link - with_items: + loop: - apache_accesses - apache_processes - apache_volume diff --git a/apt/tasks/basics.yml b/apt/tasks/basics.yml index 3b9aadd6..83d3e7dc 100644 --- a/apt/tasks/basics.yml +++ b/apt/tasks/basics.yml @@ -14,7 +14,7 @@ file: path: '{{ item }}' state: absent - with_items: + loop: - /etc/apt/sources.list.d/debian-security.list - /etc/apt/sources.list.d/debian-jessie.list - /etc/apt/sources.list.d/debian-stretch.list diff --git a/apt/tasks/config.yml b/apt/tasks/config.yml index 48892b9e..e854d4c6 100644 --- a/apt/tasks/config.yml +++ b/apt/tasks/config.yml @@ -8,7 +8,7 @@ create: yes state: present mode: "0640" - with_items: + loop: - { line: "APT::Install-Recommends \"false\";", regexp: 'APT::Install-Recommends' } - { line: "APT::Install-Suggests \"false\";", regexp: 'APT::Install-Suggests' } - { line: "APT::Periodic::Enable \"0\";", regexp: 'APT::Periodic::Enable' } @@ -23,7 +23,7 @@ create: yes state: present mode: "0640" - with_items: + loop: - "DPkg::Pre-Invoke { \"df /tmp | grep -q /tmp && mount -oremount,exec /tmp || true\"; };" - "DPkg::Pre-Invoke { \"df /usr | grep -q /usr && mount -oremount,rw /usr || true\"; };" - "DPkg::Post-Invoke { \"df /tmp | grep -q /tmp && mount -oremount /tmp || true\"; };" diff --git a/bind/tasks/munin.yml b/bind/tasks/munin.yml index 5f9da280..f97ddf85 100644 --- a/bind/tasks/munin.yml +++ b/bind/tasks/munin.yml @@ -14,7 +14,7 @@ src: "/usr/share/munin/plugins/{{ item }}" dest: "/etc/munin/plugins/{{ item }}" state: link - with_items: + loop: - bind9 - bind9_rndc notify: restart munin-node @@ -30,7 +30,7 @@ src: "/usr/share/munin/plugins/{{ item }}" dest: "/etc/munin/plugins/{{ item }}" state: link - with_items: + loop: - bind9 - bind9_rndc notify: restart munin-node diff --git a/clamav/tasks/main.yml b/clamav/tasks/main.yml index 27d30cbc..be9e5b00 100644 --- a/clamav/tasks/main.yml +++ b/clamav/tasks/main.yml @@ -5,7 +5,7 @@ question: "{{ item.key }}" value: "{{ item.value }}" vtype: "{{ item.type }}" - with_items: + loop: - { key: 'clamav-daemon/debconf', type: 'boolean', value: 'true' } - { key: 'clamav-daemon/MaxHTMLNormalize', type: 'string', value: '10M' } - { key: 'clamav-daemon/StatsPEDisabled', type: 'boolean', value: 'true' } @@ -57,7 +57,7 @@ question: "{{ item.key }}" value: "{{ item.value }}" vtype: "{{ item.type }}" - with_items: + loop: - { key: 'clamav-freshclam/autoupdate_freshclam', type: 'select', value: 'daemon' } - { key: 'clamav-freshclam/proxy_user', type: 'string', value: '' } - { key: 'clamav-freshclam/NotifyClamd', type: 'boolean', value: 'true' } diff --git a/docker-host/tasks/main.yml b/docker-host/tasks/main.yml index 437de2a4..c32701bb 100644 --- a/docker-host/tasks/main.yml +++ b/docker-host/tasks/main.yml @@ -80,7 +80,7 @@ src: "{{ item }}.j2" dest: "{{ docker_tls_path }}/{{ item }}" mode: "0744" - with_items: + loop: - shellpki.sh - openssl.cnf when: docker_tls_enabled diff --git a/dovecot/tasks/main.yml b/dovecot/tasks/main.yml index 1a7e4280..aa817086 100644 --- a/dovecot/tasks/main.yml +++ b/dovecot/tasks/main.yml @@ -24,7 +24,7 @@ line: "{{ item.key }} = {{ item.value }}" regexp: "^#*{{ item.key }}" state: present - with_items: + loop: - { key: 'hosts', value: '127.0.0.1' } - { key: 'auth_bind', value: 'yes' } - { key: 'ldap_version', value: 3 } diff --git a/etc-git/tasks/repository.yml b/etc-git/tasks/repository.yml index 1430c5bd..9be0a436 100644 --- a/etc-git/tasks/repository.yml +++ b/etc-git/tasks/repository.yml @@ -46,7 +46,7 @@ lineinfile: dest: "{{ repository_path }}/.gitignore" line: "{{ item }}" - with_items: "{{ gitignore_items | default([]) }}" + loop: "{{ gitignore_items | default([]) }}" tags: - etc-git diff --git a/evoacme/tasks/conf.yml b/evoacme/tasks/conf.yml index 4d9f6704..402fbdcf 100644 --- a/evoacme/tasks/conf.yml +++ b/evoacme/tasks/conf.yml @@ -4,7 +4,7 @@ section: 'req' option: "{{ item.name }}" value: "{{ item.var }}" - with_items: + loop: - { name: 'default_bits', var: "{{ evoacme_ssl_key_size }}" } - { name: 'encrypt_key', var: 'yes' } - { name: 'distinguished_name', var: 'req_dn' } @@ -16,7 +16,7 @@ section: 'req_dn' option: "{{ item.name }}" value: "{{ item.var }}" - with_items: + loop: - { name: 'C', var: "{{ evoacme_ssl_ct }}" } - { name: 'ST', var: "{{ evoacme_ssl_state }}" } - { name: 'L', var: "{{ evoacme_ssl_loc }}" } diff --git a/evoacme/tasks/scripts.yml b/evoacme/tasks/scripts.yml index 50d95890..89aacff8 100644 --- a/evoacme/tasks/scripts.yml +++ b/evoacme/tasks/scripts.yml @@ -39,6 +39,6 @@ file: path: "/usr/local/bin/{{ item }}" state: absent - with_items: + loop: - 'make-csr' - 'evoacme' diff --git a/evobackup-client/tasks/open_ssh_ports.yml b/evobackup-client/tasks/open_ssh_ports.yml index be96c161..3d1701ef 100644 --- a/evobackup-client/tasks/open_ssh_ports.yml +++ b/evobackup-client/tasks/open_ssh_ports.yml @@ -14,7 +14,7 @@ marker: "# {mark} {{ item.name }}" block: | /sbin/iptables -A INPUT -p tcp --sport {{ item.port }} --dport 1024:65535 -s {{ item.ip }} -m state --state ESTABLISHED,RELATED -j ACCEPT - with_items: "{{ evobackup_client__hosts }}" + loop: "{{ evobackup_client__hosts }}" notify: restart minifirewall when: evobackup_client__minifirewall.stat.exists tags: diff --git a/evolinux-base/tasks/kernel.yml b/evolinux-base/tasks/kernel.yml index 95912855..e19ab0e6 100644 --- a/evolinux-base/tasks/kernel.yml +++ b/evolinux-base/tasks/kernel.yml @@ -7,7 +7,7 @@ sysctl_file: "{{ evolinux_kernel_sysctl_path }}" state: present reload: yes - with_items: + loop: - { name: kernel.panic_on_oops, value: 1 } - { name: kernel.panic, value: 60 } when: evolinux_kernel_reboot_after_panic @@ -18,7 +18,7 @@ sysctl_file: "{{ evolinux_kernel_sysctl_path }}" state: absent reload: yes - with_items: + loop: - kernel.panic_on_oops - kernel.panic when: not evolinux_kernel_reboot_after_panic @@ -57,7 +57,7 @@ sysctl_file: "{{ evolinux_kernel_sysctl_path }}" state: present reload: yes - with_items: + loop: - { name: "net.ipv4.ipfrag_low_thresh", value: 196608 } - { name: "net.ipv6.ip6frag_low_thresh", value: 196608 } - { name: "net.ipv4.ipfrag_high_thresh", value: 262144 } diff --git a/evolinux-base/tasks/packages.yml b/evolinux-base/tasks/packages.yml index ed2b1cd2..afedf1a4 100644 --- a/evolinux-base/tasks/packages.yml +++ b/evolinux-base/tasks/packages.yml @@ -128,7 +128,7 @@ dest: /etc/apt/listchanges.conf regexp: '^{{ item.option }}\s*=' line: "{{ item.option }}={{ item.value }}" - with_items: + loop: - { option: "confirm", value: "1" } - { option: "which", value: "both" } when: diff --git a/evolinux-base/tasks/postfix.yml b/evolinux-base/tasks/postfix.yml index aa60e737..e83a190b 100644 --- a/evolinux-base/tasks/postfix.yml +++ b/evolinux-base/tasks/postfix.yml @@ -45,7 +45,7 @@ dest: /etc/aliases regexp: "^{{ item }}:.*" line: "{{ item }}: root" - with_items: "{{ non_root_users_list.stdout_lines }}" + loop: "{{ non_root_users_list.stdout_lines }}" notify: newaliases when: evolinux_postfix_users_alias_root tags: @@ -56,7 +56,7 @@ dest: /etc/aliases regexp: "^{{ item }}:.*" line: "{{ item }}: root" - with_items: + loop: - postmaster - abuse - mailer-daemon diff --git a/evolinux-base/tasks/provider_orange_fce.yml b/evolinux-base/tasks/provider_orange_fce.yml index 6cef30fb..4b9a26c7 100644 --- a/evolinux-base/tasks/provider_orange_fce.yml +++ b/evolinux-base/tasks/provider_orange_fce.yml @@ -5,7 +5,7 @@ sysctl_file: /etc/sysctl.d/evolinux_fce.conf state: present reload: yes - with_items: + loop: - { name: net.ipv4.tcp_keepalive_time, value: 250 } - { name: net.ipv4.tcp_keepalive_intvl, value: 60 } - { name: net.ipv6.conf.all.disable_ipv6, value: 1 } diff --git a/evolinux-base/tasks/root.yml b/evolinux-base/tasks/root.yml index 23f3cd9c..ce57d4fd 100644 --- a/evolinux-base/tasks/root.yml +++ b/evolinux-base/tasks/root.yml @@ -13,7 +13,7 @@ line: "{{ item }}" create: yes state: present - with_items: + loop: - "export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoreboth,erasedups" - "export HISTSIZE=65535" - "export HISTTIMEFORMAT=\"%c : \"" @@ -79,7 +79,7 @@ line: "{{ item }}" create: yes state: present - with_items: + loop: - "syntax on" - "set background=dark" - "set expandtab" diff --git a/evolinux-base/tasks/system.yml b/evolinux-base/tasks/system.yml index 55820890..06661ada 100644 --- a/evolinux-base/tasks/system.yml +++ b/evolinux-base/tasks/system.yml @@ -13,7 +13,7 @@ line: "{{ item }}" create: yes state: present - with_items: + loop: - "en_US.UTF-8 UTF-8" - "fr_FR ISO-8859-1" - "fr_FR.UTF-8 UTF-8" @@ -112,7 +112,7 @@ dest: /etc/crontab regexp: "{{ item.regexp }}" replace: "{{ item.replace }}" - with_items: + loop: - { regexp: '^17((\s*\*){4})', replace: '{{ 59|random(start=1) }}\1' } - { regexp: '^25\s*6((\s*\*){3})', replace: '{{ 59|random(start=1) }} {{ [0,1,3,4,5,6,7]|random }}\1' } - { regexp: '^47\s*6((\s*\*){2}\s*7)', replace: '{{ 59|random(start=1) }} {{ [0,1,3,4,5,6,7]|random }}\1' } diff --git a/evolinux-users/tasks/user.yml b/evolinux-users/tasks/user.yml index b8dda1d2..0d2105bd 100644 --- a/evolinux-users/tasks/user.yml +++ b/evolinux-users/tasks/user.yml @@ -120,7 +120,7 @@ - name: "Secondary Unix groups are present" group: name: "{{ group }}" - with_items: "{{ user.groups }}" + loop: "{{ user.groups }}" loop_control: loop_var: group when: @@ -184,7 +184,7 @@ user: "{{ user.name }}" key: "{{ ssk_key }}" state: present - with_items: "{{ user.ssh_keys }}" + loop: "{{ user.ssh_keys }}" loop_control: loop_var: ssk_key when: user.ssh_keys is defined diff --git a/evomaintenance/tasks/install_vendor_debian.yml b/evomaintenance/tasks/install_vendor_debian.yml index a3d29b95..96bbee86 100644 --- a/evomaintenance/tasks/install_vendor_debian.yml +++ b/evomaintenance/tasks/install_vendor_debian.yml @@ -42,7 +42,7 @@ mode: "{{ item.mode }}" force: yes backup: yes - with_items: + loop: - { src: 'evomaintenance.sh', dest: '/usr/share/scripts/', mode: '0700' } - { src: 'evomaintenance.tpl', dest: '/usr/share/scripts/', mode: '0600' } tags: diff --git a/evomaintenance/tasks/install_vendor_openbsd.yml b/evomaintenance/tasks/install_vendor_openbsd.yml index 37307cfb..e82a9a39 100644 --- a/evomaintenance/tasks/install_vendor_openbsd.yml +++ b/evomaintenance/tasks/install_vendor_openbsd.yml @@ -28,7 +28,7 @@ mode: "{{ item.mode }}" force: yes backup: yes - with_items: + loop: - { src: 'evomaintenance.sh', dest: '/usr/share/scripts/', mode: '0700' } - { src: 'evomaintenance.tpl', dest: '/usr/share/scripts/', mode: '0600' } tags: diff --git a/evomaintenance/tasks/minifirewall.yml b/evomaintenance/tasks/minifirewall.yml index fc6ed0a5..c99bd34f 100644 --- a/evomaintenance/tasks/minifirewall.yml +++ b/evomaintenance/tasks/minifirewall.yml @@ -12,7 +12,7 @@ dest: /etc/default/minifirewall line: "/sbin/iptables -A INPUT -p tcp --sport 5432 --dport 1024:65535 -s {{ item }} -m state --state ESTABLISHED,RELATED -j ACCEPT" insertafter: "^# EvoMaintenance" - with_items: "{{ evomaintenance_hosts }}" + loop: "{{ evomaintenance_hosts }}" notify: "{{ minifirewall_restart_handler_name }}" when: minifirewall_default_file.stat.exists tags: diff --git a/fail2ban/tasks/main.yml b/fail2ban/tasks/main.yml index e496c07e..5e4909d6 100644 --- a/fail2ban/tasks/main.yml +++ b/fail2ban/tasks/main.yml @@ -9,7 +9,7 @@ owner: root group: root mode: "0755" - with_items: + loop: - "/etc/fail2ban" - "/etc/fail2ban/filter.d" tags: @@ -52,7 +52,7 @@ src: "{{ item }}" dest: /etc/fail2ban/filter.d/ mode: "0644" - with_items: + loop: - dovecot-evolix.conf - sasl-evolix.conf - wordpress-soft.conf diff --git a/filebeat/tasks/main.yml b/filebeat/tasks/main.yml index 283ba1ce..d5c61322 100644 --- a/filebeat/tasks/main.yml +++ b/filebeat/tasks/main.yml @@ -120,7 +120,7 @@ regexp: '{{ item.regexp }}' line: '{{ item.line }}' insertafter: "output.elasticsearch:" - with_items: + loop: - { regexp: '^ #?username: .*', line: ' username: "{{ filebeat_elasticsearch_auth_username }}"' } - { regexp: '^ #?password: .*', line: ' password: "{{ filebeat_elasticsearch_auth_password }}"' } notify: restart filebeat diff --git a/java/tasks/oracle.yml b/java/tasks/oracle.yml index a2268b7b..bbdd86f4 100644 --- a/java/tasks/oracle.yml +++ b/java/tasks/oracle.yml @@ -13,7 +13,7 @@ path: "{{ item }}" state: directory mode: "0777" - with_items: + loop: - /srv/java-package - /srv/java-package/src - /srv/java-package/tmp diff --git a/kibana/tasks/main.yml b/kibana/tasks/main.yml index b32fea15..832cdee3 100644 --- a/kibana/tasks/main.yml +++ b/kibana/tasks/main.yml @@ -107,7 +107,7 @@ # args: # creates: "/var/lib/kibana/{{ item }}" # notify: restart kibana -# with_items: +# loop: # - optimize # - data diff --git a/kvm-host/tasks/munin.yml b/kvm-host/tasks/munin.yml index fe5c0217..dc130238 100644 --- a/kvm-host/tasks/munin.yml +++ b/kvm-host/tasks/munin.yml @@ -5,7 +5,7 @@ url: "https://raw.githubusercontent.com/munin-monitoring/contrib/master/plugins/libvirt/{{ item }}" dest: "/etc/munin/plugins/" mode: "0755" - with_items: + loop: - kvm_cpu - kvm_io - kvm_mem diff --git a/kvm-host/tasks/ssh.yml b/kvm-host/tasks/ssh.yml index bdfac0d0..7e42238b 100644 --- a/kvm-host/tasks/ssh.yml +++ b/kvm-host/tasks/ssh.yml @@ -33,7 +33,7 @@ special_time: "hourly" user: root job: "rsync -a --delete /etc/libvirt/qemu/ {{ hostvars[item]['ansible_hostname'] }}:/root/libvirt-{{ inventory_hostname }}/" - with_items: + loop: - "{{ groups['hypervisors'] }}" when: item != inventory_hostname @@ -44,6 +44,6 @@ special_time: "daily" user: root job: "virsh list | ssh {{ hostvars[item]['ansible_hostname'] }} 'cat >/root/libvirt-{{ inventory_hostname }}/virsh-list.txt'" - with_items: + loop: - "{{ groups['hypervisors'] }}" when: item != inventory_hostname diff --git a/ldap/tasks/nagios.yml b/ldap/tasks/nagios.yml index a9cb5751..97db7dba 100644 --- a/ldap/tasks/nagios.yml +++ b/ldap/tasks/nagios.yml @@ -47,7 +47,7 @@ option: "{{ item.option }}" value: "{{ item.value }}" mode: "0640" - with_items: + loop: - { option: 'hostname', value: '127.0.0.1' } - { option: 'base', value: "{{ ldap_suffix }}" } - { option: 'bind', value: "cn=nagios,ou=ldapusers,{{ ldap_suffix }}" } @@ -66,7 +66,7 @@ # and set the variable - name: overwrite ldap_nagios_password (from file) set_fact: - ldap_nagios_password: "{{ lookup('ini', 'pass section=check_ldap file=/tmp/{{ inventory_hostname }}/etc/nagios/monitoring-plugins.ini') }}" + ldap_nagios_password: "{{ lookup('ini', 'pass section=check_ldap file=/tmp/{{ inventory_hostname }}/monitoring-plugins.ini') }}" - name: hash password for cn=nagios command: "slappasswd -s {{ ldap_nagios_password }}" diff --git a/lxc-php/tasks/php56.yml b/lxc-php/tasks/php56.yml index b10bb772..ece7dc8d 100644 --- a/lxc-php/tasks/php56.yml +++ b/lxc-php/tasks/php56.yml @@ -11,7 +11,7 @@ dest: "{{ line_item }}" mode: "0644" notify: "Reload {{ lxc_php_version }}-fpm" - with_items: + loop: - "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php5/fpm/conf.d/z-evolinux-defaults.ini" - "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php5/cli/conf.d/z-evolinux-defaults.ini" loop_control: diff --git a/lxc-php/tasks/php70.yml b/lxc-php/tasks/php70.yml index 8cbb0125..2291b386 100644 --- a/lxc-php/tasks/php70.yml +++ b/lxc-php/tasks/php70.yml @@ -11,7 +11,7 @@ dest: "{{ line_item }}" mode: "0644" notify: "Reload {{ lxc_php_version }}-fpm" - with_items: + loop: - "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php/7.0/fpm/conf.d/z-evolinux-defaults.ini" - "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php/7.0/cli/conf.d/z-evolinux-defaults.ini" loop_control: diff --git a/lxc-php/tasks/php73.yml b/lxc-php/tasks/php73.yml index eae17e4e..d7fd7937 100644 --- a/lxc-php/tasks/php73.yml +++ b/lxc-php/tasks/php73.yml @@ -11,7 +11,7 @@ dest: "{{ line_item }}" mode: "0644" notify: "Reload {{ lxc_php_version }}-fpm" - with_items: + loop: - "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php/7.3/fpm/conf.d/z-evolinux-defaults.ini" - "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php/7.3/cli/conf.d/z-evolinux-defaults.ini" loop_control: diff --git a/lxc-php/tasks/php74.yml b/lxc-php/tasks/php74.yml index db25ee4e..1f3bc516 100644 --- a/lxc-php/tasks/php74.yml +++ b/lxc-php/tasks/php74.yml @@ -12,7 +12,7 @@ state: present create: yes mode: "0644" - with_items: + loop: - "deb https://packages.sury.org/php/ buster main" - "deb http://pub.evolix.net/ buster-php74/" @@ -44,7 +44,7 @@ dest: "{{ line_item }}" mode: "0644" notify: "Reload {{ lxc_php_version }}-fpm" - with_items: + loop: - "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php/7.4/fpm/conf.d/z-evolinux-defaults.ini" - "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php/7.4/cli/conf.d/z-evolinux-defaults.ini" loop_control: diff --git a/lxc-solr/tasks/main.yml b/lxc-solr/tasks/main.yml index a18c46dc..3fad863f 100644 --- a/lxc-solr/tasks/main.yml +++ b/lxc-solr/tasks/main.yml @@ -8,9 +8,9 @@ path: "/var/lib/lxc/{{ item.name }}/rootfs" state: directory mode: '0755' - with_items: + loop: - "{{ lxc_containers }}" - include: "solr.yml name={{item.name}} solr_version={{item.solr_version}} solr_port={{item.solr_port}}" - with_items: + loop: - "{{ lxc_containers }}" diff --git a/memcached/tasks/munin.yml b/memcached/tasks/munin.yml index c7ea3da9..cd75fa64 100644 --- a/memcached/tasks/munin.yml +++ b/memcached/tasks/munin.yml @@ -26,7 +26,7 @@ src: '/usr/share/munin/plugins/memcached_' dest: /etc/munin/plugins/{{ multi }}{{ item }} state: link - with_items: + loop: - memcached_bytes - memcached_counters - memcached_rates diff --git a/metricbeat/tasks/main.yml b/metricbeat/tasks/main.yml index a4706046..5d8ee2c9 100644 --- a/metricbeat/tasks/main.yml +++ b/metricbeat/tasks/main.yml @@ -78,7 +78,7 @@ regexp: '{{ item.regexp }}' line: '{{ item.line }}' insertafter: "output.elasticsearch:" - with_items: + loop: - { regexp: '^ #?username: .*', line: ' username: "{{ metricbeat_elasticsearch_auth_username }}"' } - { regexp: '^ #?password: .*', line: ' password: "{{ metricbeat_elasticsearch_auth_password }}"' } notify: restart metricbeat diff --git a/minifirewall/tasks/config.yml b/minifirewall/tasks/config.yml index 4c852d6b..1b556674 100644 --- a/minifirewall/tasks/config.yml +++ b/minifirewall/tasks/config.yml @@ -184,7 +184,7 @@ dest: "{{ minifirewall_main_file }}" line: "/sbin/iptables -A INPUT -p tcp --sport 5432 --dport 1024:65535 -s {{ item }} -m state --state ESTABLISHED,RELATED -j ACCEPT" insertafter: "^# EvoMaintenance" - with_items: "{{ evomaintenance_hosts }}" + loop: "{{ evomaintenance_hosts }}" - name: remove minifirewall example rule for the evomaintenance lineinfile: diff --git a/mongodb/tasks/main_buster.yml b/mongodb/tasks/main_buster.yml index 53e75168..15e7fdc3 100644 --- a/mongodb/tasks/main_buster.yml +++ b/mongodb/tasks/main_buster.yml @@ -57,7 +57,7 @@ src: "munin/{{ item }}" dest: '/usr/local/share/munin/plugins/{{ item }}' force: yes - with_items: + loop: - mongo_btree - mongo_collections - mongo_conn @@ -73,7 +73,7 @@ src: '/usr/local/share/munin/plugins/{{ item }}' dest: /etc/munin/plugins/{{ item }} state: link - with_items: + loop: - mongo_btree - mongo_collections - mongo_conn diff --git a/munin/tasks/main.yml b/munin/tasks/main.yml index 344962f8..aab79f62 100644 --- a/munin/tasks/main.yml +++ b/munin/tasks/main.yml @@ -35,7 +35,7 @@ file: path: '/etc/munin/plugins/{{ item }}' state: absent - with_items: + loop: - http_loadtime - exim_mailqueue - exim_mailstats @@ -52,7 +52,7 @@ src: "/usr/share/munin/plugins/{{ item }}" dest: "/etc/munin/plugins/{{ item }}" state: link - with_items: + loop: - meminfo - netstat_multi - tcp diff --git a/mysql-oracle/tasks/munin.yml b/mysql-oracle/tasks/munin.yml index 70e871e1..b9e633b0 100644 --- a/mysql-oracle/tasks/munin.yml +++ b/mysql-oracle/tasks/munin.yml @@ -22,7 +22,7 @@ src: '/usr/share/munin/plugins/{{ item }}' dest: /etc/munin/plugins/{{ item }} state: link - with_items: + loop: - mysql_bytes - mysql_queries - mysql_slowqueries @@ -34,7 +34,7 @@ src: /usr/share/munin/plugins/mysql_ dest: '/etc/munin/plugins/mysql_{{ item }}' state: link - with_items: + loop: - commands - connections - files_tables diff --git a/mysql-oracle/tasks/nrpe.yml b/mysql-oracle/tasks/nrpe.yml index c02fc007..58820786 100644 --- a/mysql-oracle/tasks/nrpe.yml +++ b/mysql-oracle/tasks/nrpe.yml @@ -44,7 +44,7 @@ section: client option: '{{ item.option }}' value: '{{ item.value }}' - with_items: + loop: - { option: 'user', value: 'nrpe' } - { option: 'password', value: '{{ mysql_nrpe_password.stdout }}' } when: create_nrpe_user.changed diff --git a/mysql-oracle/tasks/users.yml b/mysql-oracle/tasks/users.yml index 50e0fb58..508ab4cc 100644 --- a/mysql-oracle/tasks/users.yml +++ b/mysql-oracle/tasks/users.yml @@ -36,7 +36,7 @@ option: '{{ item.option }}' value: '{{ item.value }}' create: yes - with_items: + loop: - { option: 'user', value: 'mysqladmin' } - { option: 'password', value: '{{ mysql_admin_password.stdout }}' } when: create_mysqladmin_user is changed diff --git a/mysql/tasks/munin.yml b/mysql/tasks/munin.yml index c7017aa2..f2a333e7 100644 --- a/mysql/tasks/munin.yml +++ b/mysql/tasks/munin.yml @@ -22,7 +22,7 @@ src: '/usr/share/munin/plugins/{{ item }}' dest: /etc/munin/plugins/{{ item }} state: link - with_items: + loop: - mysql_bytes - mysql_queries - mysql_slowqueries @@ -34,7 +34,7 @@ src: /usr/share/munin/plugins/mysql_ dest: '/etc/munin/plugins/mysql_{{ item }}' state: link - with_items: + loop: - commands - connections - files_tables diff --git a/mysql/tasks/nrpe.yml b/mysql/tasks/nrpe.yml index c02fc007..58820786 100644 --- a/mysql/tasks/nrpe.yml +++ b/mysql/tasks/nrpe.yml @@ -44,7 +44,7 @@ section: client option: '{{ item.option }}' value: '{{ item.value }}' - with_items: + loop: - { option: 'user', value: 'nrpe' } - { option: 'password', value: '{{ mysql_nrpe_password.stdout }}' } when: create_nrpe_user.changed diff --git a/mysql/tasks/users_jessie.yml b/mysql/tasks/users_jessie.yml index f11e41af..027d0bd8 100644 --- a/mysql/tasks/users_jessie.yml +++ b/mysql/tasks/users_jessie.yml @@ -42,7 +42,7 @@ option: '{{ item.option }}' value: '{{ item.value }}' create: yes - with_items: + loop: - { option: 'user', value: 'mysqladmin' } - { option: 'password', value: '{{ mysql_admin_password.stdout }}' } when: create_mysqladmin_user.changed diff --git a/mysql/tasks/users_stretch.yml b/mysql/tasks/users_stretch.yml index 70ae9933..0613de19 100644 --- a/mysql/tasks/users_stretch.yml +++ b/mysql/tasks/users_stretch.yml @@ -37,7 +37,7 @@ option: '{{ item.option }}' value: '{{ item.value }}' create: yes - with_items: + loop: - { option: 'user', value: 'mysqladmin' } - { option: 'password', value: '{{ mysql_admin_password.stdout }}' } when: create_mysqladmin_user.changed diff --git a/nameserver/tasks/main.yml b/nameserver/tasks/main.yml index 4623fffc..420e65af 100644 --- a/nameserver/tasks/main.yml +++ b/nameserver/tasks/main.yml @@ -12,7 +12,7 @@ dest: /etc/resolv.conf line: "nameserver {{ item }}" state: present - with_items: "{{ nameservers }}" + loop: "{{ nameservers }}" tags: - nameserver @@ -21,7 +21,7 @@ dest: /etc/resolv.conf line: "nameserver {{ item }}" state: absent - with_items: "{{ grep_nameserver.stdout_lines }}" + loop: "{{ grep_nameserver.stdout_lines }}" when: item not in nameservers tags: - nameserver diff --git a/newrelic/tasks/php.yml b/newrelic/tasks/php.yml index 7d1177dc..5d44e8e5 100644 --- a/newrelic/tasks/php.yml +++ b/newrelic/tasks/php.yml @@ -27,14 +27,14 @@ dest: "{{ item }}" regexp: '^;?newrelic.daemon.utilization.detect_aws' line: 'newrelic.daemon.utilization.detect_aws = false' - with_items: "{{ find_newrelic_ini.stdout_lines }}" + loop: "{{ find_newrelic_ini.stdout_lines }}" - name: Disable Docker detection lineinfile: dest: "{{ item }}" regexp: '^;?newrelic.daemon.utilization.detect_docker' line: 'newrelic.daemon.utilization.detect_docker = false' - with_items: "{{ find_newrelic_ini.stdout_lines }}" + loop: "{{ find_newrelic_ini.stdout_lines }}" - name: Install package for PHP apt: diff --git a/nginx/tasks/ip_whitelist.yml b/nginx/tasks/ip_whitelist.yml index 10cdcc37..2667d1d3 100644 --- a/nginx/tasks/ip_whitelist.yml +++ b/nginx/tasks/ip_whitelist.yml @@ -5,7 +5,7 @@ dest: /etc/nginx/snippets/ipaddr_whitelist line: "allow {{ item }};" state: present - with_items: "{{ nginx_ipaddr_whitelist_present }}" + loop: "{{ nginx_ipaddr_whitelist_present }}" notify: reload nginx tags: - nginx @@ -16,7 +16,7 @@ dest: /etc/nginx/snippets/ipaddr_whitelist line: "allow {{ item }};" state: absent - with_items: "{{ nginx_ipaddr_whitelist_absent }}" + loop: "{{ nginx_ipaddr_whitelist_absent }}" notify: reload nginx tags: - nginx diff --git a/nginx/tasks/main.yml b/nginx/tasks/main.yml index 6fe9a94e..58b9f95b 100644 --- a/nginx/tasks/main.yml +++ b/nginx/tasks/main.yml @@ -80,7 +80,7 @@ dest: /etc/nginx/snippets/private_htpasswd line: "{{ item }}" state: present - with_items: "{{ nginx_private_htpasswd_present }}" + loop: "{{ nginx_private_htpasswd_present }}" notify: reload nginx tags: - nginx @@ -90,7 +90,7 @@ dest: /etc/nginx/snippets/private_htpasswd line: "{{ item }}" state: absent - with_items: "{{ nginx_private_htpasswd_absent }}" + loop: "{{ nginx_private_htpasswd_absent }}" notify: reload nginx tags: - nginx diff --git a/nginx/tasks/munin_graphs.yml b/nginx/tasks/munin_graphs.yml index 470f8fd6..ae0bb9ac 100644 --- a/nginx/tasks/munin_graphs.yml +++ b/nginx/tasks/munin_graphs.yml @@ -12,7 +12,7 @@ src: '/usr/share/munin/plugins/{{ item }}' dest: '/etc/munin/plugins/{{ item }}' state: link - with_items: + loop: - nginx_request - nginx_status notify: restart munin diff --git a/opendkim/tasks/main.yml b/opendkim/tasks/main.yml index 901d03f2..1db961e2 100644 --- a/opendkim/tasks/main.yml +++ b/opendkim/tasks/main.yml @@ -38,7 +38,7 @@ owner: opendkim group: opendkim mode: "0640" - with_items: + loop: - 'KeyTable' - 'SigningTable' changed_when: False diff --git a/packweb-apache/tasks/apache.yml b/packweb-apache/tasks/apache.yml index 61d37341..57b360ce 100644 --- a/packweb-apache/tasks/apache.yml +++ b/packweb-apache/tasks/apache.yml @@ -28,7 +28,7 @@ apache2_module: name: '{{ item }}' state: present - with_items: + loop: - ssl - include - negotiation @@ -56,6 +56,6 @@ command: "a2enconf {{ item }}" register: command_result changed_when: "'Enabling' in command_result.stderr" - with_items: + loop: - evolinux-evasive - evolinux-modsec diff --git a/packweb-apache/tasks/fhs_retrictions.yml b/packweb-apache/tasks/fhs_retrictions.yml index 1d370038..7fa41478 100644 --- a/packweb-apache/tasks/fhs_retrictions.yml +++ b/packweb-apache/tasks/fhs_retrictions.yml @@ -5,7 +5,7 @@ register: command_result changed_when: "'changed' in command_result.stdout" failed_when: False - with_items: + loop: - / - /etc - /usr @@ -29,7 +29,7 @@ register: command_result changed_when: "'changed' in command_result.stdout" failed_when: False - with_items: + loop: - /var/log/apt - /var/lib/dpkg - /var/log/munin @@ -51,7 +51,7 @@ register: command_result changed_when: "'changed' in command_result.stdout" failed_when: False - with_items: + loop: - /bin/ping - /bin/ping6 - /usr/bin/fping @@ -63,6 +63,6 @@ register: command_result changed_when: "'changed' in command_result.stdout" failed_when: False - with_items: + loop: - /var/log/evolix.log - /etc/warnquota.conf diff --git a/packweb-apache/tasks/main.yml b/packweb-apache/tasks/main.yml index 922dcea8..6122c4a2 100644 --- a/packweb-apache/tasks/main.yml +++ b/packweb-apache/tasks/main.yml @@ -41,7 +41,7 @@ path: "/etc/skel/{{ item.path }}" state: "{{ item.state }}" mode: "{{ item.mode }}" - with_items: + loop: - { path: log, mode: "0750", state: directory } - { path: awstats, mode: "0750", state: directory } - { path: www, mode: "0750", state: directory } @@ -50,7 +50,7 @@ command: "touch /etc/skel/log/{{ item }}" args: creates: "/etc/skel/log/{{ item }}" - with_items: + loop: - access.log - error.log @@ -58,7 +58,7 @@ file: dest: "/etc/skel/log/{{ item }}" mode: "0644" - with_items: + loop: - access.log - error.log @@ -85,7 +85,6 @@ - include: apache.yml - include: phpmyadmin.yml - when: ansible_distribution_release != "buster" - include: awstats.yml diff --git a/php/tasks/config_apache.yml b/php/tasks/config_apache.yml index 1ce74733..3ae9738c 100644 --- a/php/tasks/config_apache.yml +++ b/php/tasks/config_apache.yml @@ -8,7 +8,7 @@ value: "{{ item.value }}" mode: "0644" create: yes - with_items: + loop: - { option: "short_open_tag", value: "Off" } - { option: "expose_php", value: "Off" } - { option: "display_errors", value: "Off" } @@ -42,6 +42,6 @@ option: "{{ item.option }}" value: "{{ item.value }}" mode: "0644" - with_items: + loop: - { option: "date.timezone", value: "Europe/Paris" } when: php_symfony_requirements diff --git a/php/tasks/config_cli.yml b/php/tasks/config_cli.yml index 23ed695c..c4678cd5 100644 --- a/php/tasks/config_cli.yml +++ b/php/tasks/config_cli.yml @@ -7,7 +7,7 @@ value: "{{ item.value }}" mode: "0644" create: yes - with_items: + loop: - { option: "display_errors", value: "On" } - { option: "allow_url_fopen", value: "On" } - { option: "disable_functions", value: "" } @@ -33,6 +33,6 @@ option: "{{ item.option }}" value: "{{ item.value }}" mode: "0644" - with_items: + loop: - { option: "date.timezone", value: "Europe/Paris" } when: php_symfony_requirements diff --git a/php/tasks/config_fpm.yml b/php/tasks/config_fpm.yml index 1644fd6a..57680ea9 100644 --- a/php/tasks/config_fpm.yml +++ b/php/tasks/config_fpm.yml @@ -8,7 +8,7 @@ value: "{{ item.value }}" mode: "0644" create: yes - with_items: + loop: - { option: "short_open_tag", value: "Off" } - { option: "expose_php", value: "Off" } - { option: "display_errors", value: "Off" } @@ -43,7 +43,7 @@ value: "{{ item.value }}" mode: "0644" create: yes - with_items: + loop: - { option: "user", value: "www-data" } - { option: "group", value: "www-data" } - { option: "listen", value: "{{ php_fpm_default_pool_socket }}" } @@ -76,7 +76,7 @@ option: "{{ item.option }}" value: "{{ item.value }}" mode: "0644" - with_items: + loop: - { option: "date.timezone", value: "Europe/Paris" } notify: "restart {{ php_fpm_service_name }}" when: php_symfony_requirements diff --git a/php/tasks/main_buster.yml b/php/tasks/main_buster.yml index 16eed389..c757d539 100644 --- a/php/tasks/main_buster.yml +++ b/php/tasks/main_buster.yml @@ -65,7 +65,7 @@ file: dest: "{{ item }}" mode: "0755" - with_items: + loop: - /etc/php - /etc/php/7.3 diff --git a/php/tasks/main_stretch.yml b/php/tasks/main_stretch.yml index 136fa346..004aec02 100644 --- a/php/tasks/main_stretch.yml +++ b/php/tasks/main_stretch.yml @@ -65,7 +65,7 @@ file: dest: "{{ item }}" mode: "0755" - with_items: + loop: - /etc/php - /etc/php/7.0 diff --git a/php/tasks/sury_post.yml b/php/tasks/sury_post.yml index ecfb13dc..3f82d23d 100644 --- a/php/tasks/sury_post.yml +++ b/php/tasks/sury_post.yml @@ -6,7 +6,7 @@ dest: "{{ item.dest }}" force: yes state: link - with_items: + loop: - { src: "{{ php_cli_defaults_ini_file }}", dest: "/etc/php/7.4/cli/conf.d/z-evolinux-defaults.ini" } - { src: "{{ php_cli_custom_ini_file }}", dest: "/etc/php/7.4/cli/conf.d/zzz-evolinux-custom.ini" } @@ -21,7 +21,7 @@ dest: "{{ item.dest }}" force: yes state: link - with_items: + loop: - { src: "{{ php_apache_defaults_ini_file }}", dest: "/etc/php/7.4/apache2/conf.d/z-evolinux-defaults.ini" } - { src: "{{ php_apache_custom_ini_file }}", dest: "/etc/php/7.4/apache2/conf.d/zzz-evolinux-custom.ini" } when: php_apache_enable @@ -38,7 +38,7 @@ dest: "{{ item.dest }}" force: yes state: link - with_items: + loop: - { src: "{{ php_fpm_defaults_ini_file }}", dest: "/etc/php/7.4/fpm/conf.d/z-evolinux-defaults.ini" } - { src: "{{ php_fpm_custom_ini_file }}", dest: "/etc/php/7.4/fpm/conf.d/zzz-evolinux-custom.ini" } - { src: "{{ php_fpm_defaults_conf_file }}", dest: "/etc/php/7.4/fpm/pool.d/z-evolinux-defaults.conf" } diff --git a/postfix/tasks/common.yml b/postfix/tasks/common.yml index 08ee6a56..bcd5ed79 100644 --- a/postfix/tasks/common.yml +++ b/postfix/tasks/common.yml @@ -14,7 +14,7 @@ line: '{{ item }}' state: present create: no - with_items: + loop: - "postfix/sa-blacklist.access" - "postfix/*.db" tags: diff --git a/postfix/tasks/packmail.yml b/postfix/tasks/packmail.yml index f6900639..cf4482ed 100644 --- a/postfix/tasks/packmail.yml +++ b/postfix/tasks/packmail.yml @@ -37,7 +37,7 @@ src: filter dest: "/etc/postfix/{{ item }}" force: no - with_items: + loop: - virtual - client.access - client.access_local @@ -55,7 +55,7 @@ - name: postmap filter files command: "postmap /etc/postfix/{{ item }}" - with_items: + loop: - virtual - client.access - client.access_local @@ -76,7 +76,7 @@ src: "{{ item }}.j2" dest: "/etc/postfix/{{ item }}" mode: "0644" - with_items: + loop: - virtual_aliases.cf - virtual_domains.cf - virtual_mailboxes.cf diff --git a/postfix/tasks/slow_transport.yml b/postfix/tasks/slow_transport.yml index 2f4cab1e..2f1867ae 100644 --- a/postfix/tasks/slow_transport.yml +++ b/postfix/tasks/slow_transport.yml @@ -13,7 +13,7 @@ dest: /etc/postfix/transport line: "{{ item }}" create: yes - with_items: + loop: - "orange.fr slow:" - "wanadoo.fr slow:" - "voila.fr slow:" diff --git a/postgresql/tasks/locales.yml b/postgresql/tasks/locales.yml index 89687a7c..8cf70989 100644 --- a/postgresql/tasks/locales.yml +++ b/postgresql/tasks/locales.yml @@ -6,7 +6,7 @@ locale_gen: name: "{{ item }}" state: present - with_items: + loop: - "fr_FR.UTF-8" become: yes notify: reconfigure locales diff --git a/postgresql/tasks/munin.yml b/postgresql/tasks/munin.yml index e576b4cd..5292b017 100644 --- a/postgresql/tasks/munin.yml +++ b/postgresql/tasks/munin.yml @@ -14,7 +14,7 @@ state: link src: '/usr/share/munin/plugins/{{item}}' dest: '/etc/munin/plugins/{{item}}' - with_items: + loop: - postgres_bgwriter - postgres_checkpoints - postgres_connections_db diff --git a/postgresql/tasks/packages_jessie.yml b/postgresql/tasks/packages_jessie.yml index 3e21bc0e..ba21632e 100644 --- a/postgresql/tasks/packages_jessie.yml +++ b/postgresql/tasks/packages_jessie.yml @@ -11,7 +11,7 @@ - name: Install postgresql package apt: name: '{{item}}' - with_items: + loop: - "postgresql-{{postgresql_version}}" - ptop - libdbd-pg-perl diff --git a/postgresql/tests/test.yml b/postgresql/tests/test.yml index d8386b29..06bd32ac 100644 --- a/postgresql/tests/test.yml +++ b/postgresql/tests/test.yml @@ -15,7 +15,7 @@ create: yes state: present changed_when: false - with_items: + loop: - "en_US.UTF-8 UTF-8" - "fr_FR ISO-8859-1" - "fr_FR.UTF-8 UTF-8" diff --git a/proftpd/tasks/accounts.yml b/proftpd/tasks/accounts.yml index 95098df2..20b1d3d2 100644 --- a/proftpd/tasks/accounts.yml +++ b/proftpd/tasks/accounts.yml @@ -1,14 +1,14 @@ --- - include: accounts_password.yml when: item.password is undefined - with_items: "{{ proftpd_accounts }}" + loop: "{{ proftpd_accounts }}" tags: - proftpd - set_fact: proftpd_accounts_final: "{{ proftpd_accounts_final + [ item ] }}" when: item.password is defined - with_items: "{{ proftpd_accounts }}" + loop: "{{ proftpd_accounts }}" tags: - proftpd @@ -20,7 +20,7 @@ mode: "0440" line: "{{ item.name | mandatory }}:{{ item.password }}:{{ item.uid }}:{{ item.gid }}::{{ item.home | mandatory }}:/bin/false" regexp: "^{{ item.name }}:.*" - with_items: "{{ proftpd_accounts_final }}" + loop: "{{ proftpd_accounts_final }}" notify: restart proftpd tags: - proftpd @@ -31,7 +31,7 @@ state: present line: "\tAllowUser {{ item.name }}" insertbefore: "DenyAll" - with_items: "{{ proftpd_accounts_final }}" + loop: "{{ proftpd_accounts_final }}" notify: restart proftpd when: proftpd_ftp_enable tags: @@ -43,7 +43,7 @@ state: present line: "\tAllowUser {{ item.name }}" insertbefore: "DenyAll" - with_items: "{{ proftpd_accounts_final }}" + loop: "{{ proftpd_accounts_final }}" notify: restart proftpd when: proftpd_ftps_enable tags: @@ -55,7 +55,7 @@ state: present line: "\tAllowUser {{ item.name }}" insertbefore: "DenyAll" - with_items: "{{ proftpd_accounts_final }}" + loop: "{{ proftpd_accounts_final }}" notify: restart proftpd when: proftpd_sftp_enable tags: diff --git a/rbenv/tasks/main.yml b/rbenv/tasks/main.yml index 28f25481..08f8242e 100644 --- a/rbenv/tasks/main.yml +++ b/rbenv/tasks/main.yml @@ -46,7 +46,7 @@ owner: '{{ username }}' group: '{{ username }}' create: yes - with_items: '{{ rbenv_default_gems }}' + loop: '{{ rbenv_default_gems }}' become_user: "{{ username }}" become: yes tags: @@ -68,7 +68,7 @@ version: '{{ item.version }}' accept_hostkey: yes force: yes - with_items: + loop: - "{{ rbenv_plugins }}" become_user: "{{ username }}" become: yes diff --git a/redis/tasks/default-munin.yml b/redis/tasks/default-munin.yml index b7edce3a..c94f171a 100644 --- a/redis/tasks/default-munin.yml +++ b/redis/tasks/default-munin.yml @@ -41,7 +41,7 @@ src: /usr/local/share/munin/plugins/redis_ dest: "/etc/munin/plugins/redis_{{item}}" state: link - with_items: + loop: - connected_clients - key_ratio - keys_per_sec diff --git a/redis/tasks/instance-munin.yml b/redis/tasks/instance-munin.yml index 8d0e207c..80c67c6f 100644 --- a/redis/tasks/instance-munin.yml +++ b/redis/tasks/instance-munin.yml @@ -41,7 +41,7 @@ src: /usr/local/share/munin/plugins/redis_ dest: "/etc/munin/plugins/{{ redis_instance_name }}_redis_{{item}}" state: link - with_items: + loop: - connected_clients - key_ratio - keys_per_sec diff --git a/redis/tasks/instance-server.yml b/redis/tasks/instance-server.yml index 1b491d9a..d5f7e8e8 100644 --- a/redis/tasks/instance-server.yml +++ b/redis/tasks/instance-server.yml @@ -44,7 +44,7 @@ group: "root" follow: yes state: directory - with_items: + loop: - "{{ redis_conf_dir }}/redis-server.pre-up.d" - "{{ redis_conf_dir }}/redis-server.post-up.d" - "{{ redis_conf_dir }}/redis-server.pre-down.d" @@ -59,7 +59,7 @@ command: "cp -a /etc/redis/{{ item }}/00_example {{ redis_conf_dir }}/{{ item }}" args: creates: "{{ redis_conf_dir }}/{{ item }}/00_example" - with_items: + loop: - "redis-server.pre-up.d" - "redis-server.post-up.d" - "redis-server.pre-down.d" @@ -78,7 +78,7 @@ group: "redis-{{ redis_instance_name }}" follow: yes state: directory - with_items: + loop: - "{{ redis_pid_dir }}" - "{{ redis_socket_dir }}" tags: @@ -92,7 +92,7 @@ group: "redis-{{ redis_instance_name }}" follow: yes state: directory - with_items: + loop: - "{{ redis_data_dir }}" - "{{ redis_log_dir }}" tags: diff --git a/redmine/tasks/config.yml b/redmine/tasks/config.yml index a08ba1c6..d65f8172 100644 --- a/redmine/tasks/config.yml +++ b/redmine/tasks/config.yml @@ -6,7 +6,7 @@ mode: "0750" owner: "{{ redmine_user }}" group: "{{ redmine_user }}" - with_items: + loop: - ".config" - ".config/systemd" - ".config/systemd/user" @@ -50,7 +50,7 @@ owner: "{{ redmine_user }}" group: "{{ redmine_user }}" mode: "0640" - with_items: + loop: - 'configuration.yml' - 'database.yml' - 'additional_environment.rb' diff --git a/redmine/tasks/mysql.yml b/redmine/tasks/mysql.yml index 414da319..64e42683 100644 --- a/redmine/tasks/mysql.yml +++ b/redmine/tasks/mysql.yml @@ -42,7 +42,7 @@ section: client option: '{{ item.option }}' value: '{{ item.value }}' - with_items: + loop: - { option: 'host', value: "{{ redmine_db_host }}" } - { option: 'user', value: "{{ redmine_db_username }}" } - { option: 'database', value: "{{ redmine_db_name }}" } diff --git a/redmine/tasks/source.yml b/redmine/tasks/source.yml index 51427acf..7893a5ad 100644 --- a/redmine/tasks/source.yml +++ b/redmine/tasks/source.yml @@ -6,7 +6,7 @@ owner: "{{ redmine_user }}" group: "{{ redmine_user }}" mode: "0750" - with_items: + loop: - "releases" - "releases/{{ redmine_version }}" tags: @@ -30,7 +30,7 @@ dest: "/home/{{ redmine_user }}/releases/{{ redmine_version }}/config/{{ item }}" owner: "{{ redmine_user }}" group: "{{ redmine_user }}" - with_items: + loop: - 'configuration.yml' - 'database.yml' - 'additional_environment.rb' @@ -46,7 +46,7 @@ group: "{{ redmine_user }}" mode: "0750" when: item.zip is defined - with_items: "{{ redmine_plugins }}" + loop: "{{ redmine_plugins }}" tags: - redmine @@ -58,7 +58,7 @@ umask: "027" become_user: "{{ redmine_user }}" when: item.git is defined - with_items: "{{ redmine_plugins }}" + loop: "{{ redmine_plugins }}" tags: - redmine @@ -71,7 +71,7 @@ group: "{{ redmine_user }}" mode: "0750" when: item.zip is defined - with_items: "{{ redmine_themes }}" + loop: "{{ redmine_themes }}" tags: - redmine @@ -83,7 +83,7 @@ umask: "027" become_user: "{{ redmine_user }}" when: item.git is defined - with_items: "{{ redmine_themes }}" + loop: "{{ redmine_themes }}" tags: - redmine diff --git a/redmine/tasks/user.yml b/redmine/tasks/user.yml index ecc5b6d5..932e049c 100644 --- a/redmine/tasks/user.yml +++ b/redmine/tasks/user.yml @@ -33,7 +33,7 @@ owner: "{{ redmine_user }}" group: "{{ redmine_user }}" mode: "0750" - with_items: + loop: - "/home/{{ redmine_user }}" - "/home/{{ redmine_user }}/files" tags: diff --git a/squid/tasks/main.yml b/squid/tasks/main.yml index 68f721f8..bca2db5a 100644 --- a/squid/tasks/main.yml +++ b/squid/tasks/main.yml @@ -119,7 +119,7 @@ dest: /etc/squid3/whitelist.conf line: "{{ item }}" state: present - with_items: '{{ squid_whitelist_items }}' + loop: '{{ squid_whitelist_items }}' notify: "reload squid3" when: ansible_distribution_major_version == '8' @@ -129,7 +129,7 @@ dest: /etc/squid/evolinux-whitelist-custom.conf line: "{{ item }}" state: present - with_items: '{{ squid_whitelist_items }}' + loop: '{{ squid_whitelist_items }}' notify: "reload squid" when: ansible_distribution_major_version is version('9', '>=') diff --git a/squid/tasks/minifirewall.yml b/squid/tasks/minifirewall.yml index 44c7ada6..e878b0a8 100644 --- a/squid/tasks/minifirewall.yml +++ b/squid/tasks/minifirewall.yml @@ -27,7 +27,7 @@ regexp: "^#? *{{ item }}" line: "{{ item }}" insertafter: "^# Proxy" - with_items: + loop: - "/sbin/iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --uid-owner proxy -j ACCEPT" - "/sbin/iptables -t nat -A OUTPUT -p tcp --dport 80 -d {{ squid_address }} -j ACCEPT" - "/sbin/iptables -t nat -A OUTPUT -p tcp --dport 80 -d 127.0.0.0/8 -j ACCEPT" diff --git a/tomcat-instance/tasks/bootstrap.yml b/tomcat-instance/tasks/bootstrap.yml index c177aea9..001088b1 100644 --- a/tomcat-instance/tasks/bootstrap.yml +++ b/tomcat-instance/tasks/bootstrap.yml @@ -6,7 +6,7 @@ mode: "u=rwx,g=rwxs,o=" owner: "{{ tomcat_instance_name }}" group: "{{ tomcat_instance_name }}" - with_items: + loop: - 'conf' - 'logs' - 'webapps' diff --git a/varnish/tasks/main.yml b/varnish/tasks/main.yml index a8f9fa80..14515698 100644 --- a/varnish/tasks/main.yml +++ b/varnish/tasks/main.yml @@ -10,7 +10,7 @@ file: path: "{{ item }}" state: absent - with_items: + loop: - /etc/default/varnish - /etc/default/varnishncsa - /etc/default/varnishlog diff --git a/varnish/tasks/munin.yml b/varnish/tasks/munin.yml index 6e307c49..1d58aee6 100644 --- a/varnish/tasks/munin.yml +++ b/varnish/tasks/munin.yml @@ -35,7 +35,7 @@ src: /usr/local/share/munin/plugins/varnish4_ dest: "/etc/munin/plugins/varnish4_{{item}}" state: link - with_items: + loop: - backend_traffic - bad - expunge diff --git a/vrrpd/tasks/main.yml b/vrrpd/tasks/main.yml index b6f4e7f5..84d4f4ee 100644 --- a/vrrpd/tasks/main.yml +++ b/vrrpd/tasks/main.yml @@ -18,7 +18,7 @@ value: "{{ item.value }}" sysctl_set: yes state: present - with_items: + loop: - { name: 'net.ipv4.conf.default.rp_filter', value: 0 } - { name: 'net.ipv4.conf.eth0.rp_filter', value: 0 } - { name: 'net.ipv4.conf.all.rp_filter', value: 0 } diff --git a/webapps/evoadmin-web/tasks/packages.yml b/webapps/evoadmin-web/tasks/packages.yml index 7d3f6051..7044bd43 100644 --- a/webapps/evoadmin-web/tasks/packages.yml +++ b/webapps/evoadmin-web/tasks/packages.yml @@ -19,7 +19,7 @@ apt: deb: '{{ item }}' state: present - with_items: + loop: - 'http://mirror.evolix.org/debian/pool/main/p/php-log/php-log_1.12.9-2_all.deb' when: ansible_distribution_major_version is version('10', '>=') diff --git a/webapps/evoadmin-web/tasks/user.yml b/webapps/evoadmin-web/tasks/user.yml index 9c774f0d..4593dcf3 100644 --- a/webapps/evoadmin-web/tasks/user.yml +++ b/webapps/evoadmin-web/tasks/user.yml @@ -37,7 +37,7 @@ line: "{{ item.line }}" regexp: "{{ item.regexp }}" state: present - with_items: + loop: - line: 'evoadmin: root' regexp: '^evoadmin:' - line: 'www-evoadmin: root' diff --git a/webapps/nextcloud/tasks/mysql.yml b/webapps/nextcloud/tasks/mysql.yml index f2fcee32..a12a80f4 100644 --- a/webapps/nextcloud/tasks/mysql.yml +++ b/webapps/nextcloud/tasks/mysql.yml @@ -54,7 +54,7 @@ section: client option: "{{ item.option }}" value: "{{ item.value }}" - with_items: + loop: - { option: "user", value: "{{ nextcloud_db_user }}" } - { option: "database", value: "{{ nextcloud_db_name }}" } - { option: "password", value: "{{ nextcloud_db_pass }}" } diff --git a/webapps/nextcloud/tasks/user.yml b/webapps/nextcloud/tasks/user.yml index 07d5a31a..dd1d7cc5 100644 --- a/webapps/nextcloud/tasks/user.yml +++ b/webapps/nextcloud/tasks/user.yml @@ -30,7 +30,7 @@ mode: "0770" owner: "{{ nextcloud_user }}" group: "{{ nextcloud_user }}" - with_items: + loop: - "{{ nextcloud_home }}/log" - "{{ nextcloud_home }}/tmp" - "{{ nextcloud_home }}/data" diff --git a/webapps/roundcube/tasks/main.yml b/webapps/roundcube/tasks/main.yml index 2efd1823..46eaa022 100644 --- a/webapps/roundcube/tasks/main.yml +++ b/webapps/roundcube/tasks/main.yml @@ -5,7 +5,7 @@ question: "{{ item.key }}" value: "{{ item.value }}" vtype: "{{ item.type }}" - with_items: + loop: - { key: 'roundcube/database-type', type: 'select', value: 'sqlite3' } - { key: 'roundcube/db/basepath', type: 'string', value: '/var/lib/roundcube/' } tags: diff --git a/webapps/wordpress/tasks/main.yml b/webapps/wordpress/tasks/main.yml index 6b6a67e2..db94b9f4 100644 --- a/webapps/wordpress/tasks/main.yml +++ b/webapps/wordpress/tasks/main.yml @@ -66,17 +66,17 @@ - name: Install default plugin shell: '{{ wordpress_wpcli }} plugin is-installed {{ item }} || {{ wordpress_wpcli }} plugin install {{ item }}' changed_when: false - with_items: "{{ wordpress_plugins }}" + loop: "{{ wordpress_plugins }}" - name: Update default plugins shell: '{{ wordpress_wpcli }} plugin is-installed {{ item }} && {{ wordpress_wpcli }} plugin update {{ item }}' changed_when: false - with_items: "{{ wordpress_plugins }}" + loop: "{{ wordpress_plugins }}" - name: Activate default plugins shell: '{{ wordpress_wpcli }} plugin is-installed {{ item }} && {{ wordpress_wpcli }} plugin activate {{ item }}' changed_when: false - with_items: "{{ wordpress_plugins }}" + loop: "{{ wordpress_plugins }}" - name: Send a summary mail mail: