Oleksandr Yudin
2014-Nov-03 14:26 UTC
[Puppet Users] puppet augeas inittab whitespaces and single/double quotes, backslash
Hi everyone. I am attempting to add this line to /etc/inittab: TS0:23:respawn:/sbin/mgetty -m '"" \d\dAT OK' ttyS0 Here is the puppet manifest I am trying to make: augeas {"/etc/inittab": context => "/files/etc/inittab", changes => [ "set TS0/runlevels 23", "set TS0/action respawn", "set TS0/process '/sbin/mgetty -m \'\"\" \\d\\dAT OK\' ttyS0'", ], } Here is the pertinent debug output from a manual run feeding that code to puppet: debug: Augeas[/etc/inittab](provider=augeas): Opening augeas with root /, lens path , flags 0 debug: Augeas[/etc/inittab](provider=augeas): Augeas version 0.10.0 is installed debug: Augeas[/etc/inittab](provider=augeas): Will attempt to save and only run if files changed debug: Augeas[/etc/inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/TS0/runlevels", "23"] debug: Augeas[/etc/inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/TS0/action", "respawn"] debug: Augeas[/etc/inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/TS0/process", "/sbin/mgetty -m "] debug: Augeas[/etc/inittab](provider=augeas): Executing 'diff -u /etc/inittab /etc/inittab.augnew' notice: Augeas[/etc/inittab](provider=augeas): --- /etc/inittab 2014-11-03 14:19:36.320019164 +0000 +++ /etc/inittab.augnew 2014-11-03 14:19:43.416020957 +0000 @@ -71,3 +71,4 @@ # # # +TS0:23:respawn:/sbin/mgetty -m debug: Augeas[/etc/inittab](provider=augeas): Files changed, should execute debug: Augeas[/etc/inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/TS0/runlevels", "23"] debug: Augeas[/etc/inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/TS0/action", "respawn"] debug: Augeas[/etc/inittab](provider=augeas): sending command 'set' with params ["/files/etc/inittab/TS0/process", "/sbin/mgetty -m "] debug: Augeas[/etc/inittab](provider=augeas): Closed the augeas connection Can anyone show me the proper way to insert this line with whitespaces and single/double quotes, backslash into inittab using augeas and puppet? Thanks -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d475902e-9435-4d27-8e94-233f85a951f3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.