I ended up getting this syntax to work:
Here is the class calling the define:
2 class supervisor {
...
13 exec{"install supervisor":
...
32
33 # running 'init a' will start supervisord -- should be called at
the end of /etc/init.d/Indeed to start tomcats after slaving/caching
34 inittab::conf{"supervisor":
35 id => 'supe',
36 runlevels => 'a',
37 action => 'respawn',
38 process => '/usr/local/bin/supervisord -n',
39 require => Exec["install supervisor"],
40 }
Here is the inittab module with the define:
1 # generic class to allow /etc/inittab management
2 class inittab {
3 define conf (
4 $id,
5 $runlevels = '123456',
6 $action = 'respawn',
7 $process
8 ) {
9
10 augeas {"inittab_$id":
11 context => "/files/etc/inittab",
12 force => "true",
13 require => $require,
14 changes => [
15 "set $id/runlevels $runlevels",
16 "set $id/action $action",
17 "set $id/process $process",
18 ],
19 }
20 }
21
22 }
On Fri, Aug 6, 2010 at 6:21 PM, Jason Koppe <[email protected]>wrote:
> If you just mean this:
>
> 1 # generic class to allow /etc/inittab management
> 2 class inittab {
> 3 define conf (
> 4 $id,
> 5 $runlevels = '123456',
> 6 $action = 'respawn',
> 7 $process
> 8 ) {
> 9 $require
> 10
> 11 augeas {"inittab_$id":
> 12 context => "/files/etc/inittab",
> 13 changes => [
> 14 "set $id/runlevels $runlevels",
> 15 "set $id/action $action",
> 16 "set $id/process $process",
> 17 ],
> 18 }
> 19 }
> 20
> 21 }
>
>
> Now, I'm getting this error:
> err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Could not parse for environment jkoppe: Syntax error at 'augeas'; expected
> '}' at
> /home/jkoppe/svn/production/puppet/modules/inittab/manifests/init.pp:11 on
> node indtst5
>
>
>
> On Fri, Aug 6, 2010 at 6:13 PM, Jason Koppe
> <[email protected]>wrote:
>
>> I'm having similar problems, should it be:
>>
>> class inittab {
>> define conf (
>> $id,
>> $runlevels = '123456',
>> $action = 'respawn',
>> $process
>> ) {
>> $require {
>> $require
>> }
>>
>> augeas {"inittab_$id":
>> context => "/files/etc/inittab",
>> changes => [
>> "set $id/runlevels $runlevels",
>> "set $id/action $action",
>> "set $id/process $process",
>> ],
>>
>>
>> }
>> }
>>
>> }
>>
>> With that, I get:
>> err: Could not retrieve catalog from remote server: Error 400 on SERVER:
>> Could not parse for environment jkoppe: Syntax error at '{'; expected '}' at
>> /home/jkoppe/svn/production/puppet/modules/inittab/manifests/init.pp:10 on
>> node indtst5
>>
>>
>> On Mon, Jul 12, 2010 at 6:48 AM, Tim <[email protected]> wrote:
>>
>>> Thanks, that fixed it.
>>>
>>> On Jul 9, 5:10 pm, Alan Barrett <[email protected]> wrote:
>>> > On Fri, 09 Jul 2010, Tim wrote:
>>> > > # Generic config file
>>> > > define config-file ($fullpath, $source) {
>>> > > if $require {
>>> > > require $require
>>> > > }
>>> > > file { $fullpath:
>>> > > source =>
>>> > > "puppet://puppet.hq.eso.org/modules/${source}<http://puppet.hq.eso.org/modules/$%7Bsource%7D>
>>> ",
>>> > > backup => mainbackup,
>>> > > mode => 644,
>>> > > ensure => file,
>>> > > group => root,
>>> > > owner => root
>>> > > }
>>> > > }
>>> >
>>> > Just delete the "if" statement and the explicit "require" statement,
>>> and
>>> > the right thing should happen. Any "require" passed to your definition
>>> > should propagate to the "file" resource insuide the definition
>>> > automatically.
>>> >
>>> > --apb (Alan Barrett)
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Puppet Users" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<puppet-users%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/puppet-users?hl=en.
>>>
>>>
>>
>>
>> --
>> Jason Koppe
>> [email protected]
>> Cell (210) 445-8242
>>
>
>
>
> --
> Jason Koppe
> [email protected]
> Cell (210) 445-8242
>
--
Jason Koppe
[email protected]
Cell (210) 445-8242
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.