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

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

View File

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

View File

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