Hello, The more complicated my puppet scripts gets, the more ordering issue i meet. Here is a simple thing: I use a default backup policy for the nodes in my backup classe and then, in the node i try to override the defined default but even if they are done one after the other i got an error to say that the override is triggered before the default: include backup Backupset[''myserver-backup''] { inclure => "[''/etc'', ''/usr/local/etc'']", exclure => "[''/tmp'', ''/var/tmp'', ''/var/log'', ''/proc'']", retention => ''4'', rsyncversion => ''29+'' } and i got: err: Could not retrieve configuration: Parameter exclure is already set on Backupset[myserver-backup] by myserver at /etc/puppet/manifests/./os/vpsv2.pp:43 i have to create a new class for each node that inherits the backup class where i override the Backupset and this just feel strange to me as the include should setup the Backupset and then i should be able to override it (this is what "seems"(tm) logical to me ) :) how can this ressource be set with the override syntax if the overrided one does not exist yet ? I would have expected an error if puppet see the ressources in this order but not a message saying the ressource is allready having the parameter xxx setup :) i had the same issue of ordering things with the tag() function and i wanted to know how any of you solve those issues about ordering things in puppet ? -- Cordialement, Ghislain _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
from the test i made it seems that overriding a defined type that contain virtual ressource does not ovveride them. I have define backupset( $periode=''1'', $rsyncversion=''29+'', $retention=''4'', $utilisateurbackup=''aqbackup'', $blackout=''1-6'', $backupshare="[''/'']", $mainhostname=''none'', $inclure="[''/etc'', ''/usr/local/etc'']", $exclure = "[''/tmp'', ''/var/tmp'', ''/var/log'', ''/proc'', ''/dev'',''/home/*/.spamassassin/bayes*'']", $administrateur= ''me'', $utilisateurs='' '' ) { $sdl = " " @@file { "/etc/BackupPC/serveurs/$fqdn": content => "$fqdn 0 $administrateur $utilisateurs $sdl", owner => backuppc, group => www-data, mode => 640 } } and if i overide $utilisateurs with Backupset[''blah''] { utilisateurs => ''otherman'' } it does not seem to work . If i replace by a template with the very same content (in erb syntax) it works. @@file { "/etc/BackupPC/serveurs/$fqdn": content => template("/var/puppet/templates/backuphost.pl"), owner => backuppc, group => www-data, mode => 640 } works ok. -- Cordialement, Ghislain ADNET. AQUEOS. Attention ! Toute demande de support ou commande de domaine par email sera refusée, pour cela utilisez https://support.aqueos.net. Pour tout contact nos coordonnées : http://www.aqueos.com/aqueos-services-informatiques-societe.php Fax: 01.72.70.32.66 _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Feb 14, 2007, at 3:39 AM, ADNET Ghislain wrote:> Hello, > > The more complicated my puppet scripts gets, the more ordering > issue i meet. Here is a simple thing:The two emails you''ve sent on this topic are not actually ordering issues, they''re more scoping issues. I would probably agree that this aspect of the parser does not behave as well as it should.> I use a default backup policy for the nodes in my backup classe > and then, in the node i try to override the defined default but > even if they are done one after the other i got an error to say > that the override is triggered before the default: > > > include backup > Backupset[''myserver-backup''] { > inclure => "[''/etc'', ''/usr/local/etc'']", > exclure => "[''/tmp'', ''/var/tmp'', ''/var/ > log'', ''/proc'']", > retention => ''4'', > rsyncversion => ''29+'' > } > > and i got: > > err: Could not retrieve configuration: Parameter exclure is already > set on Backupset[myserver-backup] by myserver at /etc/puppet/ > manifests/./os/vpsv2.pp:43 > > i have to create a new class for each node that inherits the backup > class where i override the Backupset and this just feel strange to > me as the include should setup the Backupset and then i should be > able to override it (this is what "seems"(tm) logical to me ) :)I''d need to see more of your code to understand what''s happening here. If the backupset instance is defined in the ''backup'' class, then you shouldn''t be able to override it unless you''re in a subclass of that class.> how can this ressource be set with the override syntax if the > overrided one does not exist yet ? I would have expected an error > if puppet see the ressources in this order but not a message saying > the ressource is allready having the parameter xxx setup :)Overrides are very late-binding; they only get evaluated when the resource is evaluated as a defined type or when the resource is about to get sent to the client. It''s done this way specifically to avoid ordering issues.> i had the same issue of ordering things with the tag() function and > i wanted to know how any of you solve those issues about ordering > things in puppet ?Tags are explicitly file-ordered, which I agree is a bug but I have no idea how to fix it. I expect the closest we''ll come to solving this is the node-mapping application discussed on the dev list, which will provide a list of tags that will be set before the configuration is parsed at all. I have no timeline on getting this done, though. -- Sabbagh''s Second Law: The biggest problem with communication is the illusion that it has occurred. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On Feb 14, 2007, at 7:41 AM, ADNET Ghislain wrote:> > [...] > and if i overide $utilisateurs with > > Backupset[''blah''] { > utilisateurs => ''otherman'' > } > > > it does not seem to work . If i replace by a template with the > very same content (in erb syntax) it works. > > > @@file { "/etc/BackupPC/serveurs/$fqdn": > content => template("/var/ > puppet/templates/backuphost.pl"), > owner => backuppc, > group => www-data, > mode => 640 > } > > > works ok.I don''t really understand what you''re saying here. You''ve got a definition that creates an exported resource. You''re saying you cannot override that definition; can you define "does not seem to work" here? Do you get an error, or does it just fail? Can you reproduce the problem using virtual resources in a simple configuration? When you say that changing to a template makes it "work", can you explain? There''s something that I''m missing entirely here. I don''t know what problem you''re having. -- Think twice before you speak, and then you may be able to say something more insulting than if you spoke right out at once. - Evan Esar --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
By the way, in trying to reproduce some of the problems you were having, I found that virtual defined resources and definitions wrapping virtual resources (which are syntactically equivalent to exported resources) did not work as I expect. I just committed some code that revamps it considerably and should work better. At this point, I would not be surprised if you could not get desired behaviour with definitions wrapping exported resources. -- Q: How many surrealists does it take to screw in a lightbulb? A: Two. One to hold the giraffe and the other to fill the bathtub with brightly colored machine tools. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
> You''ve got a definition that creates an exported resource. You''re > saying you cannot override that definition; can you define "does not > seem to work" here? Do you get an error, or does it just fail? Can > you reproduce the problem using virtual resources in a simple > configuration? > > When you say that changing to a template makes it "work", can you > explain? >yes sorry my explanation is not clear. When i override the @@file it does not override the ''content'' of it if the content is a simple string like "$utilisateurs". If i replace the string by template() the template used being the very same thing (ie <%= utilisateurs %> ) then the overriding works. so having content => "$utilisateurs" or content => template(bmah) does not provide the same result when you override the ressource (it works as espected when you just set the ressource, this is a problem in overriding it). The second is overriden correctly and the first is not. -- Cordialement, Ghislain _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Feb 16, 2007, at 12:51 AM, ADNET Ghislain wrote:> > yes sorry my explanation is not clear. When i override the @@file > it does not override the ''content'' of it if the content is a simple > string like "$utilisateurs". If i replace the string by template() > the template used being the very same thing (ie <%= utilisateurs % > > ) then the overriding works. so having content => "$utilisateurs" > or content => template(bmah) does not provide the same result when > you override the ressource (it works as espected when you just set > the ressource, this is a problem in overriding it). The second is > overriden correctly and the first is not.Can you send the code for a functional version and a version that does not behave as you expect? -- Once...in the wilds of Afghanistan, I lost my corkscrew, and we were forced to live on nothing but food and water for days. -- W. C. Fields --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com