Puppet Augeas Provider and augtool

32 views
Skip to first unread message

bjoern pohl

unread,
May 19, 2015, 4:39:34 AM5/19/15
to puppet...@googlegroups.com
Hi, 
i'm currently developing some manifests using the augeas provider ( mostly using the sudoers lens) and I am permanently running into trouble.

It seems that the augeas provider and augtool behave differently regarding path declarations, making it worse to test and develop things. But perhaps i'm just doing it wrong :)

While a snipplet like

"set Cmnd_Alias[alias/name = 'HOMEMGMT']/alias/name         HOMEMGMT",
"set Cmnd_Alias[alias/name = 'HOMEMGMT']/alias/command[1]   '/bin/mkdir'",
"set Cmnd_Alias[alias/name = 'HOMEMGMT']/alias/command[2]   '/bin/chmod'",
"set Cmnd_Alias[alias/name = 'HOMEMGMT']/alias/command[3]   '/bin/chown'"

works perfectly fine while using it as the changes content in an augeas puppet ressource,
I see the following while running it on the same (puppet-generated) suoders file in augtool:

#~> augtool print /files/etc/sudoers/Cmnd_Alias[2]
/files/etc/sudoers/Cmnd_Alias[2]
/files/etc/sudoers/Cmnd_Alias[2]/alias
/files/etc/sudoers/Cmnd_Alias[2]/alias/name = "HOMEMGMT"
/files/etc/sudoers/Cmnd_Alias[2]/alias/command[1] = "/bin/mkdir"
/files/etc/sudoers/Cmnd_Alias[2]/alias/command[2] = "/bin/chmod"
/files/etc/sudoers/Cmnd_Alias[2]/alias/command[3] = "/bin/chown"
#~>

So all fine, it's there.

Same again using a more explicit path declaration in augtool - as done above in the (working) puppet manifest:

#~>augtool print /files/etc/sudoers/Cmnd_Alias[alias/name = "HOMEMGMT"]
#~>

I would have expected exactly the same output as before, but something's going wrong. 

Any ideas?


regards,
Björn





bjoern pohl

unread,
May 19, 2015, 7:35:58 AM5/19/15
to puppet...@googlegroups.com
ouch...
just some minor modifications and it works :)
augtool print '/files/etc/sudoers/Cmnd_Alias[alias/name = "HOMEMGMT"]'

not sure what my shell is eating there... perhaps that slash...


Felix Frank

unread,
May 19, 2015, 2:11:17 PM5/19/15
to puppet...@googlegroups.com
The quotes, most likely :-)

Nice catch.
Reply all
Reply to author
Forward
0 new messages