loop syntax and whitespaces

This commit is contained in:
Jérémy Lecour 2021-08-27 11:01:26 +02:00 committed by Jérémy Lecour
parent d2ef3fe27f
commit 74ab96d67f
13 changed files with 111 additions and 117 deletions

View File

@ -6,48 +6,48 @@
value: "{{ item.value }}" value: "{{ item.value }}"
vtype: "{{ item.type }}" vtype: "{{ item.type }}"
loop: loop:
- { key: 'clamav-daemon/debconf', type: 'boolean', value: 'true' } - { key: 'clamav-daemon/debconf', type: 'boolean', value: 'true' }
- { key: 'clamav-daemon/MaxHTMLNormalize', type: 'string', value: '10M' } - { key: 'clamav-daemon/MaxHTMLNormalize', type: 'string', value: '10M' }
- { key: 'clamav-daemon/StatsPEDisabled', type: 'boolean', value: 'true' } - { key: 'clamav-daemon/StatsPEDisabled', type: 'boolean', value: 'true' }
- { key: 'clamav-daemon/FollowDirectorySymlinks', type: 'boolean', value: 'false' } - { key: 'clamav-daemon/FollowDirectorySymlinks', type: 'boolean', value: 'false' }
- { key: 'clamav-daemon/StreamMaxLength', type: 'string', value: '25' } - { key: 'clamav-daemon/StreamMaxLength', type: 'string', value: '25' }
- { key: 'clamav-daemon/ReadTimeout', type: 'string', value: '180' } - { key: 'clamav-daemon/ReadTimeout', type: 'string', value: '180' }
- { key: 'clamav-daemon/StatsEnabled', type: 'boolean', value: 'false' } - { key: 'clamav-daemon/StatsEnabled', type: 'boolean', value: 'false' }
- { key: 'clamav-daemon/MaxConnectionQueueLength', type: 'string', value: '15' } - { key: 'clamav-daemon/MaxConnectionQueueLength', type: 'string', value: '15' }
- { key: 'clamav-daemon/LogRotate', type: 'boolean', value: 'true' } - { key: 'clamav-daemon/LogRotate', type: 'boolean', value: 'true' }
- { key: 'clamav-daemon/AllowAllMatchScan', type: 'boolean', value: 'true' } - { key: 'clamav-daemon/AllowAllMatchScan', type: 'boolean', value: 'true' }
- { key: 'clamav-daemon/ScanOnAccess', type: 'boolean', value: 'false' } - { key: 'clamav-daemon/ScanOnAccess', type: 'boolean', value: 'false' }
- { key: 'clamav-daemon/LogFile', type: 'string', value: '/var/log/clamav/clamav.log' } - { key: 'clamav-daemon/LogFile', type: 'string', value: '/var/log/clamav/clamav.log' }
- { key: 'clamav-daemon/ScanMail', type: 'boolean', value: 'true' } - { key: 'clamav-daemon/ScanMail', type: 'boolean', value: 'true' }
- { key: 'clamav-daemon/BytecodeTimeout', type: 'string', value: '60000' } - { key: 'clamav-daemon/BytecodeTimeout', type: 'string', value: '60000' }
- { key: 'clamav-daemon/LogTime', type: 'boolean', value: 'true' } - { key: 'clamav-daemon/LogTime', type: 'boolean', value: 'true' }
- { key: 'clamav-daemon/OnAccessMaxFileSize', type: 'string', value: '5M' } - { key: 'clamav-daemon/OnAccessMaxFileSize', type: 'string', value: '5M' }
- { key: 'clamav-daemon/TcpOrLocal', type: 'select', value: 'UNIX' } - { key: 'clamav-daemon/TcpOrLocal', type: 'select', value: 'UNIX' }
- { key: 'clamav-daemon/MaxEmbeddedPE', type: 'string', value: '10M' } - { key: 'clamav-daemon/MaxEmbeddedPE', type: 'string', value: '10M' }
- { key: 'clamav-daemon/FixStaleSocket', type: 'boolean', value: 'true' } - { key: 'clamav-daemon/FixStaleSocket', type: 'boolean', value: 'true' }
- { key: 'clamav-daemon/User', type: 'string', value: 'clamav' } - { key: 'clamav-daemon/User', type: 'string', value: 'clamav' }
- { key: 'clamav-daemon/BytecodeSecurity', type: 'select', value: 'TrustSigned' } - { key: 'clamav-daemon/BytecodeSecurity', type: 'select', value: 'TrustSigned' }
- { key: 'clamav-daemon/ScanSWF', type: 'boolean', value: 'true' } - { key: 'clamav-daemon/ScanSWF', type: 'boolean', value: 'true' }
- { key: 'clamav-daemon/MaxDirectoryRecursion', type: 'string', value: '0' } - { key: 'clamav-daemon/MaxDirectoryRecursion', type: 'string', value: '0' }
- { key: 'clamav-daemon/MaxThreads', type: 'string', value: '12' } - { key: 'clamav-daemon/MaxThreads', type: 'string', value: '12' }
- { key: 'clamav-daemon/LocalSocketGroup', type: 'string', value: 'clamav' } - { key: 'clamav-daemon/LocalSocketGroup', type: 'string', value: 'clamav' }
- { key: 'clamav-daemon/MaxScriptNormalize', type: 'string', value: '5M' } - { key: 'clamav-daemon/MaxScriptNormalize', type: 'string', value: '5M' }
- { key: 'clamav-daemon/ForceToDisk', type: 'boolean', value: 'false' } - { key: 'clamav-daemon/ForceToDisk', type: 'boolean', value: 'false' }
- { key: 'clamav-daemon/StatsHostID', type: 'string', value: 'auto' } - { key: 'clamav-daemon/StatsHostID', type: 'string', value: 'auto' }
- { key: 'clamav-daemon/FollowFileSymlinks', type: 'boolean', value: 'false' } - { key: 'clamav-daemon/FollowFileSymlinks', type: 'boolean', value: 'false' }
- { key: 'clamav-daemon/TCPSocket', type: 'string', value: '3310' } - { key: 'clamav-daemon/TCPSocket', type: 'string', value: '3310' }
- { key: 'clamav-daemon/TCPAddr', type: 'string', value: 'any' } - { key: 'clamav-daemon/TCPAddr', type: 'string', value: 'any' }
- { key: 'clamav-daemon/DisableCertCheck', type: 'boolean', value: 'false' } - { key: 'clamav-daemon/DisableCertCheck', type: 'boolean', value: 'false' }
- { key: 'clamav-daemon/SelfCheck', type: 'string', value: '3600' } - { key: 'clamav-daemon/SelfCheck', type: 'string', value: '3600' }
- { key: 'clamav-daemon/LocalSocket', type: 'string', value: '/var/run/clamav/clamd.ctl' } - { key: 'clamav-daemon/LocalSocket', type: 'string', value: '/var/run/clamav/clamd.ctl' }
- { key: 'clamav-daemon/LocalSocketMode', type: 'string', value: '666' } - { key: 'clamav-daemon/LocalSocketMode', type: 'string', value: '666' }
- { key: 'clamav-daemon/StatsTimeout', type: 'string', value: '10' } - { key: 'clamav-daemon/StatsTimeout', type: 'string', value: '10' }
- { key: 'clamav-daemon/MaxZipTypeRcg', type: 'string', value: '1M' } - { key: 'clamav-daemon/MaxZipTypeRcg', type: 'string', value: '1M' }
- { key: 'clamav-daemon/MaxHTMLNoTags', type: 'string', value: '2M' } - { key: 'clamav-daemon/MaxHTMLNoTags', type: 'string', value: '2M' }
- { key: 'clamav-daemon/LogSyslog', type: 'boolean', value: 'false' } - { key: 'clamav-daemon/LogSyslog', type: 'boolean', value: 'false' }
- { key: 'clamav-daemon/AddGroups', type: 'string', value: '' } - { key: 'clamav-daemon/AddGroups', type: 'string', value: '' }
- { key: 'clamav-daemon/Bytecode', type: 'boolean', value: 'true' } - { key: 'clamav-daemon/Bytecode', type: 'boolean', value: 'true' }
- { key: 'clamav-daemon/ScanArchive', type: 'boolean', value: 'true' } - { key: 'clamav-daemon/ScanArchive', type: 'boolean', value: 'true' }
tags: tags:
- clamav - clamav
@ -58,17 +58,17 @@
value: "{{ item.value }}" value: "{{ item.value }}"
vtype: "{{ item.type }}" vtype: "{{ item.type }}"
loop: loop:
- { key: 'clamav-freshclam/autoupdate_freshclam', type: 'select', value: 'daemon' } - { key: 'clamav-freshclam/autoupdate_freshclam', type: 'select', value: 'daemon' }
- { key: 'clamav-freshclam/proxy_user', type: 'string', value: '' } - { key: 'clamav-freshclam/proxy_user', type: 'string', value: '' }
- { key: 'clamav-freshclam/NotifyClamd', type: 'boolean', value: 'true' } - { key: 'clamav-freshclam/NotifyClamd', type: 'boolean', value: 'true' }
- { key: 'clamav-freshclam/local_mirror', type: 'select', value: 'db.fr.clamav.net' } - { key: 'clamav-freshclam/local_mirror', type: 'select', value: 'db.fr.clamav.net' }
- { key: 'clamav-freshclam/http_proxy', type: 'string', value: '' } - { key: 'clamav-freshclam/http_proxy', type: 'string', value: '' }
- { key: 'clamav-freshclam/LogRotate', type: 'boolean', value: 'true' } - { key: 'clamav-freshclam/LogRotate', type: 'boolean', value: 'true' }
- { key: 'clamav-freshclam/Bytecode', type: 'boolean', value: 'true' } - { key: 'clamav-freshclam/Bytecode', type: 'boolean', value: 'true' }
- { key: 'clamav-freshclam/update_interval', type: 'string', value: '24' } - { key: 'clamav-freshclam/update_interval', type: 'string', value: '24' }
- { key: 'clamav-freshclam/SafeBrowsing', type: 'boolean', value: 'false' } - { key: 'clamav-freshclam/SafeBrowsing', type: 'boolean', value: 'false' }
- { key: 'clamav-freshclam/PrivateMirror', type: 'string', value: '' } - { key: 'clamav-freshclam/PrivateMirror', type: 'string', value: '' }
- { key: 'clamav-freshclam/internet_interface', type: 'string', value: '' } - { key: 'clamav-freshclam/internet_interface', type: 'string', value: '' }
tags: tags:
- clamav - clamav

