Hi there, me again! I´m looking for a solution for the following: I have two (a bunch really..) of services that work together and have to exchange some configinformation between each other. I can get this to work in only one of three cases: 1. Works # class serviceB { file {"serviceBconfig": content => $serviceA::serviceAvar } } # # class serviceA { $serviceAvar = "bull" } # 2. Does not work, error: "Failed to parse template serviceBconfig.erb: Could not find value for 'serviceA' at [....]" class serviceB { file {"serviceBconfig": content =>template("serviceBconfig.erb") } } # # class serviceA { $serviceAvar = "bull" } # #serviceBconfig.erb <%= serviceA::serviceAvar %> # I tried escaping the "::" and stuff but couldn´t get this to work. 3. More of a question than a "not working": How would I get the value of "serviceA::serviaAvar" if the classes are applied on different hosts? This is really simplified as in reality ServiceA and ServiceB configure themselves and each other, the value of serviceAvar is choosen by a switch and all of this is actually happening in a definition as these services have to be instatiable. I´d really appreciate it if you could take a look at this, this is giving me some major headache atm.. Thanks a lot! Simon _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On 21/08/07, Simon Mügge <simu@webde.de> wrote:> Hi there, me again! > > I´m looking for a solution for the following: > > I have two (a bunch really..) of services that work together and have to > exchange some configinformation between each other. I can get this to > work in only one of three cases: > > > 1. Works > # > class serviceB { > file {"serviceBconfig": > content => $serviceA::serviceAvar > } > } > # > > # > class serviceA { > $serviceAvar = "bull" > } > # > > > > 2. Does not work, error: "Failed to parse template serviceBconfig.erb: > Could not find value for ''serviceA'' at [....]" > > class serviceB { > file {"serviceBconfig": > content =>template("serviceBconfig.erb") > } > } > #I think you need to take an in-between step here. Try this: class serviceB { $serviceAvarInB = $serviceA::serviceAvar file { "serviceBconfig": content => template("serviceBconfig.erb") } } with the template like this: #serviceBconfig.erb <%= serviceAvarInB %> # Don''t know if this really works, but it should (I think). Thijs> > # > class serviceA { > $serviceAvar = "bull" > } > # > > #serviceBconfig.erb > <%= serviceA::serviceAvar %> > # > > I tried escaping the "::" and stuff but couldn´t get this to work. > > > > 3. More of a question than a "not working": > How would I get the value of "serviceA::serviaAvar" if the classes are > applied on different hosts? > > > > This is really simplified as in reality ServiceA and ServiceB configure > themselves and each other, the value of serviceAvar is choosen by a > switch and all of this is actually happening in a definition as these > services have to be instatiable. > > > I´d really appreciate it if you could take a look at this, this is > giving me some major headache atm.. > > Thanks a lot! > Simon > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
Thijs Oppermann schrieb:> On 21/08/07, Simon Mügge <simu@webde.de> wrote: > >> Hi there, me again! >> >> I´m looking for a solution for the following: >> >> I have two (a bunch really..) of services that work together and have to >> exchange some configinformation between each other. I can get this to >> work in only one of three cases: >> >> >> 1. Works >> # >> class serviceB { >> file {"serviceBconfig": >> content => $serviceA::serviceAvar >> } >> } >> # >> >> # >> class serviceA { >> $serviceAvar = "bull" >> } >> # >> >> >> >> 2. Does not work, error: "Failed to parse template serviceBconfig.erb: >> Could not find value for ''serviceA'' at [....]" >> >> class serviceB { >> file {"serviceBconfig": >> content =>template("serviceBconfig.erb") >> } >> } >> # >> > > I think you need to take an in-between step here. Try this: > > class serviceB { > $serviceAvarInB = $serviceA::serviceAvar > file { "serviceBconfig": > content => template("serviceBconfig.erb") > } > } > > with the template like this: > > #serviceBconfig.erb > <%= serviceAvarInB %> > # > > Don''t know if this really works, but it should (I think). >Hey, thanks for the reply! Yeah, this of works (there is nothing wrong with the in-puppet function that uses "::", just erb can''t seem to hadle that syntax), but this is not really usefull to me as I have about 20 of these services that configure each other. This would be an OK workaround if I just had two or three services of that kind but its just not useable with that many services :/> Thijs > >Thx, Simon>> # >> class serviceA { >> $serviceAvar = "bull" >> } >> # >> >> #serviceBconfig.erb >> <%= serviceA::serviceAvar %> >> # >> >> I tried escaping the "::" and stuff but couldn´t get this to work. >> >> >> >> 3. More of a question than a "not working": >> How would I get the value of "serviceA::serviaAvar" if the classes are >> applied on different hosts? >> >> >> >> This is really simplified as in reality ServiceA and ServiceB configure >> themselves and each other, the value of serviceAvar is choosen by a >> switch and all of this is actually happening in a definition as these >> services have to be instatiable. >> >> >> I´d really appreciate it if you could take a look at this, this is >> giving me some major headache atm.. >> >> Thanks a lot! >> Simon >> _______________________________________________ >> Puppet-users mailing list >> Puppet-users@madstop.com >> https://mail.madstop.com/mailman/listinfo/puppet-users >> >> > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
On Aug 21, 2007, at 10:11 AM, Simon Mügge wrote:> Yeah, this of works (there is nothing wrong with the in-puppet > function > that uses "::", just erb can''t seem to hadle that syntax), but this is > not really usefull to me as I have about 20 of these services that > configure each other. This would be an OK workaround if I just had two > or three services of that kind but its just not useable with that many > services :/Hmm, I haven''t really thought of this problem -- getting those variables from within a template. It shouldn''t be too hard to enable that in some way, but it''ll take some time to figure out how. In the meantime, I''d file it as an enhancement request. However, you might want to look at using an external node tool like iClassify, so you could set attributes and classes there, and then your whole puppet configuration would have access to them. -- This space intentionally has nothing but text explaining why this space has nothing but text explaining that this space would otherwise have been left blank, and would otherwise have been left blank. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Luke Kanies schrieb:> On Aug 21, 2007, at 10:11 AM, Simon Mügge wrote: > > >> Yeah, this of works (there is nothing wrong with the in-puppet >> function >> that uses "::", just erb can''t seem to hadle that syntax), but this is >> not really usefull to me as I have about 20 of these services that >> configure each other. This would be an OK workaround if I just had two >> or three services of that kind but its just not useable with that many >> services :/ >> > > Hmm, I haven''t really thought of this problem -- getting those > variables from within a template. >Hah, allways something new with these damn users ;-)> It shouldn''t be too hard to enable that in some way, but it''ll take > some time to figure out how. In the meantime, I''d file it as an > enhancement request. >Will do!> However, you might want to look at using an external node tool like > iClassify, so you could set attributes and classes there, and then > your whole puppet configuration would have access to them. >Thanks for the hint, I´ll definitely check that out!> -- > This space intentionally has nothing but text explaining why this > space > has nothing but text explaining that this space would otherwise have > been left blank, and would otherwise have been left blank. > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >