Commit f89ecf46 authored by Simon Cornet's avatar Simon Cornet
Browse files

feat: move motd cleanup to debian specific block

parent 73690dbf
Loading
Loading
Loading
Loading
Loading
+19 −17
Original line number Diff line number Diff line
@@ -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"