feat: move motd cleanup to debian specific block
This commit is contained in:
parent
73690dbf11
commit
f89ecf464d
1 changed files with 19 additions and 17 deletions
|
|
@ -2,6 +2,11 @@
|
||||||
|
|
||||||
- name: "manage motd"
|
- name: "manage motd"
|
||||||
tags: "motd"
|
tags: "motd"
|
||||||
|
block:
|
||||||
|
|
||||||
|
# cleanup old motd debian
|
||||||
|
- name: "cleanup old motd debian"
|
||||||
|
when: "ansible_os_family == 'Debian'"
|
||||||
block:
|
block:
|
||||||
|
|
||||||
# find old motd files
|
# find old motd files
|
||||||
|
|
@ -12,7 +17,6 @@
|
||||||
excludes:
|
excludes:
|
||||||
- "10-custom-motd"
|
- "10-custom-motd"
|
||||||
register: "old_motd"
|
register: "old_motd"
|
||||||
when: "ansible_os_family == 'Debian'"
|
|
||||||
|
|
||||||
# remove old custom motd files
|
# remove old custom motd files
|
||||||
- name: "motd - cleanup directory"
|
- name: "motd - cleanup directory"
|
||||||
|
|
@ -20,9 +24,7 @@
|
||||||
path: "{{ item.path }}"
|
path: "{{ item.path }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
loop: "{{ old_motd.files }}"
|
loop: "{{ old_motd.files }}"
|
||||||
when:
|
when: "old_motd.files|length > 0"
|
||||||
- "old_motd.files|length > 0"
|
|
||||||
- "ansible_os_family == 'Debian'"
|
|
||||||
|
|
||||||
# remove old motd files
|
# remove old motd files
|
||||||
- name: "motd - cleanup main file"
|
- name: "motd - cleanup main file"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue