joel johnston
2012-Dec-20 01:16 UTC
[Puppet Users] Changing Agent Environment Via Custom Fact
It is very likely that I don''t completely understand the order of operations as they pertain to agent level variables (such as environment,) but I''m not seeing where this should be a problem. What I''m Trying To Do: Set environment on a host by setting a custom fact. How I''m trying to achieve this: I have a custom module that parses ec2 user data value pairs into facts on a host at instance spin. When I pass environment = whatever, I want that environment value to override the agent''s puppet.conf environment value. I''m trying to achieve this currently with another custom module: require ''facter'' if Facter.value(''environment'') envstring = Facter.value(''environment'') $environment = envstring else envstring = '''' end Please let me know if this is just way off base including any way this might be possible. Thanks In Advance, Joel -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Rs7_SN6r9VIJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Why not make puppet.conf.erb and pass it your env-vatiable. But you will need to run puppet agent once more to apply catalog from new env. четверг, 20 декабря 2012 г., 5:16:27 UTC+4 пользователь joel johnston написал:> > It is very likely that I don''t completely understand the order of > operations as they pertain to agent level variables (such as environment,) > but I''m not seeing where this should be a problem. > > What I''m Trying To Do: Set environment on a host by setting a custom fact. > > How I''m trying to achieve this: I have a custom module that parses ec2 > user data value pairs into facts on a host at instance spin. When I pass > environment = whatever, I want that environment value to override the > agent''s puppet.conf environment value. I''m trying to achieve this > currently with another custom module: > > require ''facter'' > if Facter.value(''environment'') > envstring = Facter.value(''environment'') > $environment = envstring > else > envstring = '''' > end > > Please let me know if this is just way off base including any way this > might be possible. > > Thanks In Advance, > > Joel >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Tzun-cCilFsJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.