[Puppet Users] Re: Starting a (SMF) service on Solaris with Puppet

2009-05-06 Thread Don Jackson


On May 6, 2009, at 6:47 PM, Jim Pirzyk wrote:

> I believe you do not need
>
>   start => true
>
> you may need to set the name though:
>
>   name => 'svc:/network/postfix:default'
>
> unless 'svcadm enable postfix' works as is (I do not have postfix on  
> my servers, but I can do 'svcadm enable smtp'
>
> The enable => true means to execute the 'svcadm enable $name'

I implemented both your suggestions, and it worked!

Thank you!

Don

>>
>> Hello,
>>
>> I am a puppet newbie, I got a puppetmaster running on my network, and
>> puppetd is installed and run on new servers.
>>
>> I am trying to get puppet to start postfix on a Solaris server.
>>
>> The postfix package was previously installed (via jumpstart).
>>
>> When the system first comes up, if I type
>>
>>  svcadm enable svc:/network/postfix:default
>>
>> then postfix starts and runs fine.  But I want puppet to do that for
>> me automatically.
>>
>> Here is what I put in my manifest file:
>>
>> file { "password":
>>name => "/etc/passwd",
>>owner => "root",
>>group => $operatingsystem ? {
>>  OpenBSD => "wheel",
>>  Solaris => "sys",
>>},
>>mode => 644,
>> }
>>
>> node 'solaristest.clark-communications.com' {
>> service { "postfix":
>> enable => "true",
>> start => "true",
>> ensure => "running",
>> }
>> }
>>
>> But that doesn't seem to work, here is what puppetd says:
>>
>> /opt/csw/bin/puppetd --no-daemonize --debug
>> debug: Creating default schedules
>> debug: Failed to load library 'shadow' for feature 'libshadow'
>> debug: Failed to load library 'ldap' for feature 'ldap'
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
>> File[/
>> etc/opt/csw/puppet/ssl/public_keys]: Autorequiring File[/etc/opt/csw/
>> puppet/ssl]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[main]/
>> File[/var/opt/csw/puppet/lib]: Autorequiring File[/var/opt/csw/ 
>> puppet]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[main]/
>> File[/etc/opt/csw/puppet/ssl]: Autorequiring File[/etc/opt/csw/ 
>> puppet]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
>> File[/
>> etc/opt/csw/puppet/ssl/private_keys/solaristest.clark-
>> communications.com.pem]: Autorequiring File[/etc/opt/csw/puppet/ssl/
>> private_keys]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
>> File[/
>> etc/opt/csw/puppet/ssl/certs]: Autorequiring File[/etc/opt/csw/ 
>> puppet/
>> ssl]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[puppetd]/
>> File[/var/opt/csw/puppet/state/classes.txt]: Autorequiring File[/var/
>> opt/csw/puppet/state]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
>> File[/
>> etc/opt/csw/puppet/ssl/private]: Autorequiring File[/etc/opt/csw/
>> puppet/ssl]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
>> File[/
>> etc/opt/csw/puppet/ssl/private_keys]: Autorequiring File[/etc/opt/ 
>> csw/
>> puppet/ssl]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[puppetd]/
>> File[/var/opt/csw/puppet/state/state.yaml]: Autorequiring File[/var/
>> opt/csw/puppet/state]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[main]/
>> File[/var/opt/csw/puppet/state]: Autorequiring File[/var/opt/csw/ 
>> puppet]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[main]/
>> File[/var/opt/csw/puppet/log]: Autorequiring File[/var/opt/csw/ 
>> puppet]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
>> File[/
>> etc/opt/csw/puppet/ssl/certs/solaristest.clark-
>> communications.com.pem]: Autorequiring File[/etc/opt/csw/puppet/ssl/
>> certs]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[main]/
>> File[/var/opt/csw/puppet/run]: Autorequiring File[/var/opt/csw/ 
>> puppet]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
>> File[/
>> etc/opt/csw/puppet/ssl/certs/ca.pem]: Autorequiring File[/etc/opt/ 
>> csw/
>> puppet/ssl/certs]
>> debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[puppetd]/
>> File[/etc/opt/csw/puppet/puppet.conf]: Autorequiring File[/etc/opt/ 
>> csw/
>> puppet]
>> debug: Finishing transaction 69170270 with 0 changes
>> notice: Starting Puppet client version 0.24.8
>> debug: Loaded state in 0.00 seconds
>> debug: Retrieved facts in 3.09 seconds
>> debug: Retrieving catalog
>> debug: Calling puppetmaster.getconfig
>> debug: Retrieved catalog in 0.35 seconds
>> debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update
>> does not exist
>> debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-
>> rc.d does not exist
>> debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does  
>> not
>> exist
>> debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc
>> does not exist
>> debug: Puppet::Type::Service::ProviderRedhat: file /sbin/service does
>> not exist
>> debug: Puppet::Type::Servic

[Puppet Users] Re: Starting a (SMF) service on Solaris with Puppet

2009-05-06 Thread Jim Pirzyk

I believe you do not need

start => true

you may need to set the name though:

name => 'svc:/network/postfix:default'

unless 'svcadm enable postfix' works as is (I do not have postfix on  
my servers, but I can do 'svcadm enable smtp'


The enable => true means to execute the 'svcadm enable $name'

- JimP

On May 6, 2009, at 9:36 PM, Don Jackson wrote:



Hello,

I am a puppet newbie, I got a puppetmaster running on my network, and
puppetd is installed and run on new servers.

I am trying to get puppet to start postfix on a Solaris server.

The postfix package was previously installed (via jumpstart).

When the system first comes up, if I type

svcadm enable svc:/network/postfix:default

then postfix starts and runs fine.  But I want puppet to do that for
me automatically.

Here is what I put in my manifest file:

file { "password":
 name => "/etc/passwd",
 owner => "root",
 group => $operatingsystem ? {
   OpenBSD => "wheel",
   Solaris => "sys",
 },
 mode => 644,
}

node 'solaristest.clark-communications.com' {
  service { "postfix":
  enable => "true",
  start => "true",
  ensure => "running",
  }
}

But that doesn't seem to work, here is what puppetd says:

/opt/csw/bin/puppetd --no-daemonize --debug
debug: Creating default schedules
debug: Failed to load library 'shadow' for feature 'libshadow'
debug: Failed to load library 'ldap' for feature 'ldap'
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
File[/

etc/opt/csw/puppet/ssl/public_keys]: Autorequiring File[/etc/opt/csw/
puppet/ssl]
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[main]/
File[/var/opt/csw/puppet/lib]: Autorequiring File[/var/opt/csw/puppet]
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[main]/
File[/etc/opt/csw/puppet/ssl]: Autorequiring File[/etc/opt/csw/puppet]
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
File[/

etc/opt/csw/puppet/ssl/private_keys/solaristest.clark-
communications.com.pem]: Autorequiring File[/etc/opt/csw/puppet/ssl/
private_keys]
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
File[/

etc/opt/csw/puppet/ssl/certs]: Autorequiring File[/etc/opt/csw/puppet/
ssl]
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[puppetd]/
File[/var/opt/csw/puppet/state/classes.txt]: Autorequiring File[/var/
opt/csw/puppet/state]
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
File[/

etc/opt/csw/puppet/ssl/private]: Autorequiring File[/etc/opt/csw/
puppet/ssl]
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
File[/

etc/opt/csw/puppet/ssl/private_keys]: Autorequiring File[/etc/opt/csw/
puppet/ssl]
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[puppetd]/
File[/var/opt/csw/puppet/state/state.yaml]: Autorequiring File[/var/
opt/csw/puppet/state]
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[main]/
File[/var/opt/csw/puppet/state]: Autorequiring File[/var/opt/csw/ 
puppet]

debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[main]/
File[/var/opt/csw/puppet/log]: Autorequiring File[/var/opt/csw/puppet]
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
File[/

etc/opt/csw/puppet/ssl/certs/solaristest.clark-
communications.com.pem]: Autorequiring File[/etc/opt/csw/puppet/ssl/
certs]
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[main]/
File[/var/opt/csw/puppet/run]: Autorequiring File[/var/opt/csw/puppet]
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[ssl]/ 
File[/

etc/opt/csw/puppet/ssl/certs/ca.pem]: Autorequiring File[/etc/opt/csw/
puppet/ssl/certs]
debug: /Settings[/etc//opt/csw/puppet/puppet.conf]/Settings[puppetd]/
File[/etc/opt/csw/puppet/puppet.conf]: Autorequiring File[/etc/opt/ 
csw/

puppet]
debug: Finishing transaction 69170270 with 0 changes
notice: Starting Puppet client version 0.24.8
debug: Loaded state in 0.00 seconds
debug: Retrieved facts in 3.09 seconds
debug: Retrieving catalog
debug: Calling puppetmaster.getconfig
debug: Retrieved catalog in 0.35 seconds
debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update
does not exist
debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-
rc.d does not exist
debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not
exist
debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc
does not exist
debug: Puppet::Type::Service::ProviderRedhat: file /sbin/service does
not exist
debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl
does not exist
debug: Creating default schedules
debug: Finishing transaction 74131070 with 0 changes
info: Caching catalog at /var//opt/csw/puppet/state/localconfig.yaml
notice: Starting catalog run
debug: Loaded state in 0.00 seconds
debug: Puppet::Type::Service::ProviderSmf: Executing '/usr/bin/svcs -l
postfix'
debug: Puppet::Type::Service::ProviderSmf: Exec