On Sun, Jan 18, 2009 at 7:57 PM, chakkerz <chakkerz@gmail.com> wrote:> > Awesome > > Thanks for the Template idea Teyo, that looks exactly like what i > want. > > So i created my templte sshd_config.erb > > Port 22 > Protocol 2 > ListenAddress <%= listenaddress %> > #ListenAddress :: > > SyslogFacility AUTHPRIV > PermitRootLogin no > #StrictModes yes > PasswordAuthentication no > ChallengeResponseAuthentication no > GSSAPIAuthentication yes > GSSAPICleanupCredentials yes > UsePAM yes > X11Forwarding yes > Banner /etc/motd > Subsystem sftp /usr/libexec/openssh/sftp-server > > Third line <%= listenaddress %> although > http://reductivelabs.com/trac/puppet/wiki/TypeReference > indicates that maybe it should be <%= listenaddress %> instead (i''m > guessing it doesn''t make a difference post processing?) eitherway i > get the following error: > > [root@puppetslave puppet]# puppetd -vt ; cat /etc/ssh/sshd_config > info: Retrieving plugins > err: Could not retrieve catalog: wrong number of arguments (1 for 2) > at /etc/puppet/modules/sshdconfig/manifests/init.pp:14 on node > puppetslave.its.uq.edu.au > warning: Not using cache on failed catalog > > with my module''s manifest/init.pp looking like: > define sshd_config($listenaddress) > { > file > { "sshd_config": > # path => $operatingsystem ? > # { > # solaris => [ "/usr/local/etc/ssh/ > sshd_config", "/etc/ss > h/sshd_config" ], > # default => [ "/etc/ssh/sshd_config" ], > # }, > path => "/etc/sshd/sshd_config", > owner => root, > group => root, > mode => 444, > content => template("sshd_config.erb"),You just need to include the module name in the path. Assuming your module is named ssh, this what the arguments to the template function should look like: content => template("ssh/sshd_config.erb"),> # listenaddress => $ipaddress, > notify => Service[sshd], > } > } > > > class sshdconfig > { > sshd_config{ puppet: listenaddress => $ipaddress } > } > > So looking at the template guide, i don''t see $name (which is used in > it''s example template) specified anywhere, but i''m a little lost... > > sorry about all the hand holding...No problem. This discussion should probably move over to the user list though, so I CC''d that list as well.> > > I''m going to check out David''s Augeas method next... > > chakkerz > > >-- Teyo Tyree :: www.reductivelabs.com :: +1.615.275.5066 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com To unsubscribe from this group, send email to puppet-dev+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
chakkerz
2009-Jan-19 22:15 UTC
[Puppet Users] Re: creating a custom type to replace a line in a file
HAHA!!!!!! it works!!!! You the man! I''ve updated http://reductivelabs.com/trac/puppet/wiki/PuppetTemplating with the code i generated for this (slightly trimmed, but still verbose) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---