diff --git a/tasks/remount-off.yml b/tasks/remount-off.yml index 2d6d5c5..2b3656e 100644 --- a/tasks/remount-off.yml +++ b/tasks/remount-off.yml @@ -16,6 +16,9 @@ register: mount changed_when: False failed_when: False + # Use this with Ansible 2.1+ + #when: not ansible_check_mod + always_run: yes with_items: "{{ partitions }}" - name: Remount /usr if it is a partition and it is not mounted in ro @@ -23,12 +26,12 @@ when: item.0 == "/usr" and item.1.rc == 0 and not item.1.stdout_lines.0|search("ro") failed_when: False with_together: - - "{{ partitions }}" - - "{{ mount.results }}" + - "{{ partitions }}" + - "{{ mount.results }}" - name: Remount /tmp if it is a partition and it is not mounted in noexec command: "mount -o remount {{ item.0 }}" when: item.0 == "/tmp" and item.1.rc == 0 and not item.1.stdout_lines.0|search("noexec") with_together: - - "{{ partitions }}" - - "{{ mount.results }}" + - "{{ partitions }}" + - "{{ mount.results }}" diff --git a/tasks/remount-on.yml b/tasks/remount-on.yml index 4e26595..ea7689e 100644 --- a/tasks/remount-on.yml +++ b/tasks/remount-on.yml @@ -17,6 +17,9 @@ register: mount changed_when: False failed_when: False + # Use this with Ansible 2.1+ + #when: not ansible_check_mod + always_run: yes with_items: "{{ partitions }}" - name: Remount /usr if it is a partition and it is not mounted in rw