apache: fix usr rw remount

This commit is contained in:
Victor LABORIE 2017-10-31 15:28:42 +01:00
parent bee42c57d2
commit ce89d5c5a5
1 changed files with 8 additions and 15 deletions

View File

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