Hi, I have a puppetmaster - agent architecture. I have a module for the vsftpd configuracion in the agents. The configuration of the value ''max_per_ip'' in the agents may vary. This is a line of the manifest: $max_per_ip = hiera(''max_per_ip'',10) I want to specify different values for each agent using hiera. The problem is I am only able to specify the ''common'' values, not the values using the the variable ''clientcert''. This is my configuration in the puppetmaster: The ''/etc/hiera.yaml'' file: --- :backend: - yaml :hierarchy: - ${certname} - common :yaml: # datadir is empty here, so hiera uses its defaults: # - /var/lib/hiera on *nix # - %CommonAppData%\PuppetLabs\hiera\var on Windows # When specifying a datadir, make sure the directory exists. :datadir: I created the file ''/var/lib/hiera/c108.dfgserver.com.yaml'' with the following content: --- #vsftpd max_per_ip: 20 But this doesn´t work. The agent ignores the value ''max_per_ip'' established on the file. If I rename the file ''/var/lib/hiera/c108.dfgserver.com.yaml'' to ''common.yaml'', then it works. At the beginning I thought it could be an issue with the variable ''certname'' but if I execute the following in the agent it returns the fact correctly: root@c108:/etc/puppet# puppet apply -ve ''notify {"My certname is: ${settings::certname}":}'' Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb Info: Loading facts in /var/lib/puppet/lib/facter/iptables.rb Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb Info: Loading facts in /var/lib/puppet/lib/facter/iptables.rb Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb Info: Applying configuration version ''1353427613'' My certname is: c108.dfgserver.com /Stage[main]//Notify[My certname is: c108.dfgserver.com]/message: defined ''message'' as ''My certname is: c108.dfgserver.com'' Finished catalog run in 0.07 seconds root@c108:/etc/puppet# So the namefile must be ''$certname''.yaml right? I have the last versions of the repo ''apt.puppetlabs.com''. Both machines are ubuntu 10.04 LTS (lucid) with the last stable packages. -- 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/-/l49ez_4lmLsJ. 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.
Try: :hierarchy: - "%{certname}" - common Felipe On Tuesday, November 20, 2012 8:14:10 AM UTC-8, Félix Barbeira wrote:> > Hi, I have a puppetmaster - agent architecture. I have a module for the > vsftpd configuracion in the agents. The configuration of the value > ''max_per_ip'' in the agents may vary. This is a line of the manifest: > > $max_per_ip = hiera(''max_per_ip'',10) > > I want to specify different values for each agent using hiera. The problem > is I am only able to specify the ''common'' values, not the values using the > the variable ''clientcert''. This is my configuration in the puppetmaster: > > The ''/etc/hiera.yaml'' file: > > --- > :backend: > - yaml > :hierarchy: > - ${certname} > - common > :yaml: > # datadir is empty here, so hiera uses its defaults: > # - /var/lib/hiera on *nix > # - %CommonAppData%\PuppetLabs\hiera\var on Windows > # When specifying a datadir, make sure the directory exists. > :datadir: > > I created the file ''/var/lib/hiera/c108.dfgserver.com.yaml'' with the > following content: > > --- > #vsftpd > max_per_ip: 20 > > But this doesn´t work. The agent ignores the value ''max_per_ip'' > established on the file. If I rename the file ''/var/lib/hiera/c108.dfgserver.com.yaml'' > to ''common.yaml'', then it works. At the beginning I thought it could be an > issue with the variable ''certname'' but if I execute the following in the > agent it returns the fact correctly: > > root@c108:/etc/puppet# puppet apply -ve ''notify {"My certname is: > ${settings::certname}":}'' > Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb > Info: Loading facts in /var/lib/puppet/lib/facter/iptables.rb > Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb > Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb > Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb > Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb > Info: Loading facts in /var/lib/puppet/lib/facter/iptables.rb > Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb > Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb > Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb > Info: Applying configuration version ''1353427613'' > My certname is: c108.dfgserver.com > /Stage[main]//Notify[My certname is: c108.dfgserver.com]/message: defined > ''message'' as ''My certname is: c108.dfgserver.com'' > Finished catalog run in 0.07 seconds > root@c108:/etc/puppet# > > So the namefile must be ''$certname''.yaml right? > > I have the last versions of the repo ''apt.puppetlabs.com''. Both machines > are ubuntu 10.04 LTS (lucid) with the last stable packages. > >-- 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/-/Bmcthk_lSTkJ. 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.
Thanks Felipe but that wasn´t the problem, it works without the quotes. I had to declare the variable stament as a paremeter of the class, otherwise it doesn´t work. Besides that the value in the yaml file must follow this pattern: <class_name>::<parameter_name> Everything is explained here: http://docs.puppetlabs.com/puppet/3/reference/lang_classes.html#include-like-vs-resource-like Thanks anyway! :) El martes, 20 de noviembre de 2012 20:25:15 UTC+1, Felipe Salum escribió:> > Try: > > :hierarchy: > - "%{certname}" > - common > > Felipe > > On Tuesday, November 20, 2012 8:14:10 AM UTC-8, Félix Barbeira wrote: >> >> Hi, I have a puppetmaster - agent architecture. I have a module for the >> vsftpd configuracion in the agents. The configuration of the value >> ''max_per_ip'' in the agents may vary. This is a line of the manifest: >> >> $max_per_ip = hiera(''max_per_ip'',10) >> >> I want to specify different values for each agent using hiera. The >> problem is I am only able to specify the ''common'' values, not the values >> using the the variable ''clientcert''. This is my configuration in the >> puppetmaster: >> >> The ''/etc/hiera.yaml'' file: >> >> --- >> :backend: >> - yaml >> :hierarchy: >> - ${certname} >> - common >> :yaml: >> # datadir is empty here, so hiera uses its defaults: >> # - /var/lib/hiera on *nix >> # - %CommonAppData%\PuppetLabs\hiera\var on Windows >> # When specifying a datadir, make sure the directory exists. >> :datadir: >> >> I created the file ''/var/lib/hiera/c108.dfgserver.com.yaml'' with the >> following content: >> >> --- >> #vsftpd >> max_per_ip: 20 >> >> But this doesn´t work. The agent ignores the value ''max_per_ip'' >> established on the file. If I rename the file ''/var/lib/hiera/c108.dfgserver.com.yaml'' >> to ''common.yaml'', then it works. At the beginning I thought it could be an >> issue with the variable ''certname'' but if I execute the following in the >> agent it returns the fact correctly: >> >> root@c108:/etc/puppet# puppet apply -ve ''notify {"My certname is: >> ${settings::certname}":}'' >> Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb >> Info: Loading facts in /var/lib/puppet/lib/facter/iptables.rb >> Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb >> Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb >> Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb >> Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb >> Info: Loading facts in /var/lib/puppet/lib/facter/iptables.rb >> Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb >> Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb >> Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb >> Info: Applying configuration version ''1353427613'' >> My certname is: c108.dfgserver.com >> /Stage[main]//Notify[My certname is: c108.dfgserver.com]/message: >> defined ''message'' as ''My certname is: c108.dfgserver.com'' >> Finished catalog run in 0.07 seconds >> root@c108:/etc/puppet# >> >> So the namefile must be ''$certname''.yaml right? >> >> I have the last versions of the repo ''apt.puppetlabs.com''. Both machines >> are ubuntu 10.04 LTS (lucid) with the last stable packages. >> >>-- 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/-/at_aY8rsM4wJ. 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.