shell command with no change but register should always run
This commit is contained in:
parent
b85a9178e3
commit
8f871821dd
|
@ -16,6 +16,9 @@
|
||||||
register: mount
|
register: mount
|
||||||
changed_when: False
|
changed_when: False
|
||||||
failed_when: False
|
failed_when: False
|
||||||
|
# Use this with Ansible 2.1+
|
||||||
|
#when: not ansible_check_mod
|
||||||
|
always_run: yes
|
||||||
with_items: "{{ partitions }}"
|
with_items: "{{ partitions }}"
|
||||||
|
|
||||||
- name: Remount /usr if it is a partition and it is not mounted in ro
|
- 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")
|
when: item.0 == "/usr" and item.1.rc == 0 and not item.1.stdout_lines.0|search("ro")
|
||||||
failed_when: False
|
failed_when: False
|
||||||
with_together:
|
with_together:
|
||||||
- "{{ partitions }}"
|
- "{{ partitions }}"
|
||||||
- "{{ mount.results }}"
|
- "{{ mount.results }}"
|
||||||
|
|
||||||
- name: Remount /tmp if it is a partition and it is not mounted in noexec
|
- name: Remount /tmp if it is a partition and it is not mounted in noexec
|
||||||
command: "mount -o remount {{ item.0 }}"
|
command: "mount -o remount {{ item.0 }}"
|
||||||
when: item.0 == "/tmp" and item.1.rc == 0 and not item.1.stdout_lines.0|search("noexec")
|
when: item.0 == "/tmp" and item.1.rc == 0 and not item.1.stdout_lines.0|search("noexec")
|
||||||
with_together:
|
with_together:
|
||||||
- "{{ partitions }}"
|
- "{{ partitions }}"
|
||||||
- "{{ mount.results }}"
|
- "{{ mount.results }}"
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
register: mount
|
register: mount
|
||||||
changed_when: False
|
changed_when: False
|
||||||
failed_when: False
|
failed_when: False
|
||||||
|
# Use this with Ansible 2.1+
|
||||||
|
#when: not ansible_check_mod
|
||||||
|
always_run: yes
|
||||||
with_items: "{{ partitions }}"
|
with_items: "{{ partitions }}"
|
||||||
|
|
||||||
- name: Remount /usr if it is a partition and it is not mounted in rw
|
- name: Remount /usr if it is a partition and it is not mounted in rw
|
||||||
|
|
Loading…
Reference in a new issue