Created
April 16, 2014 15:54
-
-
Save halberom/10898118 to your computer and use it in GitHub Desktop.
modify mount options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /tmp/example_otpions.txt | |
rw,noatime,data=ordered,acl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLAY [localhost] ************************************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [localhost] | |
TASK: [get root mount options] ************************************************ | |
changed: [localhost] | |
TASK: [do something funky] **************************************************** | |
changed: [localhost] | |
PLAY RECAP ******************************************************************** | |
localhost : ok=3 changed=2 unreachable=0 failed=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
tasks: | |
- name: get root mount options | |
shell: cat /etc/mtab | grep ' / ' | grep -v 'rootfs' | awk '{print $4}' | |
register: value | |
- name: do something funky | |
shell: echo "{{ value.stdout + ',acl' }}" >> /tmp/example_options.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment