Created
February 28, 2013 16:41
-
-
Save raphink/5058063 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
rpinson@wrk4:~/bas/puppet/augeas$ cat /etc/fstab | |
# HEADER: This file was autogenerated at Tue Mar 13 13:29:32 +0100 2012 | |
# HEADER: by puppet. While it can still be managed manually, it | |
# HEADER: is definitely not recommended. | |
# /etc/fstab: static file system information. | |
# | |
# Use 'blkid' to print the universally unique identifier for a | |
# device; this may be used with UUID= as a more robust way to name devices | |
# that works even if disks are added and removed. See fstab(5). | |
# | |
# <file system> <mount point> <type> <options> <dump> <pass> | |
proc /proc proc nodev,noexec,nosuid 0 0 | |
# / was on /dev/sda2 during installation | |
UUID=47c94fb8-b60b-4de7-bcd8-df9af70af809 / ext4 errors=remount-ro 0 1 | |
# /home was on /dev/sda6 during installation | |
/dev/sda6 /home auto defaults 0 0 | |
# swap was on /dev/sda5 during installation | |
UUID=e4ea95b4-6518-4459-8590-2e9474948d4b none swap sw 0 0 | |
rpinson@wrk4:~/bas/puppet/augeas$ cat fakemodule/manifests/init.pp | |
class fakemodule { | |
$fstab = file('/etc/fstab') | |
notify { 'foo': | |
message => augeas($fstab, 'Fstab.lns', [ | |
'rm ./1/opt[3]', | |
'rm #comment', | |
'set ./*[file="/"]/spec /dev/sda3', | |
]), | |
} | |
} | |
rpinson@wrk4:~/bas/puppet/augeas$ RUBYLIB=/var/lib/gems/1.8/gems/ruby-augeas-0.4.1/lib puppet apply -e 'include fakemodule' --modulepath . | |
notice: # | |
# | |
proc /proc proc nodev,noexec 0 0 | |
/dev/sda3 / ext4 errors=remount-ro 0 1 | |
/dev/sda6 /home auto defaults 0 0 | |
UUID=e4ea95b4-6518-4459-8590-2e9474948d4b none swap sw 0 0 | |
notice: /Stage[main]/Fakemodule/Notify[foo]/message: defined 'message' as '# | |
# | |
proc /proc proc nodev,noexec 0 0 | |
/dev/sda3 / ext4 errors=remount-ro 0 1 | |
/dev/sda6 /home auto defaults 0 0 | |
UUID=e4ea95b4-6518-4459-8590-2e9474948d4b none swap sw 0 0 | |
' | |
notice: Finished catalog run in 0.01 seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment