Last active
January 2, 2016 15:59
-
-
Save ffrank/8327298 to your computer and use it in GitHub Desktop.
puppet ssh_authorized_keys behavior is potentially confusing
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
Consider the current ssh_authrized_keys state and puppet manifest below. | |
Puppet will sync the key options away, although the manifest doesn't mention them at all. | |
That's because the 'options' property defaults to 'absent'. | |
This strikes me as unsound. There's two more sane ways I can imagine: | |
1. Forgo default values for all properties | |
2. Make default values special, so that properties use them only | |
when creating a new managed entity on the system | |
(i.e. the resource is changed from absent to a present state). | |
The former alternative is not practical of course, | |
because values are usually needed | |
when changing resources from absent to present. |
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
puppet apply -e 'ssh_authorized_key { "ffrank@geras": user => "ffrank }' | |
Notice: Compiled catalog for geras.localdomain in environment production in 0.19 seconds | |
Notice: /Stage[main]//Ssh_authorized_key[ffrank@geras]/options: current_value command="logger -- ssh opened with cmd $SSH_ORIGINAL_COMMAND", should be absent (noop) | |
Notice: Class[Main]: Would have triggered 'refresh' from 1 events | |
Notice: Stage[main]: Would have triggered 'refresh' from 1 events | |
Notice: Finished catalog run in 0.39 seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment