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" 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

@ -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