diff --git a/roles/alertmanager/tasks/main.yaml b/roles/alertmanager/tasks/main.yaml index 89aed0c..3e5c60a 100644 --- a/roles/alertmanager/tasks/main.yaml +++ b/roles/alertmanager/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,8 +23,8 @@ paths: - tasks -- include: pre.yaml +- ansible.builtin.include_tasks: pre.yaml -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml -- include: configure.yaml +- ansible.builtin.include_tasks: configure.yaml diff --git a/roles/autossh/tasks/main.yaml b/roles/autossh/tasks/main.yaml index d681419..436e036 100644 --- a/roles/autossh/tasks/main.yaml +++ b/roles/autossh/tasks/main.yaml @@ -12,7 +12,7 @@ skeleton: /dev/null - name: "manage keys {{ item }}" - include: keys.yaml + ansible.builtin.include_tasks: keys.yaml loop: - id_dsa - id_ecdsa @@ -33,7 +33,7 @@ state: "{{ autossh_package_state }}" - name: manage keys "{{ item }}" - include: keys.yaml + ansible.builtin.include_tasks: keys.yaml loop: - id_dsa - id_ecdsa diff --git a/roles/blackbox_exporter/tasks/main.yaml b/roles/blackbox_exporter/tasks/main.yaml index 89aed0c..3e5c60a 100644 --- a/roles/blackbox_exporter/tasks/main.yaml +++ b/roles/blackbox_exporter/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,8 +23,8 @@ paths: - tasks -- include: pre.yaml +- ansible.builtin.include_tasks: pre.yaml -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml -- include: configure.yaml +- ansible.builtin.include_tasks: configure.yaml diff --git a/roles/certbot/tasks/main.yaml b/roles/certbot/tasks/main.yaml index 824d776..2a603f9 100644 --- a/roles/certbot/tasks/main.yaml +++ b/roles/certbot/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -37,7 +37,7 @@ mode: 0755 - name: request certificates - include_tasks: "issue.yaml" + ansible.builtin.include_tasks: "issue.yaml" loop: "{{ certbot_certificates }}" - name: configure systemd timer diff --git a/roles/certs/tasks/main.yaml b/roles/certs/tasks/main.yaml index 1739ffc..2719d4b 100644 --- a/roles/certs/tasks/main.yaml +++ b/roles/certs/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" diff --git a/roles/chrony/tasks/main.yaml b/roles/chrony/tasks/main.yaml index 8cc94d2..ac8932b 100644 --- a/roles/chrony/tasks/main.yaml +++ b/roles/chrony/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: gather OS specific variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ ansible_distribution }}.yaml" - "{{ ansible_os_family }}.yaml" diff --git a/roles/common/tasks/main.yaml b/roles/common/tasks/main.yaml index 9a151aa..0132525 100644 --- a/roles/common/tasks/main.yaml +++ b/roles/common/tasks/main.yaml @@ -1,15 +1,27 @@ --- - name: gather OS specific variables - include_vars: "{{ item }}" - with_first_found: - - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - - "{{ ansible_distribution }}.yaml" - - "{{ ansible_os_family }}.yaml" + ansible.builtin.include_vars: "{{ lookup('ansible.builtin.first_found', params) }}" + vars: + params: + files: + - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" + - "{{ ansible_distribution }}.yaml" + - "{{ ansible_os_family }}.yaml" + - "default.yaml" + paths: + - vars - name: run os specific tasks - include: "{{ item }}" - with_first_found: - - "{{ ansible_os_family }}.yaml" + ansible.builtin.include_tasks: "{{ lookup('ansible.builtin.first_found', params) }}" + vars: + params: + files: + - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" + - "{{ ansible_distribution }}.yaml" + - "{{ ansible_os_family }}.yaml" + - "default.yaml" + paths: + - tasks - name: set hostname hostname: diff --git a/roles/consul/tasks/main.yaml b/roles/consul/tasks/main.yaml index 8ef73fe..3938843 100644 --- a/roles/consul/tasks/main.yaml +++ b/roles/consul/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -43,5 +43,5 @@ state: "{{ consul_service_state | default('started') }}" enabled: "{{ consul_service_enabled | default(true) }}" -- include: forward-unbound.yaml +- ansible.builtin.include_tasks: forward-unbound.yaml when: consul_unbound_enabled diff --git a/roles/crio/tasks/main.yaml b/roles/crio/tasks/main.yaml index 8045911..c3a7f13 100644 --- a/roles/crio/tasks/main.yaml +++ b/roles/crio/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" diff --git a/roles/dns/tasks/main.yaml b/roles/dns/tasks/main.yaml index ea54f9b..3f44647 100644 --- a/roles/dns/tasks/main.yaml +++ b/roles/dns/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" diff --git a/roles/docker/tasks/main.yaml b/roles/docker/tasks/main.yaml index 19c7896..5d4c068 100644 --- a/roles/docker/tasks/main.yaml +++ b/roles/docker/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,6 +23,6 @@ paths: - tasks -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml -- include: configure.yaml +- ansible.builtin.include_tasks: configure.yaml diff --git a/roles/firewall/tasks/main.yaml b/roles/firewall/tasks/main.yaml index 632a2cc..f9f0b3f 100644 --- a/roles/firewall/tasks/main.yaml +++ b/roles/firewall/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: gather OS specific variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - "{{ ansible_distribution }}.yaml" diff --git a/roles/gitea/tasks/main.yaml b/roles/gitea/tasks/main.yaml index 8c33141..57639ad 100644 --- a/roles/gitea/tasks/main.yaml +++ b/roles/gitea/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,13 +23,13 @@ paths: - tasks -- include: pre.yaml +- ansible.builtin.include_tasks: pre.yaml -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml when: - gitea_version is version(gitea_local_version, '>') -- include: configure.yaml +- ansible.builtin.include_tasks: configure.yaml -- include: nginx.yaml +- ansible.builtin.include_tasks: nginx.yaml when: '"nginx" in ansible_play_role_names' diff --git a/roles/go/tasks/main.yaml b/roles/go/tasks/main.yaml index 7bc8a09..c58084b 100644 --- a/roles/go/tasks/main.yaml +++ b/roles/go/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather architecture specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_userspace_architecture }}.yaml" - "default.yaml" @@ -21,9 +21,9 @@ when: st.stat.exists is defined and st.stat.exists - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" diff --git a/roles/grafana/tasks/main.yaml b/roles/grafana/tasks/main.yaml index 1f0a5a4..2672628 100644 --- a/roles/grafana/tasks/main.yaml +++ b/roles/grafana/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,9 +23,9 @@ - tasks - name: include os family specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_os_family }}.yaml" - "default.yaml" @@ -93,5 +93,5 @@ enabled: "{{ grafana_service_enabled }}" - name: configure nginx - include: nginx.yaml + ansible.builtin.include_tasks: nginx.yaml when: "'nginx' in ansible_play_role_names" diff --git a/roles/grub/tasks/main.yaml b/roles/grub/tasks/main.yaml index 3a2ad09..64d3b46 100644 --- a/roles/grub/tasks/main.yaml +++ b/roles/grub/tasks/main.yaml @@ -1,12 +1,24 @@ --- - name: gather OS specific variables - include_vars: "{{ item }}" - with_first_found: - - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - - "{{ ansible_distribution }}.yaml" - - "{{ ansible_os_family }}.yaml" + ansible.builtin.include_vars: "{{ lookup('ansible.builtin.first_found', params) }}" + vars: + params: + files: + - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" + - "{{ ansible_distribution }}.yaml" + - "{{ ansible_os_family }}.yaml" + - "default.yaml" + paths: + - vars - name: run os specific tasks - include: "{{ item }}" - with_first_found: - - "{{ ansible_os_family }}.yaml" + ansible.builtin.include_tasks: "{{ lookup('ansible.builtin.first_found', params) }}" + vars: + params: + files: + - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" + - "{{ ansible_distribution }}.yaml" + - "{{ ansible_os_family }}.yaml" + - "default.yaml" + paths: + - tasks diff --git a/roles/influxdb/tasks/main.yaml b/roles/influxdb/tasks/main.yaml index 23cf980..3817282 100644 --- a/roles/influxdb/tasks/main.yaml +++ b/roles/influxdb/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" diff --git a/roles/karma/tasks/main.yaml b/roles/karma/tasks/main.yaml index 89aed0c..3e5c60a 100644 --- a/roles/karma/tasks/main.yaml +++ b/roles/karma/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,8 +23,8 @@ paths: - tasks -- include: pre.yaml +- ansible.builtin.include_tasks: pre.yaml -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml -- include: configure.yaml +- ansible.builtin.include_tasks: configure.yaml diff --git a/roles/kthxbye/tasks/main.yaml b/roles/kthxbye/tasks/main.yaml index 89aed0c..3e5c60a 100644 --- a/roles/kthxbye/tasks/main.yaml +++ b/roles/kthxbye/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,8 +23,8 @@ paths: - tasks -- include: pre.yaml +- ansible.builtin.include_tasks: pre.yaml -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml -- include: configure.yaml +- ansible.builtin.include_tasks: configure.yaml diff --git a/roles/loki/tasks/main.yaml b/roles/loki/tasks/main.yaml index 89aed0c..3e5c60a 100644 --- a/roles/loki/tasks/main.yaml +++ b/roles/loki/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,8 +23,8 @@ paths: - tasks -- include: pre.yaml +- ansible.builtin.include_tasks: pre.yaml -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml -- include: configure.yaml +- ansible.builtin.include_tasks: configure.yaml diff --git a/roles/mtail/tasks/main.yaml b/roles/mtail/tasks/main.yaml index 89aed0c..3e5c60a 100644 --- a/roles/mtail/tasks/main.yaml +++ b/roles/mtail/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,8 +23,8 @@ paths: - tasks -- include: pre.yaml +- ansible.builtin.include_tasks: pre.yaml -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml -- include: configure.yaml +- ansible.builtin.include_tasks: configure.yaml diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index aa0fe87..c75cb05 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -1,12 +1,12 @@ --- - name: gather OS distribution version specific variables - include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" + ansible.builtin.include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - name: gather OS distribution specific variables - include_vars: "{{ ansible_distribution }}.yaml" + ansible.builtin.include_vars: "{{ ansible_distribution }}.yaml" - name: gather OS family specific variables - include_vars: "{{ ansible_os_family }}.yaml" + ansible.builtin.include_vars: "{{ ansible_os_family }}.yaml" - name: manage mysql package package: diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 65fef25..4ec1a4c 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -1,10 +1,27 @@ --- - name: gather OS specific variables - include_vars: "{{ item }}" - with_first_found: - - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - - "{{ ansible_distribution }}.yaml" - - "{{ ansible_os_family }}.yaml" + ansible.builtin.include_vars: "{{ lookup('ansible.builtin.first_found', params) }}" + vars: + params: + files: + - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" + - "{{ ansible_distribution }}.yaml" + - "{{ ansible_os_family }}.yaml" + - "default.yaml" + paths: + - vars + +- name: run os specific tasks + ansible.builtin.include_tasks: "{{ lookup('ansible.builtin.first_found', params) }}" + vars: + params: + files: + - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" + - "{{ ansible_distribution }}.yaml" + - "{{ ansible_os_family }}.yaml" + - "default.yaml" + paths: + - tasks - name: systemd-networkd include: systemd-networkd.yml diff --git a/roles/nginx/tasks/main.yml b/roles/nginx/tasks/main.yml index 69cf803..20539c2 100644 --- a/roles/nginx/tasks/main.yml +++ b/roles/nginx/tasks/main.yml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -46,7 +46,7 @@ notify: reload nginx - name: configure virtual hosts - include_tasks: vhost.yaml + ansible.builtin.include_tasks: vhost.yaml loop: "{{ nginx_vhosts | dict2items }}" - name: manage service diff --git a/roles/node_exporter/tasks/main.yaml b/roles/node_exporter/tasks/main.yaml index b940b4a..1b7b93f 100644 --- a/roles/node_exporter/tasks/main.yaml +++ b/roles/node_exporter/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,10 +23,10 @@ paths: - tasks -- include: pre.yaml +- ansible.builtin.include_tasks: pre.yaml -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml when: - node_exporter_version is version(node_exporter_local_version, '>') -- include: configure.yaml +- ansible.builtin.include_tasks: configure.yaml diff --git a/roles/nomad/tasks/main.yaml b/roles/nomad/tasks/main.yaml index 9975f0a..e0eba11 100644 --- a/roles/nomad/tasks/main.yaml +++ b/roles/nomad/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" diff --git a/roles/openssh/tasks/main.yaml b/roles/openssh/tasks/main.yaml index a2f1d06..63128fc 100644 --- a/roles/openssh/tasks/main.yaml +++ b/roles/openssh/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: gather OS specific variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ ansible_distribution }}.yaml" - "{{ ansible_os_family }}.yaml" diff --git a/roles/openvpn/tasks/main.yaml b/roles/openvpn/tasks/main.yaml index 6e8cf29..0e82d7a 100644 --- a/roles/openvpn/tasks/main.yaml +++ b/roles/openvpn/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -30,7 +30,7 @@ - name: "manage instances {{ item }}" - include: instances.yaml + ansible.builtin.include_tasks: instances.yaml loop: "{{ openvpn_config.keys() | list }}" loop_control: loop_var: instance diff --git a/roles/postfix/tasks/main.yaml b/roles/postfix/tasks/main.yaml index 860c945..2b7a56a 100644 --- a/roles/postfix/tasks/main.yaml +++ b/roles/postfix/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: gather OS specific variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - "{{ ansible_distribution }}.yaml" diff --git a/roles/prometheus/tasks/main.yaml b/roles/prometheus/tasks/main.yaml index 2f8ef4e..7f4c45b 100644 --- a/roles/prometheus/tasks/main.yaml +++ b/roles/prometheus/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,12 +23,11 @@ paths: - tasks -- include: pre.yaml +- ansible.builtin.include_tasks: pre.yaml -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml -- include: configure.yaml - notify: restart prometheus +- ansible.builtin.include_tasks: configure.yaml -- include: nginx.yaml +- ansible.builtin.include_tasks: nginx.yaml when: '"nginx" in ansible_play_role_names' diff --git a/roles/promtail/tasks/main.yaml b/roles/promtail/tasks/main.yaml index 89aed0c..3e5c60a 100644 --- a/roles/promtail/tasks/main.yaml +++ b/roles/promtail/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,8 +23,8 @@ paths: - tasks -- include: pre.yaml +- ansible.builtin.include_tasks: pre.yaml -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml -- include: configure.yaml +- ansible.builtin.include_tasks: configure.yaml diff --git a/roles/pushgateway/tasks/main.yaml b/roles/pushgateway/tasks/main.yaml index cd5e3ee..08e59fc 100644 --- a/roles/pushgateway/tasks/main.yaml +++ b/roles/pushgateway/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,11 +23,11 @@ paths: - tasks -- include: pre.yaml +- ansible.builtin.include_tasks: pre.yaml -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml -- include: configure.yaml +- ansible.builtin.include_tasks: configure.yaml - #- include: nginx.yaml + #- ansible.builtin.include_tasks: nginx.yaml # when: '"nginx" in ansible_play_role_names' diff --git a/roles/rabbitmq/tasks/main.yaml b/roles/rabbitmq/tasks/main.yaml index 9424a2d..43ea152 100644 --- a/roles/rabbitmq/tasks/main.yaml +++ b/roles/rabbitmq/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -29,7 +29,7 @@ state: "{{ rabbitmq_package_state }}" - name: configure - include: configure.yaml + ansible.builtin.include_tasks: configure.yaml - name: manage service service: diff --git a/roles/rclone/tasks/main.yaml b/roles/rclone/tasks/main.yaml index 9e15018..529013d 100644 --- a/roles/rclone/tasks/main.yaml +++ b/roles/rclone/tasks/main.yaml @@ -1,13 +1,13 @@ --- - name: gather OS specific variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - "{{ ansible_distribution }}.yaml" - "{{ ansible_os_family }}.yaml" - name: OS specific tasks - include: "{{ item }}" + ansible.builtin.include_tasks: "{{ item }}" with_first_found: - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - "{{ ansible_distribution }}.yaml" diff --git a/roles/restic/tasks/main.yaml b/roles/restic/tasks/main.yaml index 84c1ba8..4aa56b7 100644 --- a/roles/restic/tasks/main.yaml +++ b/roles/restic/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -86,9 +86,9 @@ - restic-job.sh - name: manage repos - include: repo.yaml + ansible.builtin.include_tasks: repo.yaml loop: "{{ restic_repos | default([]) }}" - name: manage jobs - include: job.yaml + ansible.builtin.include_tasks: job.yaml loop: "{{ restic_jobs | default([]) }}" diff --git a/roles/rsyslog/tasks/main.yaml b/roles/rsyslog/tasks/main.yaml index be730f7..923fa38 100644 --- a/roles/rsyslog/tasks/main.yaml +++ b/roles/rsyslog/tasks/main.yaml @@ -1,5 +1,5 @@ - name: gather OS specific variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -21,7 +21,7 @@ notify: restart rsyslog - name: configure archival format - include: archival.yaml + ansible.builtin.include_tasks: archival.yaml - name: configure default rules template: diff --git a/roles/supervisor/tasks/main.yaml b/roles/supervisor/tasks/main.yaml index 8f05dc6..3cb6255 100644 --- a/roles/supervisor/tasks/main.yaml +++ b/roles/supervisor/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" diff --git a/roles/telegraf/tasks/main.yaml b/roles/telegraf/tasks/main.yaml index 0c2fc2f..880cf30 100644 --- a/roles/telegraf/tasks/main.yaml +++ b/roles/telegraf/tasks/main.yaml @@ -1,13 +1,13 @@ --- #- name: gather OS specific variables -# include_vars: "{{ item }}" +# ansible.builtin.include_vars: "{{ item }}" # with_first_found: # - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" # - "{{ ansible_distribution }}.yaml" # - "{{ ansible_os_family }}.yaml" - name: run os specific tasks - include: "{{ item }}" + ansible.builtin.include_tasks: "{{ item }}" with_first_found: - "{{ ansible_os_family }}.yaml" diff --git a/roles/teleport/tasks/main.yaml b/roles/teleport/tasks/main.yaml index 2343e46..a0b4e9b 100644 --- a/roles/teleport/tasks/main.yaml +++ b/roles/teleport/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather architecture specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_userspace_architecture }}.yaml" - "default.yaml" @@ -10,9 +10,9 @@ - vars - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -22,9 +22,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" diff --git a/roles/thanos/tasks/configure.yaml b/roles/thanos/tasks/configure.yaml index b8e7509..b43310e 100644 --- a/roles/thanos/tasks/configure.yaml +++ b/roles/thanos/tasks/configure.yaml @@ -59,5 +59,5 @@ notify: restart thanos query frontend - name: configure thanos components - include: configure-component.yaml + ansible.builtin.include_tasks: configure-component.yaml loop: "{{ thanos_services }}" \ No newline at end of file diff --git a/roles/thanos/tasks/main.yaml b/roles/thanos/tasks/main.yaml index 89aed0c..3e5c60a 100644 --- a/roles/thanos/tasks/main.yaml +++ b/roles/thanos/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,8 +23,8 @@ paths: - tasks -- include: pre.yaml +- ansible.builtin.include_tasks: pre.yaml -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml -- include: configure.yaml +- ansible.builtin.include_tasks: configure.yaml diff --git a/roles/util/tasks/main.yaml b/roles/util/tasks/main.yaml index 6745c5c..4f8cead 100644 --- a/roles/util/tasks/main.yaml +++ b/roles/util/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" diff --git a/roles/vault/tasks/main.yaml b/roles/vault/tasks/main.yaml index 949e1f2..a0db6fe 100644 --- a/roles/vault/tasks/main.yaml +++ b/roles/vault/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" diff --git a/roles/vm_guest/tasks/main.yaml b/roles/vm_guest/tasks/main.yaml index c54fdae..28ca299 100644 --- a/roles/vm_guest/tasks/main.yaml +++ b/roles/vm_guest/tasks/main.yaml @@ -1,17 +1,17 @@ --- - name: gather OS specific variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - "{{ ansible_distribution }}.yaml" - "{{ ansible_os_family }}.yaml" - name: gather virtualization specific variables - include_vars: "{{ item }}" + ansible.builtin.include_vars: "{{ item }}" with_first_found: "{{ ansible_virtualization_type }}.yaml" - name: run virtualization specific tasks - include: "{{ item }}" + ansible.builtin.include_tasks: "{{ item }}" with_first_found: "{{ ansible_virtualization_type }}.yaml" diff --git a/roles/wireguard/tasks/main.yaml b/roles/wireguard/tasks/main.yaml index 524db2e..134d788 100644 --- a/roles/wireguard/tasks/main.yaml +++ b/roles/wireguard/tasks/main.yaml @@ -1,8 +1,8 @@ --- - name: gather os specific variables - include_vars: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -12,9 +12,9 @@ - vars - name: include os specific tasks - include_tasks: "{{ lookup('first_found', possible_files) }}" + ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}" vars: - possible_files: + params: files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}.yaml" @@ -23,11 +23,11 @@ paths: - tasks -- include: install.yaml +- ansible.builtin.include_tasks: install.yaml -#- include: configure.yaml +#- ansible.builtin.include_tasks: configure.yaml -- include: configure-interface.yaml +- ansible.builtin.include_tasks: configure-interface.yaml loop: "{{ wireguard_interfaces.keys() | list }}" loop_control: loop_var: _wireguard_interface