forked from evolix/ansible-roles
Use 'loop' syntax instead of 'with_first_found'
This commit is contained in:
parent
b3a62aa9d8
commit
debc4a82ca
|
@ -19,6 +19,7 @@ The **patch** part changes incrementally at each release.
|
|||
|
||||
### Changed
|
||||
|
||||
* Use 'loop' syntax instead of 'with_first_found'
|
||||
* 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+
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
dest: "{{ evobackup_client__cron_path }}"
|
||||
force: true
|
||||
mode: 0755
|
||||
with_first_found:
|
||||
- "templates/evobackup-client/{{ evobackup_client__cron_template_name }}.{{ inventory_hostname }}.sh.j2"
|
||||
- "templates/evobackup-client/{{ evobackup_client__cron_template_name }}.{{ host_group }}.sh.j2"
|
||||
- "templates/evobackup-client/{{ evobackup_client__cron_template_name }}.sh.j2"
|
||||
- "zzz_evobackup.default.sh.j2"
|
||||
loop: "{{ query('first_found', templates) }}"
|
||||
vars:
|
||||
templates:
|
||||
- "templates/evobackup-client/{{ evobackup_client__cron_template_name }}.{{ inventory_hostname }}.sh.j2"
|
||||
- "templates/evobackup-client/{{ evobackup_client__cron_template_name }}.{{ host_group }}.sh.j2"
|
||||
- "templates/evobackup-client/{{ evobackup_client__cron_template_name }}.sh.j2"
|
||||
- "templates/zzz_evobackup.default.sh.j2"
|
||||
tags:
|
||||
- evobackup_client
|
||||
- evobackup_client_backup_scripts
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
with_first_found:
|
||||
- files:
|
||||
loop: "{{ query('first_found', templates, errors='ignore') }}"
|
||||
vars:
|
||||
templates:
|
||||
- "motd/motd.{{ inventory_hostname }}.j2"
|
||||
- "motd/motd.{{ host_group }}.j2"
|
||||
- "motd/motd.default.j2"
|
||||
skip: True
|
||||
tags:
|
||||
- motd
|
||||
|
|
|
@ -145,11 +145,13 @@
|
|||
src: "{{ item }}"
|
||||
dest: /etc/filebeat/filebeat.yml
|
||||
force: "{{ filebeat_force_config }}"
|
||||
with_first_found:
|
||||
loop: "{{ query('first_found', templates) }}"
|
||||
vars:
|
||||
templates:
|
||||
- "templates/filebeat/filebeat.{{ inventory_hostname }}.yml.j2"
|
||||
- "templates/filebeat/filebeat.{{ host_group }}.yml.j2"
|
||||
- "templates/filebeat/filebeat.default.yml.j2"
|
||||
- "filebeat.default.yml.j2"
|
||||
- "templates/filebeat.default.yml.j2"
|
||||
notify: restart filebeat
|
||||
when: filebeat_update_config
|
||||
when: filebeat_use_config_template
|
||||
|
|
|
@ -103,10 +103,10 @@
|
|||
loop: "{{ query('first_found', templates) }}"
|
||||
vars:
|
||||
templates:
|
||||
- "templates/haproxy/haproxy.{{ inventory_hostname }}.cfg.j2"
|
||||
- "templates/haproxy/haproxy.{{ host_group | default('all') }}.cfg.j2"
|
||||
- "templates/haproxy/haproxy.default.cfg.j2"
|
||||
- "haproxy.default.cfg.j2"
|
||||
- "templates/haproxy/haproxy.{{ inventory_hostname }}.cfg.j2"
|
||||
- "templates/haproxy/haproxy.{{ host_group | default('all') }}.cfg.j2"
|
||||
- "templates/haproxy/haproxy.default.cfg.j2"
|
||||
- "templates/haproxy.default.cfg.j2"
|
||||
notify: reload haproxy
|
||||
when: haproxy_update_config
|
||||
tags:
|
||||
|
|
|
@ -72,11 +72,13 @@
|
|||
group: logstash
|
||||
mode: "0640"
|
||||
force: yes
|
||||
with_first_found:
|
||||
- "templates/logstash/logstash.{{ inventory_hostname }}.conf.j2"
|
||||
- "templates/logstash/logstash.{{ host_group }}.conf.j2"
|
||||
- "templates/logstash/logstash.default.conf.j2"
|
||||
- "logstash.default.conf.j2"
|
||||
loop: "{{ query('first_found', templates) }}"
|
||||
vars:
|
||||
templates:
|
||||
- "templates/logstash/logstash.{{ inventory_hostname }}.conf.j2"
|
||||
- "templates/logstash/logstash.{{ host_group }}.conf.j2"
|
||||
- "templates/logstash/logstash.default.conf.j2"
|
||||
- "templates/logstash.default.conf.j2"
|
||||
register: logstash_template
|
||||
|
||||
- debug:
|
||||
|
|
|
@ -119,11 +119,13 @@
|
|||
src: "{{ item }}"
|
||||
dest: /etc/metricbeat/metricbeat.yml
|
||||
force: "{{ metricbeat_force_config }}"
|
||||
with_first_found:
|
||||
loop: "{{ query('first_found', templates) }}"
|
||||
vars:
|
||||
templates:
|
||||
- "templates/metricbeat/metricbeat.{{ inventory_hostname }}.yml.j2"
|
||||
- "templates/metricbeat/metricbeat.{{ host_group }}.yml.j2"
|
||||
- "templates/metricbeat/metricbeat.default.yml.j2"
|
||||
- "metricbeat.default.yml.j2"
|
||||
- "templates/metricbeat.default.yml.j2"
|
||||
notify: restart metricbeat
|
||||
when: metricbeat_update_config
|
||||
when: metricbeat_use_config_template
|
||||
|
|
|
@ -4,11 +4,13 @@
|
|||
src: "{{ item }}"
|
||||
dest: "{{ minifirewall_tail_file }}"
|
||||
force: "{{ minifirewall_tail_force | bool }}"
|
||||
with_first_found:
|
||||
- "templates/minifirewall-tail/minifirewall.{{ inventory_hostname }}.tail.j2"
|
||||
- "templates/minifirewall-tail/minifirewall.{{ host_group }}.tail.j2"
|
||||
- "templates/minifirewall-tail/minifirewall.default.tail.j2"
|
||||
- "minifirewall.default.tail.j2"
|
||||
loop: "{{ query('first_found', templates) }}"
|
||||
vars:
|
||||
templates:
|
||||
- "templates/minifirewall-tail/minifirewall.{{ inventory_hostname }}.tail.j2"
|
||||
- "templates/minifirewall-tail/minifirewall.{{ host_group }}.tail.j2"
|
||||
- "templates/minifirewall-tail/minifirewall.default.tail.j2"
|
||||
- "templates/minifirewall.default.tail.j2"
|
||||
register: minifirewall_tail_template
|
||||
|
||||
- debug:
|
||||
|
|
|
@ -84,15 +84,17 @@
|
|||
dest: "{{ varnish_config_file }}"
|
||||
mode: "0644"
|
||||
force: yes
|
||||
with_first_found:
|
||||
- "templates/varnish/varnish.{{ inventory_hostname }}.vcl.j2"
|
||||
- "templates/varnish/default.{{ inventory_hostname }}.vcl.j2"
|
||||
- "templates/varnish/varnish.{{ host_group }}.vcl.j2"
|
||||
- "templates/varnish/default.{{ host_group }}.vcl.j2"
|
||||
- "templates/varnish/varnish.default.vcl.j2"
|
||||
- "templates/varnish/default.default.vcl.j2"
|
||||
- "varnish.vcl.j2"
|
||||
- "default.vcl.j2"
|
||||
loop: "{{ query('first_found', templates) }}"
|
||||
vars:
|
||||
templates:
|
||||
- "templates/varnish/varnish.{{ inventory_hostname }}.vcl.j2"
|
||||
- "templates/varnish/default.{{ inventory_hostname }}.vcl.j2"
|
||||
- "templates/varnish/varnish.{{ host_group }}.vcl.j2"
|
||||
- "templates/varnish/default.{{ host_group }}.vcl.j2"
|
||||
- "templates/varnish/varnish.default.vcl.j2"
|
||||
- "templates/varnish/default.default.vcl.j2"
|
||||
- "templates/varnish.vcl.j2"
|
||||
- "templates/default.vcl.j2"
|
||||
notify: reload varnish
|
||||
tags:
|
||||
- varnish
|
||||
|
|
|
@ -11,11 +11,13 @@
|
|||
src: "{{ item }}"
|
||||
dest: /etc/evolinux/web-add.conf
|
||||
force: "{{ evoadmin_add_conf_force }}"
|
||||
with_first_found:
|
||||
loop: "{{ query('first_found', templates) }}"
|
||||
vars:
|
||||
templates:
|
||||
- "templates/evoadmin-web/web-add.{{ inventory_hostname }}.conf.j2"
|
||||
- "templates/evoadmin-web/web-add.{{ host_group }}.conf.j2"
|
||||
- "templates/evoadmin-web/web-add.conf.j2"
|
||||
- "web-add.conf.j2"
|
||||
- "templates/web-add.conf.j2"
|
||||
register: evoadmin_add_conf_template
|
||||
|
||||
- name: Configure web-add template file for mail
|
||||
|
@ -23,9 +25,11 @@
|
|||
src: "{{ item }}"
|
||||
dest: "{{ evoadmin_scripts_dir }}/web-mail.tpl"
|
||||
force: "{{ evoadmin_mail_tpl_force }}"
|
||||
with_first_found:
|
||||
- "templates/evoadmin-web/web-mail.{{ inventory_hostname }}.tpl.j2"
|
||||
- "templates/evoadmin-web/web-mail.{{ host_group }}.tpl.j2"
|
||||
- "templates/evoadmin-web/web-mail.tpl.j2"
|
||||
- "web-mail.tpl.j2"
|
||||
loop: "{{ query('first_found', templates) }}"
|
||||
vars:
|
||||
templates:
|
||||
- "templates/evoadmin-web/web-mail.{{ inventory_hostname }}.tpl.j2"
|
||||
- "templates/evoadmin-web/web-mail.{{ host_group }}.tpl.j2"
|
||||
- "templates/evoadmin-web/web-mail.tpl.j2"
|
||||
- "templates/web-mail.tpl.j2"
|
||||
register: evoadmin_mail_tpl_template
|
||||
|
|
|
@ -112,9 +112,11 @@
|
|||
mode: "0600"
|
||||
force: "{{ evoadmin_sudoers_conf_force }}"
|
||||
validate: "visudo -cf %s"
|
||||
with_first_found:
|
||||
- "templates/evoadmin-web/sudoers.{{ inventory_hostname }}.j2"
|
||||
- "templates/evoadmin-web/sudoers.{{ host_group }}.j2"
|
||||
- "templates/evoadmin-web/sudoers.j2"
|
||||
- "sudoers.j2"
|
||||
loop: "{{ query('first_found', templates) }}"
|
||||
vars:
|
||||
templates:
|
||||
- "templates/evoadmin-web/sudoers.{{ inventory_hostname }}.j2"
|
||||
- "templates/evoadmin-web/sudoers.{{ host_group }}.j2"
|
||||
- "templates/evoadmin-web/sudoers.j2"
|
||||
- "templates/sudoers.j2"
|
||||
register: evoadmin_sudoers_conf
|
||||
|
|
|
@ -32,11 +32,13 @@
|
|||
src: "{{ item }}"
|
||||
dest: /etc/apache2/sites-available/evoadmin.conf
|
||||
force: "{{ evoadmin_force_vhost }}"
|
||||
with_first_found:
|
||||
- "templates/evoadmin-web/evoadmin.{{ inventory_hostname }}.conf.j2"
|
||||
- "templates/evoadmin-web/evoadmin.{{ host_group }}.conf.j2"
|
||||
- "templates/evoadmin-web/evoadmin.conf.j2"
|
||||
- "evoadmin.conf.j2"
|
||||
loop: "{{ query('first_found', templates) }}"
|
||||
vars:
|
||||
templates:
|
||||
- "templates/evoadmin-web/evoadmin.{{ inventory_hostname }}.conf.j2"
|
||||
- "templates/evoadmin-web/evoadmin.{{ host_group }}.conf.j2"
|
||||
- "templates/evoadmin-web/evoadmin.conf.j2"
|
||||
- "templates/evoadmin.conf.j2"
|
||||
register: evoadmin_vhost_template
|
||||
notify: reload apache2
|
||||
|
||||
|
@ -62,11 +64,13 @@
|
|||
owner: root
|
||||
group: www-data
|
||||
force: "{{ evoadmin_htpasswd_force }}"
|
||||
with_first_found:
|
||||
- "templates/evoadmin-web/htpasswd.{{ inventory_hostname }}.j2"
|
||||
- "templates/evoadmin-web/htpasswd.{{ host_group }}.j2"
|
||||
- "templates/evoadmin-web/htpasswd.j2"
|
||||
- "htpasswd.j2"
|
||||
loop: "{{ query('first_found', templates) }}"
|
||||
vars:
|
||||
templates:
|
||||
- "templates/evoadmin-web/htpasswd.{{ inventory_hostname }}.j2"
|
||||
- "templates/evoadmin-web/htpasswd.{{ host_group }}.j2"
|
||||
- "templates/evoadmin-web/htpasswd.j2"
|
||||
- "templates/htpasswd.j2"
|
||||
register: evoadmin_htpasswd_template
|
||||
when: evoadmin_htpasswd
|
||||
|
||||
|
@ -78,9 +82,11 @@
|
|||
owner: evoadmin
|
||||
group: evoadmin
|
||||
force: "{{ evoadmin_config_local_php_force }}"
|
||||
with_first_found:
|
||||
- "templates/evoadmin-web/config.local.{{ inventory_hostname }}.php.j2"
|
||||
- "templates/evoadmin-web/config.local.{{ host_group }}.php.j2"
|
||||
- "templates/evoadmin-web/config.local.php.j2"
|
||||
- "config.local.php.j2"
|
||||
loop: "{{ query('first_found', templates) }}"
|
||||
vars:
|
||||
templates:
|
||||
- "templates/evoadmin-web/config.local.{{ inventory_hostname }}.php.j2"
|
||||
- "templates/evoadmin-web/config.local.{{ host_group }}.php.j2"
|
||||
- "templates/evoadmin-web/config.local.php.j2"
|
||||
- "templates/config.local.php.j2"
|
||||
register: evoadmin_config_local_php_template
|
||||
|
|
Loading…
Reference in a new issue