Skip to content

Instantly share code, notes, and snippets.

@halberom
Created April 16, 2014 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halberom/10898118 to your computer and use it in GitHub Desktop.
Save halberom/10898118 to your computer and use it in GitHub Desktop.
modify mount options
# /tmp/example_otpions.txt
rw,noatime,data=ordered,acl
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
---
- 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