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"
|
||||
tags: "motd"
|
||||
block:
|
||||
|
||||
# cleanup old motd debian
|
||||
- name: "cleanup old motd debian"
|
||||
when: "ansible_os_family == 'Debian'"
|
||||
block:
|
||||
|
||||
# find old motd files
|
||||
|
|
@ -12,7 +17,6 @@
|
|||
excludes:
|
||||
- "10-custom-motd"
|
||||
register: "old_motd"
|
||||
when: "ansible_os_family == 'Debian'"
|
||||
|
||||
# remove old custom motd files
|
||||
- name: "motd - cleanup directory"
|
||||
|
|
@ -20,9 +24,7 @@
|
|||
path: "{{ item.path }}"
|
||||
state: "absent"
|
||||
loop: "{{ old_motd.files }}"
|
||||
when:
|
||||
- "old_motd.files|length > 0"
|
||||
- "ansible_os_family == 'Debian'"
|
||||
when: "old_motd.files|length > 0"
|
||||
|
||||
# remove old motd files
|
||||
- name: "motd - cleanup main file"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue