Hi guys! When I adds this (exec { "/usr/bin/chpass -p $1$HvjTWzzz$jF.G/ mEbh7IOtpCdUPUTO1 pt_":}) in configs so that I`ll have in logs: debug: Executing ''/usr/bin/chpass -p $1$HvjTWzzz$jF.G/mEbh7IOtpCdUPUTO1 pt_'' notice: //Node[hostname]/virt_users/pt_/Exec[/usr/bin/chpass -p $1$HvjTWzzz$jF.G/mEbh7IOtpCdUPUTO1 pt_]/returns: executed successfully BUT in /etc/master.passwd : "pt_:.G/ mEbh7IOtpCdUPUTO1:10006:10006::0:0::/home/pt_:/bin/bash" And now question ) How can I call exec and be sure that exec will not cut my string? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
OS Freebsd 6.0 puppet 0.24.5 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
nmay wrote:> When I adds this (exec { "/usr/bin/chpass -p $1$HvjTWzzz$jF.G/ > mEbh7IOtpCdUPUTO1 pt_":}) in configs so that I`ll have in logs: debug: > Executing ''/usr/bin/chpass -p $1$HvjTWzzz$jF.G/mEbh7IOtpCdUPUTO1 pt_'' > notice: //Node[hostname]/virt_users/pt_/Exec[/usr/bin/chpass -p > $1$HvjTWzzz$jF.G/mEbh7IOtpCdUPUTO1 pt_]/returns: executed successfully > BUT in /etc/master.passwd : "pt_:.G/ > mEbh7IOtpCdUPUTO1:10006:10006::0:0::/home/pt_:/bin/bash" > > And now question ) > How can I call exec and be sure that exec will not cut my string?Tried quoting or escaping the $ characters? "chpass -p ''$1$foo$bar pt_''", for example? -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, 19 Mar 2009 18:11:25 +0500, Mike Renfro <renfro@tntech.edu> wrote: This will change root passsword)))> > nmay wrote: > >> When I adds this (exec { "/usr/bin/chpass -p $1$HvjTWzzz$jF.G/ >> mEbh7IOtpCdUPUTO1 pt_":}) in configs so that I`ll have in logs: debug: >> Executing ''/usr/bin/chpass -p $1$HvjTWzzz$jF.G/mEbh7IOtpCdUPUTO1 pt_'' >> notice: //Node[hostname]/virt_users/pt_/Exec[/usr/bin/chpass -p >> $1$HvjTWzzz$jF.G/mEbh7IOtpCdUPUTO1 pt_]/returns: executed successfully >> BUT in /etc/master.passwd : "pt_:.G/ >> mEbh7IOtpCdUPUTO1:10006:10006::0:0::/home/pt_:/bin/bash" >> >> And now question ) >> How can I call exec and be sure that exec will not cut my string? > > Tried quoting or escaping the $ characters? "chpass -p ''$1$foo$bar > pt_''", for example? > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
You have to escape the dollar signs or quote the text specifically. Otherwise puppet will assume that: "$1$HvjTWzzz$jF.G/mEbh7IOtpCdUPUTO1 pt_" will break up into the following variables: $1 $HvjTWzzz $jF Which is why you get the weird line. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Fri, 20 Mar 2009 06:18:42 +0500, jrojas <jason.r.rojas@gmail.com> wrote: Am I understand you right? I must exec this string "/usr/bin/chpass -p \$1\$HvjTWzzz\$jF.G/mEbh7IOtpCdUPUTO1 pt_" If yes, so it is not work(( PS This is my "new" config string which NOT working as I want: exec { "/usr/bin/chpass -p \$1\$HvjTWzzz\$jF.G/mEbh7IOtpCdUPUTO1 pt_":}> > You have to escape the dollar signs or quote the text specifically. > Otherwise puppet will assume that: > "$1$HvjTWzzz$jF.G/mEbh7IOtpCdUPUTO1 pt_" > will break up into the following variables: > $1 > $HvjTWzzz > $jF > > Which is why you get the weird line. > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On 2009-Mar-20, at 2:07 AM, nick.maystrenko@gmail.com wrote:> PS This is my "new" config string which NOT working as I want: exec { > "/usr/bin/chpass -p \$1\$HvjTWzzz\$jF.G/mEbh7IOtpCdUPUTO1 pt_":}Have you tried single quotes? (I''m not sure if you even need to keep the backslashes with single quotes.) <http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#quoting> -- Rob McBroom <http://www.skurfer.com/> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
nick.maystrenko@gmail.com wrote:> On Fri, 20 Mar 2009 06:18:42 +0500, jrojas <jason.r.rojas@gmail.com> wrote: > Am I understand you right? I must exec this string "/usr/bin/chpass -p > \$1\$HvjTWzzz\$jF.G/mEbh7IOtpCdUPUTO1 pt_" > If yes, so it is not work(( > PS This is my "new" config string which NOT working as I want: exec { > "/usr/bin/chpass -p \$1\$HvjTWzzz\$jF.G/mEbh7IOtpCdUPUTO1 pt_":} > >> You have to escape the dollar signs or quote the text specifically.or quote it: command => "/usr/bin/chpass -p ''$1$foo$bar'' pt_"; worst case, put the command in a shell script, pull the script to the client with a file entry, and exec it. Might be a grep typo in the onlyif statement below -- it''s intended to run the chpass script if and only if the password is set incorrectly. Otherwise, you could write whatever logic you want in the script to ensure that the password isn''t already set properly before it runs chpass. file { "/path/to/script": source => "puppet://server/other/path/to/script", mode => 0700; } exec { "chpass_pt_": command => "/path/to/script", onlyif => "egrep -q ''^pt_:.*UPUTO1:'' /path/to/passwd", require => File["/path/to/script"]; } -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Fri, 20 Mar 2009 17:32:12 +0500, Mike Renfro <renfro@tntech.edu> wrote: YUPI! SOLVED That variant is ok! exec { "/usr/bin/chpass -p ''\$1\$HvjTWzzz\$jF.G/mEbh7IOtpCdUPUTO1'' pt_":} Thank everybody who helps me.> > nick.maystrenko@gmail.com wrote: >> On Fri, 20 Mar 2009 06:18:42 +0500, jrojas <jason.r.rojas@gmail.com> >> wrote: >> Am I understand you right? I must exec this string "/usr/bin/chpass -p >> \$1\$HvjTWzzz\$jF.G/mEbh7IOtpCdUPUTO1 pt_" >> If yes, so it is not work(( >> PS This is my "new" config string which NOT working as I want: exec { >> "/usr/bin/chpass -p \$1\$HvjTWzzz\$jF.G/mEbh7IOtpCdUPUTO1 pt_":} >> >>> You have to escape the dollar signs or quote the text specifically. > > or quote it: command => "/usr/bin/chpass -p ''$1$foo$bar'' pt_"; > > worst case, put the command in a shell script, pull the script to the > client with a file entry, and exec it. Might be a grep typo in the > onlyif statement below -- it''s intended to run the chpass script if and > only if the password is set incorrectly. Otherwise, you could write > whatever logic you want in the script to ensure that the password isn''t > already set properly before it runs chpass. > > file { "/path/to/script": > source => "puppet://server/other/path/to/script", > mode => 0700; > } > > exec { "chpass_pt_": > command => "/path/to/script", > onlyif => "egrep -q ''^pt_:.*UPUTO1:'' /path/to/passwd", > require => File["/path/to/script"]; > } >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---