View File

@ -8,8 +8,8 @@
state: present state: present
reload: yes reload: yes
loop: loop:
- { name: kernel.panic_on_oops, value: 1 } - { name: kernel.panic_on_oops, value: 1 }
- { name: kernel.panic, value: 60 } - { name: kernel.panic, value: 60 }
when: evolinux_kernel_reboot_after_panic | bool when: evolinux_kernel_reboot_after_panic | bool
- name: Don't reboot after panic - name: Don't reboot after panic
@ -19,8 +19,8 @@
state: absent state: absent
reload: yes reload: yes
loop: loop:
- kernel.panic_on_oops - kernel.panic_on_oops
- kernel.panic - kernel.panic
when: not evolinux_kernel_reboot_after_panic | bool when: not evolinux_kernel_reboot_after_panic | bool
- name: Disable net.ipv4.tcp_timestamps - name: Disable net.ipv4.tcp_timestamps

View File

@ -119,10 +119,10 @@
regexp: "{{ item.regexp }}" regexp: "{{ item.regexp }}"
replace: "{{ item.replace }}" replace: "{{ item.replace }}"
loop: loop:
- { regexp: '^17((\s*\*){4})', replace: '{{ 59|random(start=1) }}\1' } - { 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: '^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' } - { regexp: '^47\s*6((\s*\*){2}\s*7)', replace: '{{ 59|random(start=1) }} {{ [0,1,3,4,5,6,7]|random }}\1' }
- { regexp: '^52\s*6(\s*1(\s*\*){2})', replace: '{{ 59|random(start=1) }} {{ [0,1,3,4,5,6,7]|random }}\1' } - { regexp: '^52\s*6(\s*1(\s*\*){2})', replace: '{{ 59|random(start=1) }} {{ [0,1,3,4,5,6,7]|random }}\1' }
when: when:
- is_cron_installed.rc == 0 - is_cron_installed.rc == 0
- evolinux_system_cron_random | bool - evolinux_system_cron_random | bool

