Skip to content

Commit 5d2430a

Browse files
committed
fix: resolve distro requirements ending play not just role
1 parent 9426b10 commit 5d2430a

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

tasks/distro-requirements.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
ansible_distribution_version is version(supported_distros | selectattr("name", "equalto", ansible_distribution) | map(attribute="min_version") | first, "<") or
88
ansible_architecture not in (supported_distros | selectattr("name", "equalto", ansible_distribution) | map(attribute="supported_architectures", default=[]) | first)
99
10-
- name: "Display if distro or architecture are supported"
10+
- name: "Display if distro or architecture is not supported"
1111
ansible.builtin.debug:
1212
msg: "{{ ansible_distribution }} {{ ansible_distribution_version }} on {{ ansible_architecture }} is not supported"
1313
when: distro_supported is false
@@ -20,7 +20,3 @@
2020
mode: "0644"
2121
no_log: true
2222
when: distro_supported is false and "molecule-notest" in ansible_skip_tags
23-
24-
- name: "Skip role if distro or architecture is not supported"
25-
ansible.builtin.meta: end_host
26-
when: distro_supported is false

tasks/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
- name: "Become block"
2121
become: true
22+
when: distro_supported is true
2223
block:
2324
- name: "Remove netdata"
2425
ansible.builtin.include_tasks: remove.yml

tasks/remove.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@
3333
path: "{{ item }}"
3434
state: absent
3535
with_items:
36-
- /etc/netdata
37-
- /var/log/netdata
38-
- /var/lib/netdata
39-
- /var/cache/netdata
40-
- /usr/libexec/netdata
41-
- /usr/lib/netdata
42-
- /usr/share/netdata
36+
- "/etc/netdata"
37+
- "/var/log/netdata"
38+
- "/var/lib/netdata"
39+
- "/var/cache/netdata"
40+
- "/usr/libexec/netdata"
41+
- "/usr/lib/netdata"
42+
- "/usr/share/netdata"
4343

4444
- name: "Ensure netdata service user is removed"
4545
ansible.builtin.user:
4646
name: netdata
4747
comment: "Netdata Monitoring"
48-
shell: /sbin/nologin
48+
shell: "/sbin/nologin"
4949
system: true
5050
createhome: false
51-
home: /var/lib/netdata
51+
home: "/var/lib/netdata"
5252
state: absent

0 commit comments

Comments
 (0)