[Puppet Users] hiera hash into multiple templates
Hi all, I've started testing with using Hiera for storing configs and I have a noobish question. Here's an example of my yaml file (/etc/puppet/hieradata/vertname.yaml): --- #icecast type: vanilla client1: cid: 999 cid_hostname: icecast1 cid_ipaddress: 192.168.254.12 password: WhatYoSay? port: 200 concurrency: 50 num_encoders: 2 client2: cid: 998 cid_hostname: icecast2 cid_ipaddress: 192.168.254.13 password: NoWay! port: 201 concurrency: 25 num_encoders: 3 Now, I'd like to be able to create a config file for each client: file { '/home/icecast/${cid}.icecast.xml': ensure = file content = template('icecast/icecast.xml.erb'), } The question is how do I put the above into a loop which iterates over the client arrays in the hiera file (each client config file should get a unique cid, cid_hostname, etc)? Thanks in advance!! Greg -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: hiera hash into multiple templates
Ellison, Brilliant! Worked like a champ. This opens whole new worlds and should make managing the config *much* easier!!! Greg On Friday, September 27, 2013 12:13:03 PM UTC-7, Ellison Marks wrote: Perhaps make it a defined type and use the create resources function. I can't really think of any other way to correctly scope the various parameters. You'd have to tweak your yaml slightly... --- #icecast type: vanilla icecast_clients: client1: cid: 999 cid_hostname: icecast1 cid_ipaddress: 192.168.254.12 password: WhatYoSay? port: 200 concurrency: 50 num_encoders: 2 client2: cid: 998 cid_hostname: icecast2 cid_ipaddress: 192.168.254.13 password: NoWay! port: 201 concurrency: 25 num_encoders: 3 define icecast_client($cid, $cid_hostname, $cid_ipaddress, $password, $port, $concurrency, num_encoders) { file { /home/icecast/${cid}.icecast.xml: ensure = file, content = template('icecast/icecast.xml.erb'), } } $icecast_clients = hiera('icecast_clients') create_resources(icecast_client, $icecast_clients) You could use hiera_hash if you wanted to merge multiple levels of your hierarchy. You could also use the cid in place of client1, client2, etc, then you could remove the $cid parameter in the defined type and just use $title. On Friday, September 27, 2013 11:52:09 AM UTC-7, Greg Coit wrote: Hi all, I've started testing with using Hiera for storing configs and I have a noobish question. Here's an example of my yaml file (/etc/puppet/hieradata/vertname.yaml): --- #icecast type: vanilla client1: cid: 999 cid_hostname: icecast1 cid_ipaddress: 192.168.254.12 password: WhatYoSay? port: 200 concurrency: 50 num_encoders: 2 client2: cid: 998 cid_hostname: icecast2 cid_ipaddress: 192.168.254.13 password: NoWay! port: 201 concurrency: 25 num_encoders: 3 Now, I'd like to be able to create a config file for each client: file { '/home/icecast/${cid}.icecast.xml': ensure = file content = template('icecast/icecast.xml.erb'), } The question is how do I put the above into a loop which iterates over the client arrays in the hiera file (each client config file should get a unique cid, cid_hostname, etc)? Thanks in advance!! Greg -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] augeas question
I've decided to not be blocked by this issue and to have puppet manage the config file. It's not an ideal solution, but good enough until I learn more about either augeas or inifile. Greg On Monday, September 23, 2013 3:48:05 PM UTC-7, Greg Coit wrote: Nathan, Thanks for the response - I did not know about inifile. I unfortunately seem to be having trouble with ini_setting - the following causes a new line to be added every time puppet gets run: ini_setting { 'anonymous_enable': path= '/etc/vsftpd/vsftpd.conf', setting = 'anonymous_enable', value = 'NO', ensure = present, } ini_setting { 'chroot_local_user': path= '/etc/vsftpd/vsftpd.conf', setting = 'chroot_local_user', value = 'YES', ensure = present, } BTW, still playing with augeas too - the most recent code is: augeas { 'vsftpd.conf': context = '/files/vsftpd/vsftpd.conf', incl = '/etc/vsftpd/vsftpd.conf', load_path = '/usr/share/augeas/lenses/dist/', lens = 'vsftpd', changes = [ 'set anonymous_enable NO', 'set chroot_local_user YES', ], } Turns out that augeas has an unwelcome behavior - it tries to load all files that match the lens - if any are non-standard, it errors out. Greg On Monday, September 23, 2013 3:00:36 PM UTC-7, Nathan Valentine wrote: Greg, I believe resource ini_setting would be appropriate here but I do understand the desire to learn about Puppet + Augeas. augeas { 'vsftpd.conf': context = '/etc/vsftpd/vsftpd.conf', changes = [ 'set anonymous_enable=NO', 'set chroot_local_user=YES', ], require = File['/etc/vsftpd/vsftpd.conf'], } context = '*/files*/vsftpd/vsftpd.conf', ? I'm lazy and haven't tested with a Puppet apply but I think this might just be an issue of understanding the namespace-y Augeas stuff. You can test like so with augtool: $ augtool ls */files*/vsftpd/vsftpd.conf -- --- Nathan Valentine - nat...@puppetlabs.com Puppet Labs Professional Services GV: 415.504.2173 Skype: nrvale0 -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] augeas question
LOL - or I could just use one of the 2 vsftpd modules on puppetforge... I never *intend* to do things the hard way. :) Greg On Tuesday, September 24, 2013 9:32:53 AM UTC-7, Greg Coit wrote: I've decided to not be blocked by this issue and to have puppet manage the config file. It's not an ideal solution, but good enough until I learn more about either augeas or inifile. Greg On Monday, September 23, 2013 3:48:05 PM UTC-7, Greg Coit wrote: Nathan, Thanks for the response - I did not know about inifile. I unfortunately seem to be having trouble with ini_setting - the following causes a new line to be added every time puppet gets run: ini_setting { 'anonymous_enable': path= '/etc/vsftpd/vsftpd.conf', setting = 'anonymous_enable', value = 'NO', ensure = present, } ini_setting { 'chroot_local_user': path= '/etc/vsftpd/vsftpd.conf', setting = 'chroot_local_user', value = 'YES', ensure = present, } BTW, still playing with augeas too - the most recent code is: augeas { 'vsftpd.conf': context = '/files/vsftpd/vsftpd.conf', incl = '/etc/vsftpd/vsftpd.conf', load_path = '/usr/share/augeas/lenses/dist/', lens = 'vsftpd', changes = [ 'set anonymous_enable NO', 'set chroot_local_user YES', ], } Turns out that augeas has an unwelcome behavior - it tries to load all files that match the lens - if any are non-standard, it errors out. Greg On Monday, September 23, 2013 3:00:36 PM UTC-7, Nathan Valentine wrote: Greg, I believe resource ini_setting would be appropriate here but I do understand the desire to learn about Puppet + Augeas. augeas { 'vsftpd.conf': context = '/etc/vsftpd/vsftpd.conf', changes = [ 'set anonymous_enable=NO', 'set chroot_local_user=YES', ], require = File['/etc/vsftpd/vsftpd.conf'], } context = '*/files*/vsftpd/vsftpd.conf', ? I'm lazy and haven't tested with a Puppet apply but I think this might just be an issue of understanding the namespace-y Augeas stuff. You can test like so with augtool: $ augtool ls */files*/vsftpd/vsftpd.conf -- --- Nathan Valentine - nat...@puppetlabs.com Puppet Labs Professional Services GV: 415.504.2173 Skype: nrvale0 -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] augeas question
Hello, I'm trying to learn how to use augeas in puppet. One of the packages we have puppet installing is vsftpd. Rather than putting the vsftpd conf file in puppet (in case the config file is updated by the upstream maintainers) I'd like to use augeas to make sure the correct lines exist in the config file. Currently, the default vsftpd config file contains the following 21 lines (among others of course): anonymous_enable=YES #chroot_local_user=YES I'd like to change this to: anonymous_enable=NO chroot_local_user=YES I have the following in a module: #vsftpd package { 'vsftpd': ensure = installed, } file { '/etc/vsftpd/vsftpd.conf': ensure = file, mode= 600, require = Package['vsftpd'], } augeas { 'vsftpd.conf': context = '/etc/vsftpd/vsftpd.conf', changes = [ 'set anonymous_enable=NO', 'set chroot_local_user=YES', ], require = File['/etc/vsftpd/vsftpd.conf'], } But I'm having no luck changing either line. Any suggestions are welcome - thanks! Greg -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] augeas question
Nathan, Thanks for the response - I did not know about inifile. I unfortunately seem to be having trouble with ini_setting - the following causes a new line to be added every time puppet gets run: ini_setting { 'anonymous_enable': path= '/etc/vsftpd/vsftpd.conf', setting = 'anonymous_enable', value = 'NO', ensure = present, } ini_setting { 'chroot_local_user': path= '/etc/vsftpd/vsftpd.conf', setting = 'chroot_local_user', value = 'YES', ensure = present, } BTW, still playing with augeas too - the most recent code is: augeas { 'vsftpd.conf': context = '/files/vsftpd/vsftpd.conf', incl = '/etc/vsftpd/vsftpd.conf', load_path = '/usr/share/augeas/lenses/dist/', lens = 'vsftpd', changes = [ 'set anonymous_enable NO', 'set chroot_local_user YES', ], } Turns out that augeas has an unwelcome behavior - it tries to load all files that match the lens - if any are non-standard, it errors out. Greg On Monday, September 23, 2013 3:00:36 PM UTC-7, Nathan Valentine wrote: Greg, I believe resource ini_setting would be appropriate here but I do understand the desire to learn about Puppet + Augeas. augeas { 'vsftpd.conf': context = '/etc/vsftpd/vsftpd.conf', changes = [ 'set anonymous_enable=NO', 'set chroot_local_user=YES', ], require = File['/etc/vsftpd/vsftpd.conf'], } context = '*/files*/vsftpd/vsftpd.conf', ? I'm lazy and haven't tested with a Puppet apply but I think this might just be an issue of understanding the namespace-y Augeas stuff. You can test like so with augtool: $ augtool ls */files*/vsftpd/vsftpd.conf -- --- Nathan Valentine - nat...@puppetlabs.com javascript: Puppet Labs Professional Services GV: 415.504.2173 Skype: nrvale0 -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] arnoudj/sudo and different versions of CentOS
Hello, Does anyone have an example of using the arnoudj/sudo module in a mixed environment with both CentOS 5 and 6? So far, my CentOS 6 servers are happy but my CentOS 5 servers are ignoring everything in /etc/sudoers.d/ Thank in advance! Greg -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] arnoudj/sudo and different versions of CentOS
Steven, That seemed to do the trick - thanks!!! Greg On Thursday, September 12, 2013 4:30:33 PM UTC-7, Steven wrote: I don't know about the module you are using but things to verify: /etc/sudoers contains an include for /etc/sudoers.d Check that the version of sudo is new enough to support this. You may need to upgrade it. I had to on a number of my Redhat 5 servers Steven -- Date: Thu, 12 Sep 2013 15:01:30 -0700 From: greg...@gmail.com javascript: To: puppet...@googlegroups.com javascript: Subject: [Puppet Users] arnoudj/sudo and different versions of CentOS Hello, Does anyone have an example of using the arnoudj/sudo module in a mixed environment with both CentOS 5 and 6? So far, my CentOS 6 servers are happy but my CentOS 5 servers are ignoring everything in /etc/sudoers.d/ Thank in advance! Greg -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com javascript:. To post to this group, send email to puppet...@googlegroups.comjavascript: . Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Where does the puppet master get its hostname
Hi all, I have a new puppet server named grover.example.com. I've set both the server and certname to grover.example.com in /etc/puppet/puppet.conf (this is CentOS 6.4). I've also verified the hostname: hostname: grover.example.com However, when I start puppetmaster, it always created a cert named grover and *not* grover.example.com: puppet master --no-daemonize --verbose: Info: Creating a new SSL key for grover Info: Creating a new SSL certificate request for grover Info: Certificate Request fingerprint (SHA256): 07:04:47:E0:F5:26:7A:B3:29:83:12:72:09:E0:45:9F:17:9F:E1:57:DC:05:71:10:FE:31:47:5E:4F:47:38:8A Notice: grover has a waiting certificate request Notice: Signed certificate request for grover Notice: Removing file Puppet::SSL::CertificateRequest grover at '/var/lib/puppet/ssl/ca/requests/grover.pem' Notice: Removing file Puppet::SSL::CertificateRequest grover at '/var/lib/puppet/ssl/certificate_requests/grover.pem' Notice: Starting Puppet master version 3.2.4 Using puppet master --no-daemonize --verbose --server grover.example.com makes no difference. Any ideas how to fix this? Thank you!!! Greg -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Where does the puppet master get its hostname
Man, I could have swear i tested this... /etc/sysconfig/network was correct. /ets/hosts had: ip grover grover.example.com I switched that to: ip grover.example.com grover and the cert is now named grover.example.com. :) Thank you!!! Greg On Tuesday, September 10, 2013 12:16:12 PM UTC-7, Nathan Valentine wrote: Check both of the following: /etc/hosts and /etc/sysconfig/network. -- --- Nathan Valentine - nat...@puppetlabs.com javascript: Puppet Labs Professional Services GV: 415.504.2173 Skype: nrvale0 -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Where does the puppet master get its hostname
Nathan, It was spun up by hand from a CentOS 6.4 disk. I added the grover lines to the /etc/hosts file myself after setting the hostname. Greg -- Greg Coit gregc...@gmail.com 707-845-0317 On Tue, Sep 10, 2013 at 12:34 PM, Nathan Valentine nat...@puppetlabs.com wrote: Out of curiosity, your Puppet master was spun up how? As a Vagrant VM? On Tue, Sep 10, 2013 at 3:23 PM, Greg Coit gregc...@gmail.com wrote: Man, I could have swear i tested this... /etc/sysconfig/network was correct. /ets/hosts had: ip grover grover.example.com I switched that to: ip grover.example.com grover and the cert is now named grover.example.com. :) Thank you!!! Greg On Tuesday, September 10, 2013 12:16:12 PM UTC-7, Nathan Valentine wrote: Check both of the following: /etc/hosts and /etc/sysconfig/network. -- --- Nathan Valentine - nat...@puppetlabs.com Puppet Labs Professional Services GV: 415.504.2173 Skype: nrvale0 -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out. -- --- Nathan Valentine - nat...@puppetlabs.com Puppet Labs Professional Services GV: 415.504.2173 Skype: nrvale0 -- You received this message because you are subscribed to a topic in the Google Groups Puppet Users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/MKzWpt1m7mQ/unsubscribe. To unsubscribe from this group and all its topics, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] basic case statement question
Hi all, I'm using the puppetlabs/ntp module and would like to define the ntp servers based on the fact timezone: #ntp class { '::ntp': case $timezone { PDT: { servers = [ '0.us.pool.ntp.org', '1.us.pool.ntp.org', '2.us.pool.ntp.org', '3.us.pool.ntp.org'], } default: { fail(Unrecognized timezone $timezone) } } } The above gives me Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at 'timezone'; expected '}' at /etc/puppet/modules/linux/manifests/init.pp:56 on node but It's unclear to me what I've done wrong. Any suggestions? Thank you in advance! Greg -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] basic case statement question
Frederiko, That worked perfectly! I was trying to be too fancy I guess. Thank you for the help Greg On Thursday, September 5, 2013 11:27:02 AM UTC-7, Frederiko Costa wrote: Ohh.. my bad. You're actually instantiating the parametized class ntp. I accidentally thought you were writing your module. In that case, you might want to try using selectors. But I don't remember from the top of my head if the fail() function would work. Let's stick with the 'case' anyway ... Try this, assuming you have a node declaration ... node 'a.b.c.d' { case $timezone { 'PDT': { $my_ntp_servers = [ '0.us.pool.ntp.org', '1.us.pool.ntp.org', '2.us.pool.ntp.org', '3.us.pool.ntp.org'] } default: { fail(Unrecognized timezone $timezone) } class { 'ntp': server = $my_ntp_servers, } } If I were you, I would put the timezone logic outside. Hope this time I'm correct. :-) -frederiko On Thu, Sep 5, 2013 at 11:15 AM, Greg Coit greg...@gmail.comjavascript: wrote: Thank you for the reply Frederiko. Unfortunately, that doesn't seem to be the issue. The following is from the pupetlabs/ntep docs and works: class { '::ntp': servers = [ '0.us.pool.ntp.org', '1.us.pool.ntp.org', ' 2.us.pool.ntp.org', '3.us.pool.ntp.org'], } Greg On Thursday, September 5, 2013 10:41:25 AM UTC-7, Frederiko Costa wrote: Hi, To me, this would look like this. You're assigning the 'server' variable using =, rather than =: class { '::ntp': case $timezone { 'PDT': { servers = [ '0.us.pool.ntp.org', '1.us.pool.ntp.org', ' 2.us.pool.ntp.org', '3.us.pool.ntp.org'] } default: { fail(Unrecognized timezone $timezone) } # rest of the class. } I hope this helps. -frederiko On Thu, Sep 5, 2013 at 9:25 AM, Greg Coit greg...@gmail.com wrote: Hi all, I'm using the puppetlabs/ntp module and would like to define the ntp servers based on the fact timezone: #ntp class { '::ntp': case $timezone { PDT: { servers = [ '0.us.pool.ntp.org', '1.us.pool.ntp.org', ' 2.us.pool.ntp.org', '3.us.pool.ntp.org'], } default: { fail(Unrecognized timezone $timezone) } } } The above gives me Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at 'timezone'; expected '}' at /etc/puppet/modules/linux/**manifests/init.pp:56 on node but It's unclear to me what I've done wrong. Any suggestions? Thank you in advance! Greg -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@**googlegroups.com. To post to this group, send email to puppet...@googlegroups.com. Visit this group at http://groups.google.com/**group/puppet-usershttp://groups.google.com/group/puppet-users . For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out . -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com javascript:. To post to this group, send email to puppet...@googlegroups.comjavascript: . Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] basic case statement question
Thank you for the reply Frederiko. Unfortunately, that doesn't seem to be the issue. The following is from the pupetlabs/ntep docs and works: class { '::ntp': servers = [ '0.us.pool.ntp.org', '1.us.pool.ntp.org', '2.us.pool.ntp.org', '3.us.pool.ntp.org'], } Greg On Thursday, September 5, 2013 10:41:25 AM UTC-7, Frederiko Costa wrote: Hi, To me, this would look like this. You're assigning the 'server' variable using =, rather than =: class { '::ntp': case $timezone { 'PDT': { servers = [ '0.us.pool.ntp.org', '1.us.pool.ntp.org', ' 2.us.pool.ntp.org', '3.us.pool.ntp.org'] } default: { fail(Unrecognized timezone $timezone) } # rest of the class. } I hope this helps. -frederiko On Thu, Sep 5, 2013 at 9:25 AM, Greg Coit greg...@gmail.com javascript: wrote: Hi all, I'm using the puppetlabs/ntp module and would like to define the ntp servers based on the fact timezone: #ntp class { '::ntp': case $timezone { PDT: { servers = [ '0.us.pool.ntp.org', '1.us.pool.ntp.org', ' 2.us.pool.ntp.org', '3.us.pool.ntp.org'], } default: { fail(Unrecognized timezone $timezone) } } } The above gives me Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at 'timezone'; expected '}' at /etc/puppet/modules/linux/manifests/init.pp:56 on node but It's unclear to me what I've done wrong. Any suggestions? Thank you in advance! Greg -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com javascript:. To post to this group, send email to puppet...@googlegroups.comjavascript: . Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Help with customer fact
Benjamin, That was it - thank you Greg On Wednesday, September 4, 2013 2:04:17 PM UTC-7, Ben Carrell wrote: The ulimit command is a shell builtin, try using /bin/bash -c ulimit -n -- Benjamin Carrell On Wed, Sep 4, 2013 at 2:54 PM, Greg Coit greg...@gmail.com javascript: wrote: Hello, I've setup a puppet master server and a couple of clients for testing purposes. Everything's going pretty well but I'm having trouble with creating a custom fact. I'm using the open source version of puppet on Centos 6.4. In the file /etc/puppet/modules/linux/lib/facter/ulimit.rb, I have the following: Facter.add(ulimit) do confine :kernel = Linux setcode do Facter::Util::Resolution.exec(ulimit -n) end end The module linux is a custom one that I use as a profile. Nowhere in the module is the new fact mentioned (which might be the issue???) On the clients, I run `facter --debug --puppet ulimit` and get: Relative directory ./facter removed from search path. value for ulimit is still nil Any idea what's causing the issue? Thanks! Greg -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com javascript:. To post to this group, send email to puppet...@googlegroups.comjavascript: . Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.