View File

@ -14,9 +14,9 @@
state: directory state: directory
mode: "0777" mode: "0777"
loop: loop:
- /srv/java-package - /srv/java-package
- /srv/java-package/src - /srv/java-package/src
- /srv/java-package/tmp - /srv/java-package/tmp
tags: tags:
- java - java

View File

@ -34,8 +34,7 @@
special_time: "hourly" special_time: "hourly"
user: root user: root
job: "rsync -a --delete /etc/libvirt/qemu/ {{ hostvars[item]['ansible_hostname'] }}:/root/libvirt-{{ inventory_hostname }}/" job: "rsync -a --delete /etc/libvirt/qemu/ {{ hostvars[item]['ansible_hostname'] }}:/root/libvirt-{{ inventory_hostname }}/"
loop: loop: "{{ groups['hypervisors'] }}"
- "{{ groups['hypervisors'] }}"
when: item != inventory_hostname when: item != inventory_hostname
- name: Crontab for sync list of running vm - name: Crontab for sync list of running vm
@ -45,6 +44,5 @@
special_time: "daily" special_time: "daily"
user: root user: root
job: "virsh list --all | ssh {{ hostvars[item]['ansible_hostname'] }} 'cat >/root/libvirt-{{ inventory_hostname }}/virsh-list.txt'" job: "virsh list --all | ssh {{ hostvars[item]['ansible_hostname'] }} 'cat >/root/libvirt-{{ inventory_hostname }}/virsh-list.txt'"
loop: loop: "{{ groups['hypervisors'] }}"
- "{{ groups['hypervisors'] }}"
when: item != inventory_hostname when: item != inventory_hostname

View File

@ -8,9 +8,7 @@
path: "/var/lib/lxc/{{ item.name }}/rootfs" path: "/var/lib/lxc/{{ item.name }}/rootfs"
state: directory state: directory
mode: '0755' mode: '0755'
loop: loop: "{{ lxc_containers }}"
- "{{ lxc_containers }}"
- include: "solr.yml name={{item.name}} solr_version={{item.solr_version}} solr_port={{item.solr_port}}" - include: "solr.yml name={{item.name}} solr_version={{item.solr_version}} solr_port={{item.solr_port}}"
loop: loop: "{{ lxc_containers }}"
- "{{ lxc_containers }}"

View File

@ -39,8 +39,8 @@
group: opendkim group: opendkim
mode: "0640" mode: "0640"
loop: loop:
- 'KeyTable' - 'KeyTable'
- 'SigningTable' - 'SigningTable'
changed_when: False changed_when: False
tags: tags:
- opendkim - opendkim

View File

@ -38,17 +38,17 @@
dest: "/etc/postfix/{{ item }}" dest: "/etc/postfix/{{ item }}"
force: no force: no
loop: loop:
- virtual - virtual
- client.access - client.access
- client.access_local - client.access_local
- header_kill - header_kill
- header_kill_local - header_kill_local
- recipient.access - recipient.access
- recipient.access_local - recipient.access_local
- sa-blacklist.access - sa-blacklist.access
- sender.access - sender.access
- sender.access_local - sender.access_local
- spamd.cidr - spamd.cidr
register: postfix_copy_filter register: postfix_copy_filter
tags: tags:
- postfix - postfix
@ -56,17 +56,17 @@
- name: postmap filter files - name: postmap filter files
command: "postmap /etc/postfix/{{ item }}" command: "postmap /etc/postfix/{{ item }}"
loop: loop:
- virtual - virtual
- client.access - client.access
- client.access_local - client.access_local
- header_kill - header_kill
- header_kill_local - header_kill_local
- recipient.access - recipient.access
- recipient.access_local - recipient.access_local
- sa-blacklist.access - sa-blacklist.access
- sender.access - sender.access
- sender.access_local - sender.access_local
- spamd.cidr - spamd.cidr
when: postfix_copy_filter is changed when: postfix_copy_filter is changed
tags: tags:
- postfix - postfix

View File

@ -15,11 +15,11 @@
src: '/usr/share/munin/plugins/{{item}}' src: '/usr/share/munin/plugins/{{item}}'
dest: '/etc/munin/plugins/{{item}}' dest: '/etc/munin/plugins/{{item}}'
loop: loop:
- postgres_bgwriter - postgres_bgwriter
- postgres_checkpoints - postgres_checkpoints
- postgres_connections_db - postgres_connections_db
- postgres_users - postgres_users
- postgres_xlog - postgres_xlog
notify: restart munin-node notify: restart munin-node
when: etc_munin_plugins.stat.exists and usr_share_munin_plugins.stat.exists when: etc_munin_plugins.stat.exists and usr_share_munin_plugins.stat.exists

View File

@ -12,6 +12,6 @@
apt: apt:
name: '{{item}}' name: '{{item}}'
loop: loop:
- "postgresql-{{postgresql_version}}" - "postgresql-{{postgresql_version}}"
- ptop - ptop
- libdbd-pg-perl - libdbd-pg-perl

View File

@ -7,9 +7,9 @@
owner: "{{ redmine_user }}" owner: "{{ redmine_user }}"
group: "{{ redmine_user }}" group: "{{ redmine_user }}"
loop: loop:
- ".config" - ".config"
- ".config/systemd" - ".config/systemd"
- ".config/systemd/user" - ".config/systemd/user"
tags: tags:
- redmine - redmine

View File

@ -19,11 +19,11 @@
sysctl_set: yes sysctl_set: yes
state: present state: present
loop: loop:
- { name: 'net.ipv4.conf.default.rp_filter', value: 0 } - { name: 'net.ipv4.conf.default.rp_filter', value: 0 }
- { name: 'net.ipv4.conf.eth0.rp_filter', value: 0 } - { name: 'net.ipv4.conf.eth0.rp_filter', value: 0 }
- { name: 'net.ipv4.conf.all.rp_filter', value: 0 } - { name: 'net.ipv4.conf.all.rp_filter', value: 0 }
- { name: 'net.ipv4.conf.all.arp_ignore', value: 1 } - { name: 'net.ipv4.conf.all.arp_ignore', value: 1 }
- { name: 'net.ipv4.conf.all.arp_announce', value: 2 } - { name: 'net.ipv4.conf.all.arp_announce', value: 2 }
- { name: 'net.ipv4.ip_nonlocal_bind', value: 1 } - { name: 'net.ipv4.ip_nonlocal_bind', value: 1 }
tags: tags:
- vrrpd - vrrpd

View File

@ -38,10 +38,8 @@
regexp: "{{ item.regexp }}" regexp: "{{ item.regexp }}"
state: present state: present
loop: loop:
- line: 'evoadmin: root' - { line: 'evoadmin: root', regexp: '^evoadmin:' }
regexp: '^evoadmin:' - { line: 'www-evoadmin: root', regexp: '^www-evoadmin:' }
- line: 'www-evoadmin: root'
regexp: '^www-evoadmin:'
notify: "newaliases" notify: "newaliases"
when: etc_aliases.stat.exists when: etc_aliases.stat.exists