Skip to content

Instantly share code, notes, and snippets.

@raphink
Last active December 22, 2015 17:59
Show Gist options
  • Save raphink/6509705 to your computer and use it in GitHub Desktop.
Save raphink/6509705 to your computer and use it in GitHub Desktop.
[fstab_missing_opt]
path = /files/etc/fstab/*[label()=~regexp('[0-9]+') and count(opt[.='foo'])=0]
method = label
type = multiple
sep = ,
define fstab_opt (
$entry,
$value,
) {
augeas { "Set fstab opt for ${entry}":
context => "./${entry}",
changes => "set opt[last()+1] ${value}",
}
}
fstab_missing_opt { slit($::fstab_missing_opt, ','):
value => 'foo',
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment