Hi all, I’m exploring puppet for first time, trying to see if I can simplify my sysadmin tasks. So I decided to install it on FreeBSD 7 beta 3 and play with it, using another host as a server (Debian 4). As you can imagine I’m stuck. Here’s an excerpt of my super trivial manifest file:> node ''puppetclient.refactor.it'' { > package { > apache20: > ensure => present, > provider => freebsd, > } > service { > apache2: > provider => freebsd, > ensure => running, > } > }however, when I invoke puppet I get this error:> Could not create apache2: Parameter provider failed: Invalid service > provider ''freebsd''.According to the wiki you should not specify this parameter but it fails anyway, with a different error:> warning: Found multiple default providers for service: init, base; > using init > […] > change from stopped to running failed: Could not find init script > for ''apache2''Any clues? Is this problem caused by the version of the OS? Thank you in advance -- Giorgio Valoti
Giorgio Valoti wrote:> Hi all, > I’m exploring puppet for first time, trying to see if I can simplify > my sysadmin tasks. So I decided to install it on FreeBSD 7 beta 3 and > play with it, using another host as a server (Debian 4). > > As you can imagine I’m stuck. Here’s an excerpt of my super trivial > manifest file: >> node ''puppetclient.refactor.it'' { >> package { >> apache20: >> ensure => present, >> provider => freebsd, >> } >> service { >> apache2: >> provider => freebsd, >> ensure => running, >> } >> } > > however, when I invoke puppet I get this error: >> Could not create apache2: Parameter provider failed: Invalid service >> provider ''freebsd''. > > According to the wiki you should not specify this parameter but it > fails anyway, with a different error: >> warning: Found multiple default providers for service: init, base; >> using init >> […] >> change from stopped to running failed: Could not find init script >> for ''apache2'' > > Any clues? Is this problem caused by the version of the OS? >The error is correct. There is no FreeBSD service provider in the current release. I''ve opened a ticket with a patch for a basic one that supports enabling. The init script''s name is derived from the service''s title, and the apache20 port installs the init script under ''/usr/local/etc/rc.d/apache20''. You''ll need to change the service name to ''apache20''. Additionally, the init provider only looks under /etc/rc.d by default. You''ll have to add ''/usr/local/etc/rc.d'' to the search path: Service { path => [ ''/etc/rc.d'', ''/usr/local/etc/rc.d'' ] } I''ve also submitted a patch to make that the default. -- Russell A. Jackson <raj@csub.edu> Network Analyst California State University, Bakersfield QOTD: "Every morning I read the obituaries; if my name''s not there, I go to work." _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On 29/nov/07, at 23:27, Russell Jackson wrote:> Giorgio Valoti wrote: >> Hi all, >> I’m exploring puppet for first time, trying to see if I can simplify >> my sysadmin tasks. So I decided to install it on FreeBSD 7 beta 3 and >> play with it, using another host as a server (Debian 4). >> >>> […] >> >> Any clues? Is this problem caused by the version of the OS? >> > > The error is correct. There is no FreeBSD service provider in the > current release. I''ve > opened a ticket with a patch for a basic one that supports enabling.I see. I’m using the puppet-devel-0.23.2 port, not puppet-0.22.4. Is the freebsd provider supported in the 0.22 release?> > > The init script''s name is derived from the service''s title, and the > apache20 port installs > the init script under ''/usr/local/etc/rc.d/apache20''. You''ll need to > change the service > name to ''apache20''. Additionally, the init provider only looks > under /etc/rc.d by default. > You''ll have to add ''/usr/local/etc/rc.d'' to the search path: > > Service { path => [ ''/etc/rc.d'', ''/usr/local/etc/rc.d'' ] }That’s cool. Later today I’ll try your suggestions. Thank you Ciao -- Giorgio Valoti
Giorgio Valoti wrote:> On 29/nov/07, at 23:27, Russell Jackson wrote: > >> Giorgio Valoti wrote: >>> Hi all, >>> I’m exploring puppet for first time, trying to see if I can simplify >>> my sysadmin tasks. So I decided to install it on FreeBSD 7 beta 3 and >>> play with it, using another host as a server (Debian 4). >>> >>>> […] >>> Any clues? Is this problem caused by the version of the OS? >>> >> The error is correct. There is no FreeBSD service provider in the >> current release. I''ve >> opened a ticket with a patch for a basic one that supports enabling. > > I see. I’m using the puppet-devel-0.23.2 port, not puppet-0.22.4. Is > the freebsd provider supported in the 0.22 release?Neither port has a freebsd specific provider.> >> >> The init script''s name is derived from the service''s title, and the >> apache20 port installs >> the init script under ''/usr/local/etc/rc.d/apache20''. You''ll need to >> change the service >> name to ''apache20''. Additionally, the init provider only looks >> under /etc/rc.d by default. >> You''ll have to add ''/usr/local/etc/rc.d'' to the search path: >> >> Service { path => [ ''/etc/rc.d'', ''/usr/local/etc/rc.d'' ] } > > That’s cool. Later today I’ll try your suggestions. > > Thank you > > > Ciao > -- > Giorgio Valoti > > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users-- Russell A. Jackson <raj@csub.edu> Network Analyst California State University, Bakersfield Death before dishonor. But neither before breakfast.
On 30/nov/07, at 09:14, Russell Jackson wrote:>> […] >> I see. I’m using the puppet-devel-0.23.2 port, not puppet-0.22.4. Is >> the freebsd provider supported in the 0.22 release? > > Neither port has a freebsd specific provider.:-/ I’m pretty sure that I’ve read something about a freebsd provider on the wiki but i’m unable to find it right now. Maybe I just some more sleep ;-) Ciao -- Giorgio Valoti
On 30/11/2007, Giorgio Valoti <giorgio_v@mac.com> wrote:> :-/ I''m pretty sure that I''ve read something about a freebsd provider > on the wiki but i''m unable to find it right now. Maybe I just some > more sleep ;-)There''s a freebsd package provider but no a freebsd service provider.
On 30/nov/07, at 19:54, ben wrote:> On 30/11/2007, Giorgio Valoti <giorgio_v@mac.com> wrote: >> :-/ I''m pretty sure that I''ve read something about a freebsd provider >> on the wiki but i''m unable to find it right now. Maybe I just some >> more sleep ;-) > > There''s a freebsd package provider but no a freebsd service provider.Are you sure? <http://reductivelabs.com/trac/puppet/wiki/TypeReference#service> -- Giorgio Valoti
On 29/nov/07, at 23:27, Russell Jackson wrote:>> […] > > The error is correct. There is no FreeBSD service provider in the > current release. I''ve > opened a ticket with a patch for a basic one that supports enabling. > […] > You''ll have to add ''/usr/local/etc/rc.d'' to the search path: > > Service { path => [ ''/etc/rc.d'', ''/usr/local/etc/rc.d'' ] }It works! But now I’m puzzled again. If I add: ensure => false shouldn’t apache get stopped? I also haven’t found a way to enable apache at the /etc/rc.conf level. My “solution” was something like this: file { "rc-conf": … } service { apache2: subscribe => File[rc-conf] … } But it seems far from ideal because, every time I edit rc.conf, apache gets restarted. Am I right? -- Giorgio Valoti
On 30/11/2007, Giorgio Valoti <giorgio_v@mac.com> wrote:> > > There''s a freebsd package provider but not a freebsd service provider. > > Are you sure? > <http://reductivelabs.com/trac/puppet/wiki/TypeReference#service>Ah, so there is. But it''s not in 0.23.2.
Giorgio Valoti wrote:> On 29/nov/07, at 23:27, Russell Jackson wrote: > >>> […] >> The error is correct. There is no FreeBSD service provider in the >> current release. I''ve >> opened a ticket with a patch for a basic one that supports enabling. >> […] >> You''ll have to add ''/usr/local/etc/rc.d'' to the search path: >> >> Service { path => [ ''/etc/rc.d'', ''/usr/local/etc/rc.d'' ] } > > It works! But now I’m puzzled again. If I add: > > ensure => falseThat should stop it. You may need to have hasstatus => true.> > shouldn’t apache get stopped? > I also haven’t found a way to enable apache at the /etc/rc.conf level. > My “solution” was something like this: > file { "rc-conf": … } > service { > apache2: subscribe => File[rc-conf] > … > } > But it seems far from ideal because, every time I edit rc.conf, apache > gets restarted. Am I right? >Like I said before, the release version of puppet doesn''t have a freebsd specific service provider, so it uses the basic init provider which doesn''t support enabling the service (see http://reductivelabs.com/trac/puppet/ticket/880) You can work around this limitation with something like: file { "/etc/rc.conf.d": ensure => directory } file { "/etc/rc.conf.d/apache20": ensure => present, content => "apache20_enable=\"YES\"" } This way puppet doesn''t interfere with the rest of /etc/rc.conf. Remember, under the FreeBSD init system, the <service>_enable="YES" line must be present in order to start _OR_ stop the service. So, if you remove the enable line first, and then try ''/usr/local/etc/rc.d/apache20 stop'', nothing will happen. You can use onestart/onestop to get around that too, but then you''ll have to override the stop and start commands in all your service definitions; hence, the patch in ticket #880 ;-). -- Russell A. Jackson <raj@csub.edu> Network Analyst California State University, Bakersfield QOTD: "Every morning I read the obituaries; if my name''s not there, I go to work." _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On 01/dic/07, at 03:02, Russell Jackson wrote:> Giorgio Valoti wrote: >> On 29/nov/07, at 23:27, Russell Jackson wrote: >> >>>> […] >> >> It works! But now I’m puzzled again. If I add: >> >> ensure => false > > That should stop it. You may need to have hasstatus => true.Now it works fine.> >> >> […] >> > > Like I said before, the release version of puppet doesn''t have a > freebsd specific service > provider, so it uses the basic init provider which doesn''t support > enabling the service > (see http://reductivelabs.com/trac/puppet/ticket/880) > > You can work around this limitation with something like: > > file { "/etc/rc.conf.d": ensure => directory } > > file { "/etc/rc.conf.d/apache20": > ensure => present, > content => "apache20_enable=\"YES\"" > } > > This way puppet doesn''t interfere with the rest of /etc/rc.conf. > > Remember, under the FreeBSD init system, the <service>_enable="YES" > line must be present > in order to start _OR_ stop the service. So, if you remove the > enable line first, and then > try ''/usr/local/etc/rc.d/apache20 stop'', nothing will happen. You > can use onestart/onestop > to get around that too, but then you''ll have to override the stop > and start commands in > all your service definitions; hence, the patch in ticket #880 ;-).You’re right. I’ll take a look at your patch to see how it works. Thank you -- Giorgio Valoti