I''m new to puppet so this might be a foolish question. I''m using Solaris 10, server is Sparc, my client is x86. I created a ''file chown'' manifest as a test ... /etc/puppet/manifests/classes/puppet.pp class puppet { file { "/etc/puppet.txt": owner => "root", group => "root", mode => 440, } } that Just Works when the client runs puppet puppetd --verbose --logdest /tmp/p.log --server co-web-989 notice: Starting Puppet client version 0.22.1 info: Config is up to date notice: Starting configuration run notice: //default/puppet/File[/etc/puppet.txt]/owner: owner changed ''brian'' to ''root'' notice: Finished configuration run in 0.22 seconds Rockin! However for a ''real world'' demo what I''d like to do is create a manifest to shut down X Windows on my various and sundry servers. Why? Because that''s the way we roll. Also because SOX standards tell us we have to. /etc/puppet/manifests/classes/cde-login.pp class cde-login { service { cde-login: ensure => ''svcadm disable cde-login'', } } Nothing happens on the client - clearly something is amiss. Am I doing something obviously wrong? I can certainly manually run ''svcadm disable cde-login'' as root and watch X rather dramatically stop working on my test machine (grin). Brian Dunbar Systems Administrator Plexus Desk: (920) 751-3364 Cell: (920) 716-2027 _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
You just want: class cde-login { service { cde-login: ensure => ''stopped'' } } Because Puppet knows about SMF and will handle things neatly. Matt -----Original Message----- From: puppet-users-bounces@madstop.com [mailto:puppet-users-bounces@madstop.com] On Behalf Of Brian Dunbar Sent: Wednesday, 31 October 2007 8:10 AM To: Puppet-users@madstop.com Subject: [Puppet-users] Newb to puppet - Solaris svcadm question I''m new to puppet so this might be a foolish question. I''m using Solaris 10, server is Sparc, my client is x86. I created a ''file chown'' manifest as a test ... /etc/puppet/manifests/classes/puppet.pp class puppet { file { "/etc/puppet.txt": owner => "root", group => "root", mode => 440, } } that Just Works when the client runs puppet puppetd --verbose --logdest /tmp/p.log --server co-web-989 notice: Starting Puppet client version 0.22.1 info: Config is up to date notice: Starting configuration run notice: //default/puppet/File[/etc/puppet.txt]/owner: owner changed ''brian'' to ''root'' notice: Finished configuration run in 0.22 seconds Rockin! However for a ''real world'' demo what I''d like to do is create a manifest to shut down X Windows on my various and sundry servers. Why? Because that''s the way we roll. Also because SOX standards tell us we have to. /etc/puppet/manifests/classes/cde-login.pp class cde-login { service { cde-login: ensure => ''svcadm disable cde-login'', } } Nothing happens on the client - clearly something is amiss. Am I doing something obviously wrong? I can certainly manually run ''svcadm disable cde-login'' as root and watch X rather dramatically stop working on my test machine (grin). Brian Dunbar Systems Administrator Plexus Desk: (920) 751-3364 Cell: (920) 716-2027
On Oct 30, 2007, at 5:46 PM, McLeod, Matt wrote:> class cde-login { > service { cde-login: > ensure => ''stopped'' > } > }You might also want to add enable => false. -- The great aim of education is not knowledge but action. -- Herbert Spencer --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Thanks - that works quite nicely. Brian Dunbar Systems Administrator Plexus Desk: (920) 751-3364 Cell: (920) 716-2027 -----Original Message----- From: puppet-users-bounces@madstop.com on behalf of McLeod, Matt Sent: Tue 10/30/2007 5:46 PM To: Puppet User Discussion Subject: Re: [Puppet-users] Newb to puppet - Solaris svcadm question You just want: class cde-login { service { cde-login: ensure => ''stopped'' } } Because Puppet knows about SMF and will handle things neatly. Matt -----Original Message----- From: puppet-users-bounces@madstop.com [mailto:puppet-users-bounces@madstop.com] On Behalf Of Brian Dunbar Sent: Wednesday, 31 October 2007 8:10 AM To: Puppet-users@madstop.com Subject: [Puppet-users] Newb to puppet - Solaris svcadm question I''m new to puppet so this might be a foolish question. I''m using Solaris 10, server is Sparc, my client is x86. I created a ''file chown'' manifest as a test ... /etc/puppet/manifests/classes/puppet.pp class puppet { file { "/etc/puppet.txt": owner => "root", group => "root", mode => 440, } } that Just Works when the client runs puppet puppetd --verbose --logdest /tmp/p.log --server co-web-989 notice: Starting Puppet client version 0.22.1 info: Config is up to date notice: Starting configuration run notice: //default/puppet/File[/etc/puppet.txt]/owner: owner changed ''brian'' to ''root'' notice: Finished configuration run in 0.22 seconds Rockin! However for a ''real world'' demo what I''d like to do is create a manifest to shut down X Windows on my various and sundry servers. Why? Because that''s the way we roll. Also because SOX standards tell us we have to. /etc/puppet/manifests/classes/cde-login.pp class cde-login { service { cde-login: ensure => ''svcadm disable cde-login'', } } Nothing happens on the client - clearly something is amiss. Am I doing something obviously wrong? I can certainly manually run ''svcadm disable cde-login'' as root and watch X rather dramatically stop working on my test machine (grin). Brian Dunbar Systems Administrator Plexus Desk: (920) 751-3364 Cell: (920) 716-2027 _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
This is probably in the FM but is there a diff for puppet between ''stopped'' and "stopped" I note that some of the recipies use the latter but the former appears to work as well. Brian Dunbar Systems Administrator Plexus Desk: (920) 751-3364 Cell: (920) 716-2027 -----Original Message----- From: puppet-users-bounces@madstop.com on behalf of Luke Kanies Sent: Wed 10/31/2007 10:26 AM To: Puppet User Discussion Subject: Re: [Puppet-users] Newb to puppet - Solaris svcadm question On Oct 30, 2007, at 5:46 PM, McLeod, Matt wrote:> class cde-login { > service { cde-login: > ensure => ''stopped'' > } > }You might also want to add enable => false. -- The great aim of education is not knowledge but action. -- Herbert Spencer --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Oct 31, 2007, at 10:47 AM, Brian Dunbar wrote:> This is probably in the FM but is there a diff for puppet between > > ''stopped'' > and > "stopped" > > I note that some of the recipies use the latter but the former > appears to work as well.Quoting in Puppet follows the same rules as just about every other Unixy language -- double quotes allow variable interpolation, single quotes don''t. So, for strings with no escapes or variables, there''s no difference. Note that Puppet doesn''t actually require that you quote this word, although the style guide recommends it. -- The salesman asked me what size I wore, I told him extra-medium. -- Stephen Wright --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
David Schmitt
2007-Oct-31 17:35 UTC
Variable interpolation (was: Re: Newb to puppet - Solaris svcadm question)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 31 October 2007, Brian Dunbar wrote:> This is probably in the FM but is there a diff for puppet between > > ''stopped'' > and > "stopped"No, but as in other scripting languages ''$foo'' will be the value DOLLAR-EFF-OH-OH, while "$foo" will be interpreted as the value of the variable foo. Regards, David - -- The primary freedom of open source is not the freedom from cost, but the free- dom to shape software to do what you want. This freedom is /never/ exercised without cost, but is available /at all/ only by accepting the very different costs associated with open source, costs not in money, but in time and effort. - -- http://www.schierer.org/~luke/log/20070710-1129/on-forks-and-forking -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHKLzg/Pp1N6Uzh0URAj82AJ9m7BZdz79LR/mSZ/uE6VeEN/PiwwCgihhg 4V73mTSw/P5dLITNQHjevXY=ZbP4 -----END PGP SIGNATURE-----