You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've seen a few users now who struggle with using the raw augeas resource to set up a subtree idempotently (and that is a big head scratcher) I agree that ultimately the right answer is to build providers that are targetted at specific uses.
At the same time, it would be awesome to have one (or several) resources that make it easy to ensure that a certain subtree is there idempotently; I am thinking something along the lines of
# Most of this is the regular 'augeas' resource
augeas::tree { sshd_root_login:
lens => 'Sshd.lns',
file => ...,
context => '/files/etc/ssh/sshd_config',
after => "#comment[.='PermitRootLogin yes']",
entries => [
# Here we'd describe what we want the subtree to look like
"PermitRootLogin = yes"
]
}
There's lots of variations on this theme, like should a subtree be deleted if it exists in the wrong place etc.
Since Augeas actually behaves idempotently if you delete and then recreate the exact same subtree, the implementation of such a resource might not be terribly difficult.
The text was updated successfully, but these errors were encountered:
I think we could have some kind of type/provider using the augeasproviders accessors, coupled with Augeas#store/Augeas#retrieve to map file syntax to tree (like in your example of entries).
I've seen a few users now who struggle with using the raw augeas resource to set up a subtree idempotently (and that is a big head scratcher) I agree that ultimately the right answer is to build providers that are targetted at specific uses.
At the same time, it would be awesome to have one (or several) resources that make it easy to ensure that a certain subtree is there idempotently; I am thinking something along the lines of
There's lots of variations on this theme, like should a subtree be deleted if it exists in the wrong place etc.
Since Augeas actually behaves idempotently if you delete and then recreate the exact same subtree, the implementation of such a resource might not be terribly difficult.
The text was updated successfully, but these errors were encountered: