forked from evolix/ansible-roles
Use 'loop' syntax instead of 'with_nested'
This commit is contained in:
parent
07fd6451e1
commit
485ec39674
|
@ -19,7 +19,7 @@ The **patch** part changes incrementally at each release.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
* Use 'loop' syntax instead of 'with_first_found/with_items/with_dict'
|
* Use 'loop' syntax instead of 'with_first_found/with_items/with_dict/with_nested'
|
||||||
* apt: store keys in /etc/apt/trusted.gpg.d in ascii format
|
* apt: store keys in /etc/apt/trusted.gpg.d in ascii format
|
||||||
* evolinux-base: copy GPG key instead of using apt-key
|
* evolinux-base: copy GPG key instead of using apt-key
|
||||||
* ntpd: Add leapfile configuration setting to ntpd on debian 10+
|
* ntpd: Add leapfile configuration setting to ntpd on debian 10+
|
||||||
|
|
|
@ -21,9 +21,10 @@
|
||||||
state: present
|
state: present
|
||||||
key: "{{ item[0] }}"
|
key: "{{ item[0] }}"
|
||||||
delegate_to: "{{ item[1] }}"
|
delegate_to: "{{ item[1] }}"
|
||||||
with_nested:
|
loop: "{{ _keys | product(_servers) | list }}"
|
||||||
- "{{ ssh_keys.stdout }}"
|
vars:
|
||||||
- "{{ groups['hypervisors'] }}"
|
_keys: ssh_keys.stdout
|
||||||
|
_servers: groups['hypervisors']
|
||||||
when: item[1] != inventory_hostname
|
when: item[1] != inventory_hostname
|
||||||
|
|
||||||
- name: Crontab for sync libvirt xml file
|
- name: Crontab for sync libvirt xml file
|
||||||
|
|
|
@ -71,11 +71,12 @@
|
||||||
option: '{{ item[1].option }}'
|
option: '{{ item[1].option }}'
|
||||||
value: '{{ item[1].value }}'
|
value: '{{ item[1].value }}'
|
||||||
create: yes
|
create: yes
|
||||||
with_nested:
|
loop: "{{ _sections | product(_credentials) | list }}"
|
||||||
- [ "client", "mysql_upgrade" ]
|
vars:
|
||||||
- [ { option: 'user', value: 'debian-sys-maint' },
|
_sections: [ 'client', 'mysql_upgrade' ]
|
||||||
{ option: 'password', value: '{{ mysql_debian_password.stdout }}' }
|
_credentials:
|
||||||
]
|
- { option: 'user', value: 'debian-sys-maint' }
|
||||||
|
- { option: 'password', value: '{{ mysql_debian_password.stdout }}' }
|
||||||
when: create_debian_user is changed
|
when: create_debian_user is changed
|
||||||
tags:
|
tags:
|
||||||
- mysql
|
- mysql
|
||||||
|
|
|
@ -73,11 +73,12 @@
|
||||||
option: '{{ item[1].option }}'
|
option: '{{ item[1].option }}'
|
||||||
value: '{{ item[1].value }}'
|
value: '{{ item[1].value }}'
|
||||||
create: yes
|
create: yes
|
||||||
with_nested:
|
loop: "{{ _sections | product(_credentials) | list }}"
|
||||||
- [ "client", "mysql_upgrade" ]
|
vars:
|
||||||
- [ { option: 'user', value: 'debian-sys-maint' },
|
_sections: [ 'client', 'mysql_upgrade' ]
|
||||||
{ option: 'password', value: '{{ mysql_debian_password.stdout }}' }
|
_credentials:
|
||||||
]
|
- { option: 'user', value: 'debian-sys-maint' }
|
||||||
|
- { option: 'password', value: '{{ mysql_debian_password.stdout }}' }
|
||||||
when: create_debian_user.changed
|
when: create_debian_user.changed
|
||||||
tags:
|
tags:
|
||||||
- mysql
|
- mysql
|
||||||
|
|
|
@ -28,8 +28,9 @@
|
||||||
state: link
|
state: link
|
||||||
src: '/usr/share/munin/plugins/{{item[0]}}'
|
src: '/usr/share/munin/plugins/{{item[0]}}'
|
||||||
dest: '/etc/munin/plugins/{{item[0]}}{{item[1]}}'
|
dest: '/etc/munin/plugins/{{item[0]}}{{item[1]}}'
|
||||||
with_nested:
|
loop: "{{ _plugins | product(_databases) | list }}"
|
||||||
- ['postgres_cache_', 'postgres_connections_', 'postgres_locks_', 'postgres_querylength_', 'postgres_scans_', 'postgres_size_', 'postgres_transactions_', 'postgres_tuples_']
|
vars:
|
||||||
- '{{postgresql_databases}}'
|
_plugins: ['postgres_cache_', 'postgres_connections_', 'postgres_locks_', 'postgres_querylength_', 'postgres_scans_', 'postgres_size_', 'postgres_transactions_', 'postgres_tuples_']
|
||||||
|
_databases: postgresql_databases
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue