apache: fix usr rw remount
This commit is contained in:
parent
bee42c57d2
commit
ce89d5c5a5
|
@ -1,19 +1,12 @@
|
||||||
---
|
---
|
||||||
- name: Get mount options for partitions
|
- name: update ansible_mounts facts
|
||||||
shell: "mount | grep 'on /usr type'"
|
setup:
|
||||||
args:
|
filter: ansible_mounts
|
||||||
warn: no
|
|
||||||
register: mount
|
|
||||||
changed_when: False
|
|
||||||
failed_when: False
|
|
||||||
when: not ansible_check_mode
|
|
||||||
|
|
||||||
- name: Remount /usr if it is a partition and it is not mounted in rw
|
- name: mount /usr in rw
|
||||||
command: "mount -o remount,rw /usr"
|
command: mount -o remount,rw /usr
|
||||||
when:
|
|
||||||
- not ansible_check_mode
|
|
||||||
- mount.rc == 0
|
|
||||||
- not mount.stdout_lines.0 | search("rw")
|
|
||||||
check_mode: yes
|
|
||||||
args:
|
args:
|
||||||
warn: no
|
warn: no
|
||||||
|
changed_when: false
|
||||||
|
when: item.mount == '/usr' and item.options | match(".*ro.*")
|
||||||
|
with_items: "{{ ansible_mounts }}"
|
||||||
|
|
Loading…
Reference in a new issue