Hey thanks for the new version, but I seem to be having some troubles.
I have a number of schedules defined in my configuration, something like:
schedule { once_a_day:
period => daily,
repeat => 1,
}
Using 0.20.0 of the server I get:
err: Could not retrieve configuration: Duplicate definition:
schedule[once_a_day] is already defined in file
/etc/puppet/manifests/schedules.pp at line 7; cannot redefine in file
/etc/puppet/manifests/schedules.pp at line 7
(Line 7 is the end of my first schedule in schedules.pp)
Am I using a depreciated form for defining schedules?
-r''
_______________________________________________
Puppet-users mailing list
Puppet-users@madstop.com
https://mail.madstop.com/mailman/listinfo/puppet-users
RijilV wrote:> Hey thanks for the new version, but I seem to be having some troubles. > > I have a number of schedules defined in my configuration, something like: > > schedule { once_a_day: > period => daily, > repeat => 1, > } > > > Using 0.20.0 of the server I get: > > err: Could not retrieve configuration: Duplicate definition: > schedule[once_a_day] is already defined in file > /etc/puppet/manifests/schedules.pp at line 7; cannot redefine in file > /etc/puppet/manifests/schedules.pp at line 7 > > (Line 7 is the end of my first schedule in schedules.pp) > > Am I using a depreciated form for defining schedules?Are you importing the same file twice or something? Puppet should catch that, but I can''t imagine what else is happening. I don''t have any problems with that simple schedule defined in a file. I''m going to be out of town for the next few days with spotty ''net access (I''ll be at RubyConf), but if you can send me more information I can try to figure out what''s happening. -- I have lost friends, some by death... others through sheer inability to cross the street. -- Virginia Woolf --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
So okay, I did some more testing and this is what I found out. This
problem (for me at least) seems to be with the import command. I
think the best way is to give some examples.
This works:
In file site.pp :
--------------------------
node default {
}
schedule { ''foo'' :
period => daily,
range => "2-4",
repeat => 1,
}
schedule { ''bar'' :
period => weekly,
range => "2-4",
repeat => 1,
}
case $hostname {
localhost: { $myvar = ''blark'' }
bar: { $myvar = ''test'' }
}
--------------------------
However, the following example does not work when I put the different
parts in separate files:
In file site.pp:
------------------------
import "servervars.pp"
import "schedules.pp"
node default {
}
-------------------------
in file servervars.pp:
-------------------------
case $hostname {
localhost: { $myvar = ''blark'' }
bar: { $myvar = ''test'' }
}
--------------------------
And in file schedules.pp:
-------------------------
schedule { ''foo'' :
period => daily,
range => "2-4",
repeat => 1,
}
schedule { ''bar'' :
period => weekly,
range => "2-4",
repeat => 1,
}
----------------------------
When I run puppet I get:
"Cannot reassign variable myvar in file
/etc/puppet/manifests/servervars.pp at line 2"
If I remove the import servervars.pp I get:
"Duplicate definition: schedule[foo] is already defined in file
/etc/puppet/manifests/schedules.pp at line 5; cannot redefine in file
/etc/puppet/manifests/schedules.pp at line 5"
There are strace''s of the no imports and of the importing just he
schedules.pp located at:
https://riji.lv/puppet/
Also include are the manifests that generated them. Thanks for taking
a look at this, but enjoy yourself at the conference - this can all
wait...
-r''
RijilV wrote:> So okay, I did some more testing and this is what I found out. This > problem (for me at least) seems to be with the import command. I > think the best way is to give some examples.[SNIP]> Also include are the manifests that generated them. Thanks for taking > a look at this, but enjoy yourself at the conference - this can all > wait...As mentioned in the other related thread, I''ll fix this bug ASAP, but you can trivially work around it by moving your schedules into a class and then including that class in your site.pp file. -- Meeting, n.: An assembly of people coming together to decide what person or department not represented in the room must solve a problem. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com