[Puppet Users] Re: How do I "cd" (change directory) with Puppet's exec?
Specifically, when I have "cd" in command => ".." it says it cannot find the command "cd". On Thursday, July 5, 2012 10:31:38 PM UTC-7, Benjamin Lei wrote: > > I sort of "need" to do this to run a Makefile that uses local > directories... -- 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/-/bE3G2xpCy_gJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] How do I "cd" (change directory) with Puppet's exec?
I sort of "need" to do this to run a Makefile that uses local directories... -- 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/-/NWcJKsG5-SYJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] switching to puppet 3
On 6 July 2012 13:57, Walter Heck wrote: > On Fri, Jul 6, 2012 at 11:46 AM, Peter Brown wrote: >> I guess it's time to build myself a vm on the laptop (probably with >> puppet :) )and see how it goes. >> If my code works I may switch the production env over and see how that goes. > Look into virtualbox, vagrant and veewee, the three combined make an > extremely flexible, powerful and cool solution that can automatically > build a vm with your repository applied to it. Pure magic :) I tried getting puppet to manage virtualbox nodes but gave up when it looked like I needed to deploy a dhcp setup with tftp and pxe to make it work. Those three look like a pretty handy trio though. I was using xen for vm's in my last job and manageing them with puppet but no one likes xen anymore (especially major linux distros) so my current environment is setup with kvm, cobbler and koan all managed by puppet. I have linux on my laptop so i will just use my current config and build me a new test environment :) > > > -- > Walter Heck > > -- > Check out my startup: Puppet training and consulting @ http://www.olindata.com > Follow @olindata on Twitter and/or 'Like' our Facebook page at > http://www.facebook.com/olindata > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Multiple execs within a class
Hello all, I'm looking to run multiple commands via exec within a single class like so: class boost_install { # This will place the gzip locally in /tmp. File is pulled from puppet. file { "/tmp/boost_1_41_0.tar.bz2" : source => "puppet:///boost_install/boost_1_41_0.tar.bz2" , ensure => present , } # This will extract the boost gzip to the /tmp directory. # This will untar only if the /tmp/boost_1_41_0 directory does not exist. exec { "tar -xjvf /tmp/boost_1_41_0.tar.bz2" : cwd => "/tmp/" , creates => "/tmp/boost_1_41_0" , path=> ["/bin" , "/usr/sbin"] , } # This will run the boost bootstrapper. bjam should be run after this. # This will only run if the ls command returns a 1. # The unless will have to be redone because we have no way of upgrading easily and this is sloppy. exec{ "/tmp/boost_1_41_0/bootstrap.sh" : unless => 'ls /usr/local/include/boost' , path=> ["/bin/" , "/sbin/" , "/usr/bin/" , "/usr/sbin/"] , } # This will run the boost bjam modifier and should run only after the bootstrap.sh has been run # This will only run if the ls command returns a 1. # This unless will have to be redone because we have no way of upgrading easily and this is sloppy. exec { "/tmp/boost_1_41_0/bjam cxxflags=-fPIC install" : unless => 'ls /usr/local/include/boost' , path=> ["/bin/" , "/sbin/" , "/usr/bin/" , "/usr/sbin/"] , } } However, after running the above class, I get the following: err: /Stage[main]/Boost_install/Exec[/tmp/boost_1_41_0/bootstrap.sh]/returns: change from notrun to 0 failed: /tmp/boost_1_41_0/bootstrap.sh returned 1 instead of one of [0] at /etc/puppet/modules/boost_install/manifests/init.pp:18 err: /Stage[main]/Boost_install/Exec[/tmp/boost_1_41_0/bjam cxxflags=-fPIC install]/returns: change from notrun to 0 failed: /tmp/boost_1_41_0/bjam cxxflags=-fPIC install returned 1 instead of one of [0] at /etc/puppet/modules/boost_install/manifests/init.pp:21 notice: Finished catalog run in 1.31 seconds I was under the impression that I should be getting the "install returned 1" output but it's usually silent and the command doesn't run. I'm assuming that neither the bootstrap or bjam commands should run as the /usr/local/include/boost directories exist on the machine and I'm expecting the "ls" to return a 0; which it does on the machine because those directories exist. I'm obviously missing something here and I'm looking for some direction. I do suspect that this can be done in a more elegant fashion especially since the bjam command is dependent upon the bootstrap.sh script running but I was hoping to at least get this working. Thanks in advance for the thoughts. Cheers, Mike -- 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/-/EU_MKz-02H0J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] switching to puppet 3
On Fri, Jul 6, 2012 at 11:46 AM, Peter Brown wrote: > I guess it's time to build myself a vm on the laptop (probably with > puppet :) )and see how it goes. > If my code works I may switch the production env over and see how that goes. Look into virtualbox, vagrant and veewee, the three combined make an extremely flexible, powerful and cool solution that can automatically build a vm with your repository applied to it. Pure magic :) -- Walter Heck -- Check out my startup: Puppet training and consulting @ http://www.olindata.com Follow @olindata on Twitter and/or 'Like' our Facebook page at http://www.facebook.com/olindata -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] is nodes.pp a default file?
you can put this in the main section of your puppet.conf file [main] manifestdir = /home/puppet/manifests that looks for your site.pp in that directory you also can specify this in your puppet.conf for each environment. manifest= /etc/puppet/manifests/site.pp then in site.pp you do something like this import 'definitions' import 'modules' import 'templates' import 'nodes' import 'classes/*' import looks for .pp files so definitions.pp modules.pp etc does that help? The introductory docs cover this sort of thing. Have a look here. http://docs.puppetlabs.com/learning/ On 6 July 2012 12:57, Hai Tao wrote: > Hi, > > is nodes.pp a default file,like sites.pp, or I have to import it in > puppet.conf? > > I cannot find a paramater in "puppetmasterd genconfig | grep nodes.pp", can > someone advice? > > Thanks. > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] switching to puppet 3
On 6 July 2012 12:59, Walter Heck wrote: > I would hope you have a development environment to test this on before > you make the switch? I wouldn't actually recommend switching a > production environment to a release candidate. It's okay to start > testing puppet 3 in a staging environment to see if you are going to > have majore issues, but I personally won't be switching until the > first two or three minor releases after 3.0. I prefer others to run > into problems instead of me :) I guess it's time to build myself a vm on the laptop (probably with puppet :) )and see how it goes. If my code works I may switch the production env over and see how that goes. > As for the changes, reading through the release notes will give you a > good idea. There are some major changes and a lot of minor changes, so > test, rinse, repeat would be my suggestion. > http://projects.puppetlabs.com/projects/puppet/wiki/Release_Notes Cool. thanks for that. > have fun! I always do preferably learning something while having fun. > > Walter > > On Fri, Jul 6, 2012 at 9:24 AM, Peter Brown wrote: >> Hi everyone, >> >> I noticed puppet 3 has made it to rc3 and they have made it available >> in the devel repositories. >> I am getting tempted to switch now and avoid the rush. >> I have tried to find out what is new or different with puppet 3 but >> haven't been able to find anything. >> I am currently running 2.7.17 with puppetdb for config storing which >> works great by the way. >> I only have 10 nodes right now but that will be growing shortly. >> >> Has anything been deprecated in 3 and is there anything I need to >> change with my current code to make it work under version 3? >> Thanks >> >> Pete >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Users" group. >> To post to this group, send email to puppet-users@googlegroups.com. >> To unsubscribe from this group, send email to >> puppet-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en. >> > > > > -- > Walter Heck > > -- > Check out my startup: Puppet training and consulting @ http://www.olindata.com > Follow @olindata on Twitter and/or 'Like' our Facebook page at > http://www.facebook.com/olindata > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] switching to puppet 3
I would hope you have a development environment to test this on before you make the switch? I wouldn't actually recommend switching a production environment to a release candidate. It's okay to start testing puppet 3 in a staging environment to see if you are going to have majore issues, but I personally won't be switching until the first two or three minor releases after 3.0. I prefer others to run into problems instead of me :) As for the changes, reading through the release notes will give you a good idea. There are some major changes and a lot of minor changes, so test, rinse, repeat would be my suggestion. http://projects.puppetlabs.com/projects/puppet/wiki/Release_Notes have fun! Walter On Fri, Jul 6, 2012 at 9:24 AM, Peter Brown wrote: > Hi everyone, > > I noticed puppet 3 has made it to rc3 and they have made it available > in the devel repositories. > I am getting tempted to switch now and avoid the rush. > I have tried to find out what is new or different with puppet 3 but > haven't been able to find anything. > I am currently running 2.7.17 with puppetdb for config storing which > works great by the way. > I only have 10 nodes right now but that will be growing shortly. > > Has anything been deprecated in 3 and is there anything I need to > change with my current code to make it work under version 3? > Thanks > > Pete > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > -- Walter Heck -- Check out my startup: Puppet training and consulting @ http://www.olindata.com Follow @olindata on Twitter and/or 'Like' our Facebook page at http://www.facebook.com/olindata -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] is nodes.pp a default file?
Hi, is nodes.pp a default file,like sites.pp, or I have to import it in puppet.conf? I cannot find a paramater in "puppetmasterd genconfig | grep nodes.pp", can someone advice? Thanks. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: How to make send in a "q" when a screen shows up from exec?
No that did not work. It worked when I ran it myself, but when puppet ran it the previous Ruby version I had was not replaced. On Thursday, July 5, 2012 6:48:58 PM UTC-7, Brian Gupta wrote: > > On Thu, Jul 5, 2012 at 9:43 PM, Benjamin Lei > wrote: > > I see; thanks. I'll try that later. > > The next thing I'm trying to do is: > > rvm use 1.8.7 --default > > > > The command executes successfully, but when I SSH back into my server > the > > version is still its old one. What might be going wrong? > > > > On Thursday, July 5, 2012 8:37:28 AM UTC-7, jcbollinger wrote: > >> > >> > >> > >> On Wednesday, July 4, 2012 6:01:02 PM UTC-5, Benjamin Lei wrote: > >>> > >>> So I'm trying to exec something, but during the exec a screen will > show > >>> up that I need to "q" out of to finish it. Specifically speaking, I'm > trying > >>> to exec: rvm --force install 1.8.7 > >> > >> > >> Ideally, there would be a command-line option to suppress the screen or > >> provide the needed answer automatically. Most command-line based > installers > >> have such a thing in order to make them scriptable. If rvm doesn't > provide > >> that option then you might be able to pipe in the needed input: 'echo q > | > >> rvm --force install 1.8.7'. In that case make sure the Exec uses the > 'sh' > >> provider. > > Does this help?: > > http://unknown-xengineer.blogspot.com/2012/06/workaround-for-unattended-rvm.html > > > > >> John > >> > > -- > > 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/-/qfdLLnvdw8cJ. > > > > To post to this group, send email to puppet-users@googlegroups.com. > > To unsubscribe from this group, send email to > > puppet-users+unsubscr...@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/puppet-users?hl=en. > -- 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/-/qHLHVTOSYMUJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Built in rollback features
On Thu, Jul 5, 2012 at 4:45 PM, gilbertc777 wrote: > Hi Everyone, > > I am relativly new to writing puppet modules, and am working to architecht > our puppet implementation. One of the questions I have, is rolling back a > puppet run. What are the best ways to accomplish this. > > For instance, if I add a module to manage autofs, apply it to a server, and > then no longer want to manage autofs on the server, how would I make it so > that I can roll the server back to the unconfigured state? > > Also, when managing local account using puppet, what are ideas to handle the > following case:Users A, B and C are added to all our servers. After running > for some time, we need to only remove User B. > > I have read on multiple blogs about having !classes, but I want to try and > work towards using more of an industry standard and wanted to get other > peoples opinions. Puppet doesn't have any concept of rollback. You are declaring what you want as your end result. Also bear in mind puppet only manages resources that are in your manifests. (There are 10s of thousands of objects on a default OS install that are unmanaged, if you consider ever file, service, user or package that gets installed.) One example: If you had a manifest that didn't manage the user "testuser" and added a resource to manage it, it would go from "unmanaged" to managed, and create it if it didn't exist. If one were to roll back to a previous manifest that didn't have "testuser", the user would still exist on the system in an unmanaged state. In the puppet world if you want that removed, you have to continue managing that resource, but ensure that the resource in question is absent, or purged, using "ensure". e.g. - "ensure => absent" > Thanks! > Chuck > > -- > 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/-/uPGycpyKnEsJ. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: How to make send in a "q" when a screen shows up from exec?
On Thu, Jul 5, 2012 at 9:43 PM, Benjamin Lei wrote: > I see; thanks. I'll try that later. > The next thing I'm trying to do is: > rvm use 1.8.7 --default > > The command executes successfully, but when I SSH back into my server the > version is still its old one. What might be going wrong? > > On Thursday, July 5, 2012 8:37:28 AM UTC-7, jcbollinger wrote: >> >> >> >> On Wednesday, July 4, 2012 6:01:02 PM UTC-5, Benjamin Lei wrote: >>> >>> So I'm trying to exec something, but during the exec a screen will show >>> up that I need to "q" out of to finish it. Specifically speaking, I'm trying >>> to exec: rvm --force install 1.8.7 >> >> >> Ideally, there would be a command-line option to suppress the screen or >> provide the needed answer automatically. Most command-line based installers >> have such a thing in order to make them scriptable. If rvm doesn't provide >> that option then you might be able to pipe in the needed input: 'echo q | >> rvm --force install 1.8.7'. In that case make sure the Exec uses the 'sh' >> provider. Does this help?: http://unknown-xengineer.blogspot.com/2012/06/workaround-for-unattended-rvm.html >> John >> > -- > 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/-/qfdLLnvdw8cJ. > > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: How to make send in a "q" when a screen shows up from exec?
I see; thanks. I'll try that later. The next thing I'm trying to do is: rvm use 1.8.7 --default The command executes successfully, but when I SSH back into my server the version is still its old one. What might be going wrong? On Thursday, July 5, 2012 8:37:28 AM UTC-7, jcbollinger wrote: > > > > On Wednesday, July 4, 2012 6:01:02 PM UTC-5, Benjamin Lei wrote: >> >> So I'm trying to exec something, but during the exec a screen will show >> up that I need to "q" out of to finish it. Specifically speaking, I'm >> trying to exec: rvm --force install 1.8.7 > > > Ideally, there would be a command-line option to suppress the screen or > provide the needed answer automatically. Most command-line based > installers have such a thing in order to make them scriptable. If rvm > doesn't provide that option then you might be able to pipe in the needed > input: 'echo q | rvm --force install 1.8.7'. In that case make sure the > Exec uses the 'sh' provider. > > > John > > -- 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/-/qfdLLnvdw8cJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Announce: Puppet Dashboard 1.2.10rc1 Available
1.2.10rc1 is a maintenance release of Puppet Dashboard. It includes contributions from Will Hopper and Moses Mendoza. Thanks to Aaron Patterson for the security content in commit e17269f. This release is available for download at: https://downloads.puppetlabs.com/dashboard/puppet-dashboard-1.2.10rc1.tar.gz Debian packages are available at https://apt.puppetlabs.com RPM packages are available at https://yum.puppetlabs.com See the Verifying Puppet Download section at: http://projects.puppetlabs.com/projects/puppet/wiki/Downloading_Puppet Please report feedback via the Puppet Labs Redmine site, using an affected version of 1.2.10rc1: http://projects.puppetlabs.com/projects/dashboard Documentation is available at: http://docs.puppetlabs.com/dashboard/index.html 1.2.10rc1 Security Fixes/Highlights === *Patch puppet-dashboard for CVE-2012-2660 This commit adds a patch to actionpack to address CVE-2012-2660, unsafe query generation vulnerability. This patch is taken from Aaron Patterson on the rails security list: https://groups.google.com/forum/?fromgroups#!topic/rubyonrails-security/8SA-M3as7A8 *(#11849) Add rake task to install cron job to clean up database reports This commit adds a rake task to install a monthly cron job to clean up old database reports, as suggested in official Puppet Labs documentation. This allows users to easily install the optional cron job while not risking undesired data loss for those who do not wish to have the job installed by default. 1.2.10rc Changelog === Will Hopper (1) 5de691f (#11849) Add rake task to install cron job to clean up database reports Moses Mendoza (3) 07c75a3 cleanup on puppet-dashboard spec file b70344d create certs directory with installation d9b7eeb Install a default settings.yml file with database.yml e17269f Patch puppet-dashboard for CVE-2012-2660 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] switching to puppet 3
Hi everyone, I noticed puppet 3 has made it to rc3 and they have made it available in the devel repositories. I am getting tempted to switch now and avoid the rush. I have tried to find out what is new or different with puppet 3 but haven't been able to find anything. I am currently running 2.7.17 with puppetdb for config storing which works great by the way. I only have 10 nodes right now but that will be growing shortly. Has anything been deprecated in 3 and is there anything I need to change with my current code to make it work under version 3? Thanks Pete -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Announce: puppetlabs_spec_helper 0.2.0 available
puppetlabs_spec_helper is a Rubygem to make writing and running module spec tests using rspec-puppet easier. It includes a set of common rake tasks and a spec_helper that correctly initializes puppet and rspec-puppet for testing. The code is available on github at http://github.com/puppetlabs/puppetlabs_spec_helper. Patches are welcome. puppetlabs_spec_helper 0.2.0 is a bugfix release. To update the gem to the latest version, run 'gem update puppetlabs_spec_helper' Changes: * Fix integration with mocha-0.12.0 * Fix coverage rake task * Fix an issue creating the fixtures directory Non-employee contributors to this release: * Paul Belanger * Markus Falb -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] puppet with stored configurations mysql connection error
I am testing out the store configurations on my puppet master, packages installed: - puppet - puppet-master - rubygems - ruby-mysql - ruby-devel - mysql-server - mysql - mysql-devel *Configuration Files:* *Puppet.conf* [main] logdir = /var/log/puppet rundir = /var/run/puppet ssldir = $vardir/ssl [agent] classfile = $vardir/classes.txt localconfig = $vardir/localconfig server = server1.domain.com [master] certname = server1 certdnsnames = server1.domain.com #stored configurations *storeconfigs = true* * dbadapter = mysql* * dbname = puppet* * dbuser = puppet* * dbpassword = puppet* * dbserver = localhost* * dbsocket = /var/lib/mysql/mysql.sock* *gems installed:* $gem list *** LOCAL GEMS *** actionmailer (2.3.5) actionpack (2.3.5) activerecord (2.3.5) activeresource (2.3.5) activesupport (2.3.5) rack (1.0.1) rails (2.3.5) rake (0.9.2.2) *mysql configuration:* create database puppet; grant all privileges on puppet.* to puppet@localhost identified by 'puppet'; Now, when I run puppet agent as follows, I am getting the *error* as follows: *$puppet agent --test --server=server1.domain.com --noop* info: Connecting to mysql database: puppet info: Caching facts for ashrith.cloudwick.com *err: Could not retrieve catalog from remote server: Error 400 on SERVER: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)* warning: Not using cache on failed catalog err: Could not retrieve catalog; skipping run But, when I run puppet agent with out the stored configurations, it works fine. As well as I also checked connecting to mysql using various parameters as below and everything worked: *mysql -u root -p --socket=/var/lib/mysql/mysql.sock* *mysql -u puppet -p --socket=/var/lib/mysql/mysql.sock* *mysql -u puppet -p -h localhost --socket=/var/lib/mysql/mysql.sock* I am stuck, I was trying to implement Nagios using Puppet's stored configuration any help is appreciated. -- 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/-/472vStb5VR4J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Automated deployement with puppet
Hi Mouhcine, I find that if you can script it you can manage it with puppet and I haven't run into much I don't manage with puppet. I haven't used puppet to manage a Tomcat instance (you will likely find something on http://forge.puppetlabs.com/ for doing that though) but if you are deploying a jar file to a specific directory that's very easy with puppet using the file resource. Have you had a look through the introductory docs? If not start here http://docs.puppetlabs.com/puppet/ That explains all the basics and should get you going pretty quickly. Good luck and enjoy. Pete On 6 July 2012 00:59, mouhcine MOULOU wrote: > Hi , > > I am new to Puppet and I just started testing it on my Debian OS, I was > wondering if it's possible to create an artifact that allows auto-deploying > jar file without using SSH & SCP? > > I Found some threads explaining how to deploy web application on Tomcat > Server, but i need to deploy a simple Jar on my platform > > Thanks, > Mouhcine > > -- > 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/-/J7Os3wlMbfQJ. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: Identifying host OS in an ENC
On Thursday, July 5, 2012 11:26:48 AM UTC-5, Matthew Burgess wrote: > > On Thu, Jul 5, 2012 at 4:56 PM, jcbollinger wrote: > > > Are you sure a Puppet run needs to have already completed before the > facts > > are available from the inventory service? That would be surprising. > Also > > most unfortunate, inasmuch as it implies that the inventory service > would be > > serving stale facts (from a previous run) to your ENC. > > Well, no, to be honest, I'm not sure how the facts are made available > to the ENC/inventory service. > > From what you've written above, I assume the order of events is: > > 1) puppet agent runs > 2) puppet agent gathers facts > 3) puppet agent stores facts in inventory service > 4) puppet server uses facts during compilation and application of the > catalog? > > If that's the case, then all is good, I guess. > What I know is: 1) The agent performs plugin synchronization, if enabled 2) The agent gathers facts and sends them to the master 3) The master compiles and returns a catalog 4) The agent applies the catalog Recording the facts in the inventory service and running the ENC both happen in step 3. The ENC runs very early, and I don't know for sure whether the inventory is updated first, but the master definitely has the node's then-current facts *somewhere* at that time. If the inventory isn't updated first then I'd consider filing a bug / RFE. John -- 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/-/2sZX6nE20g4J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: proper usage of global variables / node variables / +=
On Thursday, July 5, 2012 2:59:07 PM UTC-5, fpee wrote: > > On 07/05/2012 08:30 AM, jcbollinger wrote: > > > If that's so then you are relying on a Puppet bug, or perhaps you have > > oversimplified your example. The language guide specifically states > > that the += operator affects the observed value of the affected variable > > only in the scope where the plussignment is performed. You definitely > > should not see the modified value in classes that are not declared in > > the scope of the plussignment. > > Cool! Let's find out. Here is a working tiny example: > > node my_standard { >$pkg_list += 'one two three ' > } > > node 'testnode' inherits my_standard { >include my_test1 >include my_test2 > } > > class my_test1 { >$pkg_list += 'four five ' >notify {"pkg_list=$pkg_list":} >notice("pkg_list=$pkg_list") > } > > class my_test2 { >$pkg_list += 'six seven ' >notify {"pkg_list=$pkg_list":} >notice("pkg_list=$pkg_list") > } > > The output when run on testnode: > > notice: /Stage[main]/My_test1/Notify[pkg_list=one two three four five > ]/message: defined 'message' as 'pkg_list=one two three four five ' > > notice: /Stage[main]/My_test2/Notify[pkg_list=one two three four five > six seven ]/message: defined 'message' as 'pkg_list=one two three four > five six seven ' > > So, the my_test2 scope does have the changes from the my_test1 scope. > Using puppet-server 2.7.9-1 (epel version). > > As the guy who has many modules that use this bug, I like it's > functionality :) > > Should I file a bug report? > Not if you like the buggy behavior :-) Personally, I would be very concerned that it might stop working between one point release and another, with no warning. The behavior is not merely undocumented, but *contrary* to the documentation as far as I can tell. At this point, however, I'm hoping that one of the PuppetLabs guys will jump in to either explain why I'm wrong or confirm that it's a bug. John -- 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/-/s8-GASWdRkkJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: Ruby DSL parameterized classes and defaults
Comments inline. On Thursday, July 5, 2012 2:31:47 PM UTC-5, polaris_s0i wrote: > > I've been reading the Docs on this, and its not very clear. > > I want to have a parameterized class that takes arrays and objects as > parameters. > I'm using puppet 2.6.16. > > I define a hostclass like this: > > hostclass :test, :arguments => { :param1 => "blah" } do > > end > > I call from Puppet DSL: > > Try using it in the other way: include test rather than in the parametrized way. > class {"test": > > } > > I get this as an error: > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Puppet::Parser::AST::Resource failed with error NoMethodError: undefined > method `safeevaluate' for "blah":String at > /data/puppet/nbenns/modules/atg/manifests/init.pp:56 on node > > If I add the parameter in its fine. > > If :arguments => { :param1 => "blah" } isn't used as :arguments => { > paramname => default value } > then what is it? > the documentation isn't clear at all on this. > > Thanks. > -- 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/-/CPQDyooO848J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: How to get an input file to a facter ?
On Thursday, July 5, 2012 11:33:03 AM UTC-5, eduardo wrote: > > I need a facter because each node have different users. The facter > return a list of local users that not are into whitelist (unique). > Maybe it would be fruitful to come at this from a different direction. For what purpose do you want this data? There may be a better way to achieve your objective. John -- 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/-/pdZuwQWFJbIJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: How to get an input file to a facter ?
On Thursday, July 5, 2012 10:58:54 AM UTC-5, eduardo wrote: > > Thanks you john for your answer. I comment you something that work > well for me. > > I think get a solution while reading puppet cookbook. It's based on > run stages. > > I have site.pp : > > import 'sync_files.pp' > > Then, sync_files.pp is : > > class sync_files { > notify { "sync whitelist file": } > file { "/etc/puppet/whitelist": > ensure => present, > owner => root, > group => root, > mode => 644, > source => 'puppet:///files/whitelist', > } > } > > And finally insert the following two sentences into class updssh > > stage { "first": before => Stage["main"] } > > class { "sync_files": stage => "first" } > > That's all. Testing results are good enough. > What you have posted does not solve the problem you originally posed. Specifically, it does not cause the whitelist to be updated prior to being processed by facter. Fact collection happens once each cycle, after plugin sync, and before any compilation. A single catalog is then produced and applied, containing all the resources declared in all the stages. Run stages merely affect the order in which resources are applied relative to one another; they cannot make any resources be applied before fact collection. I can only suppose that you are picking up a stale whitelist in your tests. John -- 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/-/E0-7hikA2pAJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Updated Puppet Labs Release Key
Our current release key is expiring on July 9th, so we've extended the expiration of our gpg key to sign our releases and repositories. The keyid of the key has not changed, it is still 4BD6EC30. To obtain the new key, you can use `gpg --refresh-keys` or `gpg --recv-keys 4BD6EC30`. We are also releasing updated versions of our release packages for our apt and yum repositories that will add the updated public key for you. It you are already using those packages, upgrading the package will bring in the updated key. -- Matthaus Litteken Release Manager, Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: Double quotes within an exec statement
Hey Guys, Thanks for the input. Your comments were most helpful and I definitely get it now. I realize that the way I'm going about doing this one probably isn't the most desirable and as soon as I have my important manifests working in a basic state, I'll come back to each one and fix them up. Thanks again for the help. Cheers, Mike On Thursday, July 5, 2012 1:23:47 PM UTC-7, Mike Reed wrote: > > Hello all, > > I've been trying to run this exec statement (which to my peril was > initially thought to be something simple): > > exec { "/opt/pbis/bin/config UserDomainPrefix "" " : } > > After the command is run I'm getting the following error: > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Syntax error at '' '; expected '}' at > /etc/puppet/modules/powerbroker_install/manifests/init.pp:20 on node > sbxwk-blackhole.sbx.leiproductions.com > > I need to run the command with the double quotes as the value of > UserDomainPrefix but I'm having a hard time getting this one to run. I > figured if I changed to the command below, puppet wouldn't interpret the > double quotes and things would work but I was quite wrong. > > exec { " '/opt/pbis/bin/config UserDomainPrefix "" ' " : } > > Does anybody have any suggestions as to how one might run an exec with > double quotes? > > As always, thanks for the help in advance. > > Cheers, > > Mike > > > -- 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/-/TxrnTcgquB4J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: How to get an input file to a facter ?
On Thursday, July 5, 2012 11:16:56 AM UTC-5, eduardo wrote: > > John the whitelist is a dynamic file create/update by administrators, > so puppetmaster don't know about whilelist's content. > If the file is served by the master, then the master can know whatever it needs to know about its content. Ideally, Puppet would have the data in raw form, so as to generate the file for nodes, but it can also be made to parse the file it's about to serve by any one of several means. For example, you can call a parsing script (or maybe just 'cat') via the generate() function. Or if the file is generated via a template then you can store the generated content in a class variable, or else just process the template again. Or you can write a class in Ruby DSL that does pretty much anything you want. > I pretending to get advantage of fileserver funcionality (instead of > any other remote copy tool like rsync) in order to get centralized > copy of the file whitelist to all nodes. > Serving the file via Puppet is a perfectly fine and appropriate thing to do. The point, however, is that the file doesn't need to have already been served for the master (who is serving it) to know what's in it. Facter is the wrong way to get at the data in that case. John -- 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/-/FxJo4gyWB50J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Built in rollback features
Hi Everyone, I am relativly new to writing puppet modules, and am working to architecht our puppet implementation. One of the questions I have, is rolling back a puppet run. What are the best ways to accomplish this. For instance, if I add a module to manage autofs, apply it to a server, and then no longer want to manage autofs on the server, how would I make it so that I can roll the server back to the unconfigured state? Also, when managing local account using puppet, what are ideas to handle the following case:Users A, B and C are added to all our servers. After running for some time, we need to only remove User B. I have read on multiple blogs about having !classes, but I want to try and work towards using more of an industry standard and wanted to get other peoples opinions. Thanks! Chuck -- 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/-/uPGycpyKnEsJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: Double quotes within an exec statement
On Thursday, July 5, 2012 3:23:47 PM UTC-5, Mike Reed wrote: > > Hello all, > > I've been trying to run this exec statement (which to my peril was > initially thought to be something simple): > > exec { "/opt/pbis/bin/config UserDomainPrefix "" " : } > > After the command is run I'm getting the following error: > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Syntax error at '' '; expected '}' at > /etc/puppet/modules/powerbroker_install/manifests/init.pp:20 on node > sbxwk-blackhole.sbx.leiproductions.com > The double quotes around the command's second argument are being interpreted as the end of the resource title. The easiest solution is probably to switch the outer quotes to single: exec { '/opt/pbis/bin/config UserDomainPrefix "" ' : } Indeed, it's a good idea to make a habit of using single quotes instead of double quotes in your Puppet manifests, except where you have specific reason to do otherwise (such as when you want to interpolate a variable into your string). Alternatively, you should also be able to escape the internal double quotes with backslashes: exec { "/opt/pbis/bin/config UserDomainPrefix \"\" " : } John -- 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/-/8EJr4qDJEJUJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Double quotes within an exec statement
escape your inner quotes \" \" exec { "/opt/pbis/bin/config UserDomainPrefix \"\" " : } On Thu, Jul 5, 2012 at 1:23 PM, Mike Reed wrote: > Hello all, > > I've been trying to run this exec statement (which to my peril was initially > thought to be something simple): > > exec { "/opt/pbis/bin/config UserDomainPrefix "" " : } > > After the command is run I'm getting the following error: > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Syntax error at '' '; expected '}' at > /etc/puppet/modules/powerbroker_install/manifests/init.pp:20 on node > sbxwk-blackhole.sbx.leiproductions.com > > I need to run the command with the double quotes as the value of > UserDomainPrefix but I'm having a hard time getting this one to run. I > figured if I changed to the command below, puppet wouldn't interpret the > double quotes and things would work but I was quite wrong. > > exec { " '/opt/pbis/bin/config UserDomainPrefix "" ' " : } > > Does anybody have any suggestions as to how one might run an exec with > double quotes? > > As always, thanks for the help in advance. > > Cheers, > > Mike > > > -- > 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/-/nDswUwx_4tsJ. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Double quotes within an exec statement
On Thu, Jul 05, 2012 at 01:23:47PM -0700, Mike Reed wrote: >Hello all, > >I've been trying to run this exec statement (which to my peril was >initially thought to be something simple): > >exec { "/opt/pbis/bin/config UserDomainPrefix "" " : } Escape the inside double quotes: $ cat /tmp/2.pp notice("\"this is quoted\"") notice("this is not quoted") $ puppet apply /tmp/2.pp notice: Scope(Class[main]): "this is quoted" notice: Scope(Class[main]): this is not quoted >After the command is run I'm getting the following error: > >err: Could not retrieve catalog from remote server: Error 400 on SERVER: >Syntax error at '' '; expected '}' at >/etc/puppet/modules/powerbroker_install/manifests/init.pp:20 on node >sbxwk-blackhole.sbx.leiproductions.com > >I need to run the command with the double quotes as the value of >UserDomainPrefix but I'm having a hard time getting this one to run. I >figured if I changed to the command below, puppet wouldn't interpret the >double quotes and things would work but I was quite wrong. > >exec { " '/opt/pbis/bin/config UserDomainPrefix "" ' " : } Better, if you're using the literal: exec { '/opt/pbis/bin/config UserDomainPrefix "" ': } But you'd save yourself the trouble by emplacing a shell script and running that. >Does anybody have any suggestions as to how one might run an exec with >double quotes? > >As always, thanks for the help in advance. > >Cheers, > >Mike > >-- >You received this message because you are subscribed to the Google Groups >"Puppet Users" group. >To view this discussion on the web visit >[1]https://groups.google.com/d/msg/puppet-users/-/nDswUwx_4tsJ. >To post to this group, send email to puppet-users@googlegroups.com. >To unsubscribe from this group, send email to >puppet-users+unsubscr...@googlegroups.com. >For more options, visit this group at >http://groups.google.com/group/puppet-users?hl=en. > > References > >Visible links >1. https://groups.google.com/d/msg/puppet-users/-/nDswUwx_4tsJ -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Double quotes within an exec statement
Hello all, I've been trying to run this exec statement (which to my peril was initially thought to be something simple): exec { "/opt/pbis/bin/config UserDomainPrefix "" " : } After the command is run I'm getting the following error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '' '; expected '}' at /etc/puppet/modules/powerbroker_install/manifests/init.pp:20 on node sbxwk-blackhole.sbx.leiproductions.com I need to run the command with the double quotes as the value of UserDomainPrefix but I'm having a hard time getting this one to run. I figured if I changed to the command below, puppet wouldn't interpret the double quotes and things would work but I was quite wrong. exec { " '/opt/pbis/bin/config UserDomainPrefix "" ' " : } Does anybody have any suggestions as to how one might run an exec with double quotes? As always, thanks for the help in advance. Cheers, Mike -- 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/-/nDswUwx_4tsJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: proper usage of global variables / node variables / +=
On 07/05/2012 08:30 AM, jcbollinger wrote: Thank you very much for the response, I am going over it in detail and trying out all of the options you have presented (this may take me a couple days). I will reply again once I have gone over your message in more detail. If that's so then you are relying on a Puppet bug, or perhaps you have oversimplified your example. The language guide specifically states that the += operator affects the observed value of the affected variable only in the scope where the plussignment is performed. You definitely should not see the modified value in classes that are not declared in the scope of the plussignment. Cool! Let's find out. Here is a working tiny example: node my_standard { $pkg_list += 'one two three ' } node 'testnode' inherits my_standard { include my_test1 include my_test2 } class my_test1 { $pkg_list += 'four five ' notify {"pkg_list=$pkg_list":} notice("pkg_list=$pkg_list") } class my_test2 { $pkg_list += 'six seven ' notify {"pkg_list=$pkg_list":} notice("pkg_list=$pkg_list") } The output when run on testnode: notice: /Stage[main]/My_test1/Notify[pkg_list=one two three four five ]/message: defined 'message' as 'pkg_list=one two three four five ' notice: /Stage[main]/My_test2/Notify[pkg_list=one two three four five six seven ]/message: defined 'message' as 'pkg_list=one two three four five six seven ' So, the my_test2 scope does have the changes from the my_test1 scope. Using puppet-server 2.7.9-1 (epel version). As the guy who has many modules that use this bug, I like it's functionality :) Should I file a bug report? Again thank you for the reply. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Ruby DSL parameterized classes and defaults
I've been reading the Docs on this, and its not very clear. I want to have a parameterized class that takes arrays and objects as parameters. I'm using puppet 2.6.16. I define a hostclass like this: hostclass :test, :arguments => { :param1 => "blah" } do end I call from Puppet DSL: class {"test": } I get this as an error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error NoMethodError: undefined method `safeevaluate' for "blah":String at /data/puppet/nbenns/modules/atg/manifests/init.pp:56 on node If I add the parameter in its fine. If :arguments => { :param1 => "blah" } isn't used as :arguments => { paramname => default value } then what is it? the documentation isn't clear at all on this. Thanks. -- 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/-/f4AQx0T8Wv4J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] can puppet-dashboard be installed on CentOS 5.4?
does it mean that after I upgraded Ruby to 1.8.7 version, then I can just use the rpm for EL6 to install the dashboard, or I have to install from source? On Tue, Jul 3, 2012 at 4:24 PM, Michael Stahnke wrote: > Puppet Dashboard *can* be installed on EL 5 based systems if you've > updated Ruby to a 1.8.7 version. By default, EL5 comes with 1.8.5 > versions of ruby which have known issues with Dashboard. If you > search the archives of this list, there are a few posts about getting > 1.8.7 onto EL5 specifically for dashboard. > > Mike > > > On Tue, Jul 3, 2012 at 1:13 PM, Hai Tao wrote: > > Hi, > > > > I am trying to install puppet-dashboard on my puppet server, which is > > running CentOS 5.4. However, I cannot find a RPM for REHL 5 on > > http://yum.puppetlabs.com/. > > > > So the question is how I can get the puppet-dashboard rpm for CentOS > 5.4? > > Thanks. > > > > Hai Tao > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Puppet Users" group. > > To post to this group, send email to puppet-users@googlegroups.com. > > To unsubscribe from this group, send email to > > puppet-users+unsubscr...@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/puppet-users?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > -- Hai Tao -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] can nodes be grouped with IP address?
Hi, On Thu, 5 Jul 2012 11:34:39 -0700 Hai Tao wrote: > instead of using hostname wildcard, is there a way to define nodes by their > IP addresses? for example, I want to put all nodes with 10.0.2.x and > 10.0.3.0 to a nodes group called "testing". how can I do this? > > thanks. Seems a bit backwards to me (you're the ones assigning the IP addresses afterall) but I don't see why you couldn't do this with a custom fact and a class that reads it. Cheers, Steph -- Steph Gosling -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] can nodes be grouped with IP address?
instead of using hostname wildcard, is there a way to define nodes by their IP addresses? for example, I want to put all nodes with 10.0.2.x and 10.0.3.0 to a nodes group called "testing". how can I do this? thanks. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] hash to_yaml in erb template not giving valid yaml
On Thu, Jul 05, 2012 at 05:43:10PM +0200, Martin Willemsma wrote: > Hi, > > I want to use a file resource to write a facts.yaml file for > Mcollective. For some reason it won't provide a valid yaml format if I > dump my scope to hash and convert to_yaml. > > file { > "/etc/mcollective/facts.yaml" : > owner => root, > group => root, > mode => 400, > loglevel => debug, > #content => inline_template("<%= scope.to_hash.reject { > |k,v| !( > k.is_a?(String) && v.is_a?(String) ) }.to_yaml %>"), > > #content => inline_template("<%= { \"a\" => 1, \"b\"=> > 2}.to_yaml %>"), > content => > inline_template("<%= facts = {}; > scope.to_hash.each_pair {|k,v| > facts[k.to_s] = v.to_s unless k.to_s =~ > /pkg_|_hours|_seconds|memoryfree|plugin_|config|_timestamp/ }; > facts.to_yaml.sort %>"), > } > The to_yaml output should start with a "---\n" line, but if you sort your list (BTW: I get an error on ruby 1.9 when I call sort on a string) you may produce an invalid yaml file if the "---" is not on top anymore. -Stefan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: Nvidia driver install - condition for install
Hey All, I got moved onto another project and I hadn't been able to get back to this one until today. I first wanted to thank you all for the information and suggestions. I'll take a look and see what I can do and I'll be sure to let everybody know what the outcome is. I like Nan's suggestion about a custom fact but I'm not quite there in my knowledge yet so I suspect I'll use some mix of a relation and a simple "if" statement. Cheers, Mike On Friday, June 29, 2012 11:29:57 AM UTC-7, Mike Reed wrote: > > Hello all, > > I'd like to use puppet to install an Nvidia driver on a local workstation. > I've written the following manifest for this puprpose: > > class nvidia_driver { > # This will place the nvidia installer locally in /tmp. File is > pulled from puppet. > file { "/tmp/NVIDIA-Linux-x86_64-295.53.run" : > source => > "puppet:///modules/nvidia_driver/NVIDIA-Linux-x86_64-295.53.run" , > ensure => present , > } > > # This will run the nvidia installer locally on the machine. > exec { "/tmp/NVIDIA-Linux-x86_64-295.53.run -s -X --opengl-headers > --no-distro-scripts --force-tls-compat32=new" : } > > } > > Upon the initial run of the manifest on the target machine, everything > works great (although I do believe there is some room for improvement of > the code above; particularly on the exec portion) and the driver then gets > installed. The issue occurs on subsequent puppet runs on the same machine > and I'm getting the following error during my second puppet run from the > client: > > err: /Stage[main]/Nvidia_driver/Exec[/tmp/NVIDIA-Linux-x86_64-295.53.run > -s -X --opengl-headers --no-distro-scripts > --force-tls-compat32=new]/returns: change from notrun to 0 failed: > /tmp/NVIDIA-Linux-x86_64-295.53.run -s -X --opengl-headers > --no-distro-scripts --force-tls-compat32=new returned 1 instead of one of > [0] at /etc/puppet/modules/nvidia_driver/manifests/init.pp:12 > > It appears to me that the above error is occurring because the > nvidia_driver class is running on each subsequent run and since the driver > is already installed, I'm getting an exit status of 1 instead of 0, which > to my knowledge would be expected. > > So, what I'd like to do is put some sort of condition that will look to > see if the driver is installed and if it is, the class "nvidia_driver" > won't run. I'm having a hard time figuring this one out and I was hoping > to get a few opinions on how this might be accomplished. > > Would this potentially be a job for a shell script that does the checking? > Maybe just adding the shell script into the "nvidia_driver" manifest? > > Thanks in advance for everybody's assistance and the help is very much > appreciated. > > Cheers, > > Mike > -- 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/-/Qf-UpAH1cLcJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: How to get an input file to a facter ?
I need a facter because each node have different users. The facter return a list of local users that not are into whitelist (unique). whitelist = Array.new File.readlines("/etc/puppet/whitelist").each { |line| whitelist << line.chomp } locals = Array.new Etc.passwd {|u| locals << u.name unless u.dir[0,5] != "/ home" } ret = locals - whitelist ret.join(',') On 5 jul, 12:16, eduardo wrote: > John the whitelist is a dynamic file create/update by administrators, > so puppetmaster don't know about whilelist's content. > I pretending to get advantage of fileserver funcionality (instead of > any other remote copy tool like rsync) in order to get centralized > copy of the file whitelist to all nodes. > > Regards, > eduardo. > > On 5 jul, 11:58, eduardo wrote: > > > > > > > > > Thanks you john for your answer. I comment you something that work > > well for me. > > > I think get a solution while reading puppet cookbook. It's based on > > run stages. > > > I have site.pp : > > > import 'sync_files.pp' > > > Then, sync_files.pp is : > > > class sync_files { > > notify { "sync whitelist file": } > > file { "/etc/puppet/whitelist": > > ensure => present, > > owner => root, > > group => root, > > mode => 644, > > source => 'puppet:///files/whitelist', > > } > > > } > > > And finally insert the following two sentences into class updssh > > > stage { "first": before => Stage["main"] } > > > class { "sync_files": stage => "first" } > > > That's all. Testing results are good enough. > > > Regards, > > eduardo. > > > On 5 jul, 11:43, jcbollinger wrote: > > > > On Wednesday, July 4, 2012 2:37:06 PM UTC-5, eduardo wrote: > > > > > To be more clear about my first intend. it had init.pp like : > > > > > file { "/etc/puppet/whitelist": > > > > ensure => present, > > > > source => 'puppet:///files/whitelist', > > > > } > > > > > $users_local = split($localusers, '[,]') > > > > > - facter > > > > require 'etc' > > > > > Facter.add("localusers") do > > > > setcode do > > > > > # Whitelist users to exclude for checking valid ssh users > > > > > whitelist = Array.new > > > > > File.readlines("/etc/puppet/whitelist").each { |line| > > > > > whitelist << line.chomp > > > > } > > > > - > > > > > On 4 jul, 15:07, eduardo wrote: > > > > > Dears all, > > > > > > I was testing my localusers facter by puppetmaster fileserver but i'd > > > > > got in error > > > > > > Could not retrieve localusers: No such file or directory - /etc/ > > > > > puppet/whitelist > > > > > > I was pretending the file was served by fileserver of puppetmaster > > > > > doing in init.pp : > > > > > > file { "/etc/puppet/whitelist": > > > > > ensure => present, > > > > > > Just before to call a facter. > > > > > > I don't pretty sure but seems to me a issue about workflow > > > > > > Client pluginsync -> Client discover system Facts -> Master > > > > > compilation -> Client apply catalog -> Client report. > > > > > > Is there any way to get a file from puppetmaster to be read it by a > > > > > facter ?. > > > > > > If it's not, I appreciate any suggestion about it. > > > > Facter runs after pluginsync (if enabled) and before any resources (such > > > as > > > your whitelist file) are synchronized. It must be so because the master > > > needs the node facts to compile a catalog, and the agent uses the catalog > > > to synchronize resources. > > > > What you are attempting to do sounds dubious, however. If the master > > > knows > > > what users are supposed to be whitelisted (in order to provide the needed > > > file) then it shouldn't need facter to tell it. > > > > John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Re: Identifying host OS in an ENC
On Thu, Jul 5, 2012 at 4:56 PM, jcbollinger wrote: > Are you sure a Puppet run needs to have already completed before the facts > are available from the inventory service? That would be surprising. Also > most unfortunate, inasmuch as it implies that the inventory service would be > serving stale facts (from a previous run) to your ENC. Well, no, to be honest, I'm not sure how the facts are made available to the ENC/inventory service. >From what you've written above, I assume the order of events is: 1) puppet agent runs 2) puppet agent gathers facts 3) puppet agent stores facts in inventory service 4) puppet server uses facts during compilation and application of the catalog? If that's the case, then all is good, I guess. Thanks, Matt. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: How to get an input file to a facter ?
John the whitelist is a dynamic file create/update by administrators, so puppetmaster don't know about whilelist's content. I pretending to get advantage of fileserver funcionality (instead of any other remote copy tool like rsync) in order to get centralized copy of the file whitelist to all nodes. Regards, eduardo. On 5 jul, 11:58, eduardo wrote: > Thanks you john for your answer. I comment you something that work > well for me. > > I think get a solution while reading puppet cookbook. It's based on > run stages. > > I have site.pp : > > import 'sync_files.pp' > > Then, sync_files.pp is : > > class sync_files { > notify { "sync whitelist file": } > file { "/etc/puppet/whitelist": > ensure => present, > owner => root, > group => root, > mode => 644, > source => 'puppet:///files/whitelist', > } > > } > > And finally insert the following two sentences into class updssh > > stage { "first": before => Stage["main"] } > > class { "sync_files": stage => "first" } > > That's all. Testing results are good enough. > > Regards, > eduardo. > > On 5 jul, 11:43, jcbollinger wrote: > > > > > > > > > On Wednesday, July 4, 2012 2:37:06 PM UTC-5, eduardo wrote: > > > > To be more clear about my first intend. it had init.pp like : > > > > file { "/etc/puppet/whitelist": > > > ensure => present, > > > source => 'puppet:///files/whitelist', > > > } > > > > $users_local = split($localusers, '[,]') > > > > - facter > > > require 'etc' > > > > Facter.add("localusers") do > > > setcode do > > > > # Whitelist users to exclude for checking valid ssh users > > > > whitelist = Array.new > > > > File.readlines("/etc/puppet/whitelist").each { |line| > > > > whitelist << line.chomp > > > } > > > - > > > > On 4 jul, 15:07, eduardo wrote: > > > > Dears all, > > > > > I was testing my localusers facter by puppetmaster fileserver but i'd > > > > got in error > > > > > Could not retrieve localusers: No such file or directory - /etc/ > > > > puppet/whitelist > > > > > I was pretending the file was served by fileserver of puppetmaster > > > > doing in init.pp : > > > > > file { "/etc/puppet/whitelist": > > > > ensure => present, > > > > > Just before to call a facter. > > > > > I don't pretty sure but seems to me a issue about workflow > > > > > Client pluginsync -> Client discover system Facts -> Master > > > > compilation -> Client apply catalog -> Client report. > > > > > Is there any way to get a file from puppetmaster to be read it by a > > > > facter ?. > > > > > If it's not, I appreciate any suggestion about it. > > > Facter runs after pluginsync (if enabled) and before any resources (such as > > your whitelist file) are synchronized. It must be so because the master > > needs the node facts to compile a catalog, and the agent uses the catalog > > to synchronize resources. > > > What you are attempting to do sounds dubious, however. If the master knows > > what users are supposed to be whitelisted (in order to provide the needed > > file) then it shouldn't need facter to tell it. > > > John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: Filebucket with SVN
On Wednesday, July 4, 2012 1:10:53 AM UTC-5, Tharanga Abeyseela wrote: > > Hello folks, > > I like to store all my configuration archives (Client file changes) on a > SVN or GIT repository instead of a local file system. currently i am using > following config to store all backups (client file changes) on my > puppetmaster server > > filebucket { puppet: > server => puppet-master, > path => false, > } > > > How can i redirect all filebucket operations to the SVN or GIT repository. > You can make the master's filebucket directory a working copy of an SVN or GIT repository, but you cannot easily make the agent check in changes. Are you sure you even want this, though? Filebucketed files are identified by their checksums rather than their names, so a source control system is only going to give you storage, not revision history. You can get the same, more easily, simply by ensuring that the filebucket directory is regularly backed up. John -- 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/-/6Yyl7OBPhwcJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: How to get an input file to a facter ?
Thanks you john for your answer. I comment you something that work well for me. I think get a solution while reading puppet cookbook. It's based on run stages. I have site.pp : import 'sync_files.pp' Then, sync_files.pp is : class sync_files { notify { "sync whitelist file": } file { "/etc/puppet/whitelist": ensure => present, owner => root, group => root, mode => 644, source => 'puppet:///files/whitelist', } } And finally insert the following two sentences into class updssh stage { "first": before => Stage["main"] } class { "sync_files": stage => "first" } That's all. Testing results are good enough. Regards, eduardo. On 5 jul, 11:43, jcbollinger wrote: > On Wednesday, July 4, 2012 2:37:06 PM UTC-5, eduardo wrote: > > > To be more clear about my first intend. it had init.pp like : > > > file { "/etc/puppet/whitelist": > > ensure => present, > > source => 'puppet:///files/whitelist', > > } > > > $users_local = split($localusers, '[,]') > > > - facter > > require 'etc' > > > Facter.add("localusers") do > > setcode do > > > # Whitelist users to exclude for checking valid ssh users > > > whitelist = Array.new > > > File.readlines("/etc/puppet/whitelist").each { |line| > > > whitelist << line.chomp > > } > > - > > > On 4 jul, 15:07, eduardo wrote: > > > Dears all, > > > > I was testing my localusers facter by puppetmaster fileserver but i'd > > > got in error > > > > Could not retrieve localusers: No such file or directory - /etc/ > > > puppet/whitelist > > > > I was pretending the file was served by fileserver of puppetmaster > > > doing in init.pp : > > > > file { "/etc/puppet/whitelist": > > > ensure => present, > > > > Just before to call a facter. > > > > I don't pretty sure but seems to me a issue about workflow > > > > Client pluginsync -> Client discover system Facts -> Master > > > compilation -> Client apply catalog -> Client report. > > > > Is there any way to get a file from puppetmaster to be read it by a > > > facter ?. > > > > If it's not, I appreciate any suggestion about it. > > Facter runs after pluginsync (if enabled) and before any resources (such as > your whitelist file) are synchronized. It must be so because the master > needs the node facts to compile a catalog, and the agent uses the catalog > to synchronize resources. > > What you are attempting to do sounds dubious, however. If the master knows > what users are supposed to be whitelisted (in order to provide the needed > file) then it shouldn't need facter to tell it. > > John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: Identifying host OS in an ENC
On Wednesday, July 4, 2012 8:20:51 AM UTC-5, Matthew Burgess wrote: > > Hi all, > > We have a mixed Linux and Windows environment and have so far just > been using Puppet on our Linux servers. Having configured the > inventory service, we've got an auditing script that uses the data to > report on things like OS version, RAM, etc. This is all so nice that > we'd like to extend it to auditing our Windows infrastructure. > However, at this point in time, we have no need to apply any manifests > to those Windows servers, and they're all Linux-centric anyway. > > I've installed the puppet agent on a Windows server but when it starts > it obviously tries to apply all the manifests the ENC tells it to > (there's a default set of classes that all servers up until now have > applied). I think the correct way to tackle this is to have the first > run of the agent use the 'noop' parameter, that way the cert exchange > will take place, and the facts will be populated, but no classes will > be applied. On subsequent runs, the ENC can use the aforementioned > inventory service to inspect the 'operatingsystem' fact to determine > whether or not to apply any classes. > Are you sure a Puppet run needs to have already completed before the facts are available from the inventory service? That would be surprising. Also most unfortunate, inasmuch as it implies that the inventory service would be serving stale facts (from a previous run) to your ENC. The old-school way of accessing node facts from an ENC was to load the master's YAML-formatted fact cache. You could fall back to that if the inventory service really doesn't meet your first-run needs. John -- 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/-/u7fssAmrISYJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: How to get an input file to a facter ?
On Wednesday, July 4, 2012 2:37:06 PM UTC-5, eduardo wrote: > > To be more clear about my first intend. it had init.pp like : > > file { "/etc/puppet/whitelist": > ensure => present, > source => 'puppet:///files/whitelist', >} > > $users_local = split($localusers, '[,]') > > > > - facter > require 'etc' > > Facter.add("localusers") do > setcode do > ># Whitelist users to exclude for checking valid ssh users > >whitelist = Array.new > >File.readlines("/etc/puppet/whitelist").each { |line| > >whitelist << line.chomp >} > - > > > > On 4 jul, 15:07, eduardo wrote: > > Dears all, > > > > I was testing my localusers facter by puppetmaster fileserver but i'd > > got in error > > > > Could not retrieve localusers: No such file or directory - /etc/ > > puppet/whitelist > > > > I was pretending the file was served by fileserver of puppetmaster > > doing in init.pp : > > > > file { "/etc/puppet/whitelist": > >ensure => present, > > > > Just before to call a facter. > > > > I don't pretty sure but seems to me a issue about workflow > > > > Client pluginsync -> Client discover system Facts -> Master > > compilation -> Client apply catalog -> Client report. > > > > Is there any way to get a file from puppetmaster to be read it by a > > facter ?. > > > > If it's not, I appreciate any suggestion about it. > Facter runs after pluginsync (if enabled) and before any resources (such as your whitelist file) are synchronized. It must be so because the master needs the node facts to compile a catalog, and the agent uses the catalog to synchronize resources. What you are attempting to do sounds dubious, however. If the master knows what users are supposed to be whitelisted (in order to provide the needed file) then it shouldn't need facter to tell it. John -- 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/-/1DOQXx9ya-IJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] hash to_yaml in erb template not giving valid yaml
Hi, I want to use a file resource to write a facts.yaml file for Mcollective. For some reason it won't provide a valid yaml format if I dump my scope to hash and convert to_yaml. file { "/etc/mcollective/facts.yaml" : owner => root, group => root, mode => 400, loglevel => debug, #content => inline_template("<%= scope.to_hash.reject { |k,v| !( k.is_a?(String) && v.is_a?(String) ) }.to_yaml %>"), #content => inline_template("<%= { \"a\" => 1, \"b\"=> 2}.to_yaml %>"), content => inline_template("<%= facts = {}; scope.to_hash.each_pair {|k,v| facts[k.to_s] = v.to_s unless k.to_s =~ /pkg_|_hours|_seconds|memoryfree|plugin_|config|_timestamp/ }; facts.to_yaml.sort %>"), } After a run the content is indented with 2 spaces and some facts give me garbage values. If I verify this on e.g. http://yamllint.com/ I have a syntax error with the 2 leading spaces. Snippet from '/etc/mcollective/facts.yaml' [root~]# cat /etc/mcollective/facts.yaml architecture: &id001 x86_64 hardwareisa: x86_64 hardwaremodel: *id001 kernelrelease: 2.6.18-274.17.1.el5xen clientversion: *id002 kernelversion: 2.6.18 lsbdistcodename: Final lsbdistdescription: CentOS release 5.8 (Final) lsbdistid: CentOS lsbdistrelease: "5.8" lsbmajdistrelease: "5" I did some debugging on the IRB. On the commandline I do get the expected format. To me it seems the to_yaml is not working for me in combination with inline template. What is causing the extra leading spaces? irb irb(main):001:0> h = { "a" => 1 , "b" => 2 } => {"b"=>2, "a"=>1} irb(main):002:0> require "yaml" => true irb(main):003:0> h.to_yaml => "--- \nb: 2\na: 1\n" irb(main):004:0> I see several snippets on the internets to write a facts.yaml file to be used with Mcollective. None of them work for me. Puppet version: 2.7.12 OS: Ubuntu 10.04 Any hints on how to fix this issue? --- kind regards, Martin Willemsma -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: How to make send in a "q" when a screen shows up from exec?
On Wednesday, July 4, 2012 6:01:02 PM UTC-5, Benjamin Lei wrote: > > So I'm trying to exec something, but during the exec a screen will show up > that I need to "q" out of to finish it. Specifically speaking, I'm trying > to exec: rvm --force install 1.8.7 Ideally, there would be a command-line option to suppress the screen or provide the needed answer automatically. Most command-line based installers have such a thing in order to make them scriptable. If rvm doesn't provide that option then you might be able to pipe in the needed input: 'echo q | rvm --force install 1.8.7'. In that case make sure the Exec uses the 'sh' provider. John -- 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/-/cxRiu-1lCIAJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: proper usage of global variables / node variables / +=
On Thursday, July 5, 2012 5:34:13 AM UTC-5, fpee wrote: > > Hello puppet masters, I am cleaning up some puppet modules, using > puppet-lint. The warning I am getting is: > > top-scope variable being used without an explicit namespace > > I can turn this particular check off, but in doing my research I'm > finding all sorts of messages saying to avoid using += Good advice. > , to avoid using > variables in the node scope, Good advice, but sometimes difficult to apply. > and to switch to a parameterized class > whenever possible. Bad, *bad* advice. PuppetLabs did a pretty good job of promoting parametrized classes when it first introduced them, but the design was deeply flawed. The idea clashes with Puppet's model of classes as singletons, and the worst of the flaws spring from that mismatch. Only if you're using an ENC should you even consider class parametrization (a manifest set designed with an ENC in mind can in principle overcome the worst problems attending class parametrization), but think twice even then. Puppet 3 does better by tying class parameters to hiera, allowing class parameters to serve as a structured shortcut to external data, and providing a means to wean all the poor folks that invested development time in parametrized classes. Even if you're aiming for Puppet 3, however, your effort would be better spent on externalizing data for access via hiera than on parametrizing your classes. > Okay, I'm game. > > So, to understand what I'm doing, I'm setting up a yum repository and > limiting the includepkgs line to the very minimum amount of packages for > reasons of security / policy / insanity / etc. > > Here is the current implementation of this (which works fine). > > node standard { >$epel_includepkgs += 'puppet augeas-libs facter ruby-augeas ruby-shadow > ' >class { 'repo_epel': stage => 'pre' } >#other stuff > } > The worst thing about run stages in Puppet 2 is that you can only use them via the parametrized class syntax, which brings the worst problems of parametrized classes even to non-parametrized classes. Of course, run stages are purely syntactic sugar anyway. > node 'my.node1' inherits standard { >include denyhosts > } > > node 'my.node2' inherits standard { >include denyhosts >include gitlabhq > } > > class repo_epel { >yumrepo { 'epel': > enabled => 1, > descr => 'Extra Packages for Enterprise Linux 6 - > \$basearch', > mirrorlist => > 'https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=\$basearch', > failovermethod => priority, > gpgcheck=> 1, > gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6', > require => File['/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6'], > includepkgs => $epel_includepkgs, >} ># other stuff > } > > class denyhosts { >$epel_includepkgs += 'denyhosts ' ># other stuff > } > > class gitlabhq { >$epel_includepkgs += 'libyaml gitolite git-all rvm ' ># other stuff > } > > my.node1, and my.node2 will have different (and correct) includepkgs > doing it this way (I have like .. 30+ modules for epel and more of other > repos to give you an idea) > If that's so then you are relying on a Puppet bug, or perhaps you have oversimplified your example. The language guide specifically states that the += operator affects the observed value of the affected variable only in the scope where the plussignment is performed. You definitely should not see the modified value in classes that are not declared in the scope of the plussignment. > To get rid of the error I tried making the variable $::epel_includepkgs, > but that generates the error: > err: Could not parse for environment production: Cannot assign to > variables in other #namespaces Right, because plussignment doesn't change the values of existing variables. It merely shadows those values with supplemented ones, and only within the scope where the plussignment appears. Dynamic scoping allows classes and resources to see that local value when their declarations appear in the same scope or a deeper-nested one, but that's a problem because classes can be included more than once, from different scopes. If those scopes provide different values for the same, needed variable then which one does such a class use? For all intents and purposes, it's unpredictable. > So what is the 'proper' puppet way to accomplish this? > Puppet DSL does not provide a mechanism for constructing values incrementally. Even what you're currently doing probably doesn't work quite the way you think it does. There are ways to approach it if you can assume strict nesting of all the scopes that are expected to contribute values, but that's not your case. One messy, but valid way to do this might be to manage the inclusion of packages in a repo's includepkgs via instances of a
Re: [Puppet Users] Automated deployment with puppet
Use the file resource to put your jar somewhere useful, and then have the file resource notify the tomcat daemon's service resource to restart/reload the daemon. http://docs.puppetlabs.com/references/stable/type.html#file http://docs.puppetlabs.com/references/stable/type.html#service http://docs.puppetlabs.com/guides/language_guide.html#resources On Thu, Jul 05, 2012 at 08:01:51AM -0700, mouhcine MOULOU wrote: >Hi , >I am new to Puppet and I just started testing it on my Debian OS, I was >wondering if it's possible to create an artifact that allows >auto-deploying jar file without using SSH & SCP? >I Found some Threads explaining how to deploy web application on Tomcat >Server, but i need to deploy a simple Jar on my platform >Thanks, >Mouhcine > >-- >You received this message because you are subscribed to the Google Groups >"Puppet Users" group. >To view this discussion on the web visit >[1]https://groups.google.com/d/msg/puppet-users/-/AXGAVcaFY-cJ. >To post to this group, send email to puppet-users@googlegroups.com. >To unsubscribe from this group, send email to >puppet-users+unsubscr...@googlegroups.com. >For more options, visit this group at >http://groups.google.com/group/puppet-users?hl=en. > > References > >Visible links >1. https://groups.google.com/d/msg/puppet-users/-/AXGAVcaFY-cJ -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Automated deployment with puppet
Hi , I am new to Puppet and I just started testing it on my Debian OS, I was wondering if it's possible to create an artifact that allows auto-deploying jar file without using SSH & SCP? I Found some Threads explaining how to deploy web application on Tomcat Server, but i need to deploy a simple Jar on my platform Thanks, Mouhcine -- 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/-/AXGAVcaFY-cJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Automated deployement with puppet
Hi , I am new to Puppet and I just started testing it on my Debian OS, I was wondering if it's possible to create an artifact that allows auto-deploying jar file without using SSH & SCP? I Found some threads explaining how to deploy web application on Tomcat Server, but i need to deploy a simple Jar on my platform Thanks, Mouhcine -- 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/-/J7Os3wlMbfQJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Aptitude uninstalls puppet package when installing bind9
Hi Puppeteers, I wonder if anyone else has seen or fixed this issue - I find that when I provision new servers, after the first run I have to manually re-run 'apt-get install puppet', as it gets removed. Nothing in the puppet log, however in the aptitude log there is an entry like the below (terse - see end of post). It seems that when aptitude installs bind9, it decides to remove puppets dependencies because they're not in use, and then remove puppet because it's a dependency of them. My bind9 module is pretty simple, and the only packages it specifies are simply: package { "bind9": ensure => installed, require => User [ "bind" ], } package { "bind9utils": ensure => installed, require => Package["bind9"]; } I'm running 'puppet apply' against a git clone of our repository rather than a master/agent. It only seems to happen once, but this is a bit of a concern for me - I can recover from pretty much anything else by relying on puppet, but when the puppet package is removed? Iiiee Aptitude log: Aptitude 0.6.4: log report Wed, Jul 4 2012 23:37:40 + IMPORTANT: this log only lists intended actions; actions which fail due to dpkg problems may not be completed. Will install 8 packages, and remove 17 packages. 15.9 MB of disk space will be freed === [REMOVE, NOT USED] augeas-lenses [REMOVE, NOT USED] libaugeas-ruby1.8 [REMOVE, NOT USED] libaugeas0 [REMOVE, NOT USED] libreadline5 [REMOVE, NOT USED] libruby [REMOVE, NOT USED] libruby1.8 [REMOVE, NOT USED] libshadow-ruby1.8 [REMOVE, NOT USED] ruby [REMOVE, NOT USED] ruby1.8 [HOLD, DEPENDENCIES] gir1.2-gudev-1.0 [HOLD, DEPENDENCIES] libgudev-1.0-0 [HOLD, DEPENDENCIES] libmagickcore3 [HOLD, DEPENDENCIES] libmysqlclient16 [HOLD, DEPENDENCIES] libpq5 [HOLD, DEPENDENCIES] libsnmp-base [HOLD, DEPENDENCIES] libsnmp15 [HOLD, DEPENDENCIES] libwbclient0 [HOLD, DEPENDENCIES] mysql-common [HOLD, DEPENDENCIES] samba-common [HOLD, DEPENDENCIES] samba-common-bin [HOLD, DEPENDENCIES] smbclient [HOLD, DEPENDENCIES] snmp [INSTALL, DEPENDENCIES] bind9utils [REMOVE, DEPENDENCIES] avahi-daemon [REMOVE, DEPENDENCIES] bind9-host [REMOVE, DEPENDENCIES] dnsutils [REMOVE, DEPENDENCIES] facter [REMOVE, DEPENDENCIES] libnss-mdns [REMOVE, DEPENDENCIES] puppet [REMOVE, DEPENDENCIES] puppet-common [REMOVE, DEPENDENCIES] ubuntu-standard [HOLD] accountsservice [HOLD] apparmor [HOLD] apt [HOLD] apt-transport-https [HOLD] apt-utils [HOLD] cloud-init [HOLD] dpkg [HOLD] grub-legacy-ec2 [HOLD] gzip [HOLD] landscape-client [HOLD] landscape-common [HOLD] libaccountsservice0 [HOLD] libapt-inst1.3 [HOLD] libapt-pkg4.11 [HOLD] libc-bin [HOLD] libc6 [HOLD] libfreetype6 [HOLD] libgnutls26 [HOLD] libpng12-0 [HOLD] libssl1.0.0 [HOLD] libtasn1-3 [HOLD] libudev0 [HOLD] libxml2 [HOLD] linux-firmware [HOLD] linux-image-3.0.0-16-virtual [HOLD] linux-image-virtual [HOLD] linux-virtual [HOLD] lxcguest [HOLD] mawk [HOLD] multiarch-support [HOLD] nagios-nrpe-server [HOLD] openssl [HOLD] perlmagick [HOLD] python-crypto [HOLD] python-httplib2 [HOLD] python-pam [HOLD] python-pkg-resources [HOLD] python-software-properties [HOLD] sudo [HOLD] tzdata [HOLD] ubuntu-minimal [HOLD] udev [HOLD] update-manager-core [HOLD] upstart [HOLD] vim [HOLD] vim-common [HOLD] vim-runtime [HOLD] vim-tiny [INSTALL] bind9 [UPGRADE] libbind9-60 1:9.7.3.dfsg-1ubuntu4.1 -> 1:9.7.3.dfsg-1ubuntu4.2 [UPGRADE] libdns69 1:9.7.3.dfsg-1ubuntu4.1 -> 1:9.7.3.dfsg-1ubuntu4.2 [UPGRADE] libisc62 1:9.7.3.dfsg-1ubuntu4.1 -> 1:9.7.3.dfsg-1ubuntu4.2 [UPGRADE] libisccc60 1:9.7.3.dfsg-1ubuntu4.1 -> 1:9.7.3.dfsg-1ubuntu4.2 [UPGRADE] libisccfg62 1:9.7.3.dfsg-1ubuntu4.1 -> 1:9.7.3.dfsg-1ubuntu4.2 [UPGRADE] liblwres60 1:9.7.3.dfsg-1ubuntu4.1 -> 1:9.7.3.dfsg-1ubuntu4.2 === Log complete. -- 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/-/QBeyPF6NQjEJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] puppet doc problem.
Comments inline. On Tuesday, July 3, 2012 4:43:52 PM UTC-5, LoreLLo wrote: > > Additionally, when I try to use an rdoc type I either am not getting any >> output or can't find it. >> >> $puppet doc -m rdoc --manifestdir >> /etc/puppet/environments/test/manifests/ --modulepath >> /etc/puppet/environments/test/modules/ --outputdir >> /home//puppetdoc/rdoc/ /etc/puppet/environments/test/manifests/ >> >> ~/puppetdoc/rdoc$ ls -a >> >> > I update my documentation on an hourly basis with something like: > > /usr/bin/puppet doc --all --outputdir=$DOCDIR --mode rdoc > --modulepath=$MODULEPATH > > Are you missing the --all parameter? > It doesn't seem to matter if I use it or not, I still get no output when I use rdoc, and I get errors when I try to make PDFs. So far, only text seems able to generate anything. -- 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/-/WpuhXMUM1lMJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: Identifying host OS in an ENC
Hey Matt, I'm not exactly sure how you have things setup now, but the operating system fact is baked into factor and will be available on the first run. Rather than having the ENC supply your default classes, you could do so in your site.pp. Here's how I do it: stage { 'first': before => Stage['main'] } class { baselinux: stage => 'first' } This makes baselinux run for every node, before anything else, independent of the ENC. It would be easy enough to wrap that in a OS check. We have a similar setup (just starting work on Windows primarily for auditing as well) and decided to use a separate Puppet Master for Windows to keep things clean and other reasons such as different operations teams administering the ENC. hth, Adam p.s. If you haven't explored this, you can do some really cool things with Windows auditing by extending factor and using Ruby's win32/ole libraries (report on video cards, motherboards, etc.) On Jul 4, 8:20 am, Matthew Burgess wrote: > Hi all, > > We have a mixed Linux and Windows environment and have so far just > been using Puppet on our Linux servers. Having configured the > inventory service, we've got an auditing script that uses the data to > report on things like OS version, RAM, etc. This is all so nice that > we'd like to extend it to auditing our Windows infrastructure. > However, at this point in time, we have no need to apply any manifests > to those Windows servers, and they're all Linux-centric anyway. > > I've installed the puppet agent on a Windows server but when it starts > it obviously tries to apply all the manifests the ENC tells it to > (there's a default set of classes that all servers up until now have > applied). I think the correct way to tackle this is to have the first > run of the agent use the 'noop' parameter, that way the cert exchange > will take place, and the facts will be populated, but no classes will > be applied. On subsequent runs, the ENC can use the aforementioned > inventory service to inspect the 'operatingsystem' fact to determine > whether or not to apply any classes. > > So, I guess, I'm just babbling to the masses here in a request for > comments as to whether this is the correct/most efficient method of > achieving my goal of only applying classes to Linux servers, but being > able to have Windows servers available via the inventory service. > > Thanks, > > Matt. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: Using onlyif
fwiw, I put this at the top of my global site.pp (one of 3 lines in the file). # Globally set exec path so we don't have to specify it each time we use exec. Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] } hth, Adam -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Puppet Windows: scheduled_task : TypeError
the manifest is now attached to the ticket On Friday, June 22, 2012 2:23:31 PM UTC-5, Josh Cooper wrote: > > Thanks Greg. Can you attach the manifest you are using (with the > arguments) to the ticket? > > On Fri, Jun 22, 2012 at 12:20 PM, Greg Swift wrote: > > attached to the ticket. I won't be able to work on this for about a > week > > though.. other priority just came up. But let me know and when I can > get > > back on it I will. > > > > > > On Thursday, June 21, 2012 3:02:38 PM UTC-5, Greg Swift wrote: > >> > >> first thing in the morning. > >> > >> On Thursday, June 21, 2012 1:15:09 PM UTC-5, Josh Cooper wrote: > >>> > >>> Can you try running with --trace and --debug, and adding the stack > trace > >>> to the ticket? > >>> > >>> On Jun 21, 2012, at 10:57 AM, Greg Swift wrote: > >>> > >>> So.. now I'm getting your error instead of mine. > >>> > >>> On Thursday, June 21, 2012 12:46:08 PM UTC-5, Greg Swift wrote: > > I believe you are correct. I removed the arguments key/value pair > and > it ran fine. I'm patching in your changes to try it with the > arguments > option. > > thank you very much > > On Thursday, June 21, 2012 11:53:40 AM UTC-5, Josh Cooper wrote: > > > > Hi Greg, > > > > I believe this is issue https://projects.puppetlabs.com/issues/13008, > > > which I have fixed in my topic branch and is awaiting to be merged > into > > 2.7.x. It would be great if you could try it out and let me know how > it > > goes. > > > > Josh > > > > On Thu, Jun 21, 2012 at 9:00 AM, Greg Swift wrote: > >> > >> Mohamed, > >> > >> Did you get anywhere with this? I'm running into the exact same > >> issue. > >> > >> -greg > >> > >> > >> On Wednesday, November 23, 2011 7:29:34 PM UTC-6, Jacob Helwig > wrote: > >>> > >>> On 2011-11-23 15:53 , Mohamed Lrhazi wrote: > >>> > Thanks JacobDid that answer my TypeError as well? > >>> > >>> No, a stack trace would help for that. > >>> > >>> -- > >>> Jacob Helwig > >>> http://about.me/jhelwig > >>> > >>> > > >>> > Mohamed. > >>> > >>> > >>> > > >>> > On Wed, Nov 23, 2011 at 5:28 PM, Jacob Helwig wrote: > >>> >> On 2011-11-23 13:02 , Mohamed Lrhazi wrote: > >>> >>> am trying this: > >>> >>> > >>> >>> scheduled_task { 'Puppet Run': > >>> >>> ensure=> present, > >>> >>> enabled => true, > >>> >>> command => 'C:\\ruby187\\bin\\puppet.bat', > >>> >>> arguments => 'agent --verbose --logdest > >>> >>> C:\\Temp\puppet.log', > >>> >>> trigger => { > >>> >>> schedule => daily, > >>> >>> #every => 2 # Defaults to 1 > >>> >>> #start_date => '2011-08-31', # Defaults to 'today' > >>> >>> start_time => '16:00', # Must be specified > >>> >>> } > >>> >>> } > >>> >>> > >>> >>> And getting this error: > >>> >>> > >>> >>> err: /Stage[main]/Gu_splunk/Scheduled_task[Puppet Run]/ensure: > >>> >>> change > >>> >>> from absent to present failed: Could not set 'present on > ensure: > >>> >>> TypeError at /etc/puppet/ > >>> >>> environments/windows/modules/gu_splunk/manifests/init.pp:84 > >>> >>> > >> > >> -- > >> 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/-/cIrGZR2XNjYJ. > >> > >> To post to this group, send email to puppet-users@googlegroups.com. > > >> To unsubscribe from this group, send email to > >> puppet-users+unsubscr...@googlegroups.com. > >> For more options, visit this group at > >> http://groups.google.com/group/puppet-users?hl=en. > > > > > > > > > > -- > > Josh Cooper > > Developer, Puppet Labs > > > >>> -- > >>> 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/-/CG9Sa5hf2jYJ. > >>> To post to this group, send email to puppet-users@googlegroups.com. > >>> To unsubscribe from this group, send email to > >>> puppet-users+unsubscr...@googlegroups.com. > >>> For more options, visit this group at > >>> http://groups.google.com/group/puppet-users?hl=en. > > > > -- > > 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/-/Gs01u9mrFhEJ. > > > > To post to this group, send email to puppet-users@googlegroups.
[Puppet Users] Re: groups dependencies at user creation
On Tuesday, July 3, 2012 4:43:24 PM UTC-5, eduardo wrote: > > Thanks your answers. > I don't figure out how avoid execute because i have a massive input > account by ENC json setting all users and membership of each one of > them. I had to make uniq entries array to avoid Duplicate definition > error condition because many users could (in fact are) belong to a > same group. > That sounds like a different issue. Certainly you should be sure that your ENC does not emit redundant data, but the involvement of an ENC or lots of data does not speak to the solution Nan suggested. > May be i miss something but i think that i can benefit from working > with defined resource types > (vs classes) so the same nesting call is setting dependencies > implicitly. > Likely you can indeed benefit from careful application of defined types, but that doesn't really have anything to do with implicit dependencies (a.k.a. "autorequires"). > > For example a big picture of nesting call in my recipe is something > like : > > class updssh( $users ) -> Parameter class having json as input. > └── user_keys { $arrays_users: } Call it foreach user. > ├── updssh::check_groups { $usr_groups: } Call it for ensure > membership of user > └── updssh::load_ssh_key{ $user_ssh : Call it to set account > (create/update) > Your language and naming shows that you are thinking of classes and resources as actions, but that conflicts with Puppet's design. Puppet classes and resources are things (nouns). That includes defined type instances. Class and resource declarations are not instructions to Puppet to do something (not even Execs), but rather descriptions of the state that the target node is supposed to be in. You need to understand this to master Puppet. > So I don't see dependencies like any problem because the nesting call > is doing by self. > Testing are tell me that nevertheless , i'm wondering , Am i wrong ? > Are you asking whether you need to express the relationships between User resources and the Group resources representing their secondary groups? Yes, you do. Puppet does not generate those particular relationships automatically, and the order in which the Puppet agent *applies* resources is constrained only by resource relationships. In particular, that order has nothing to do with the order in which resource declarations were parsed. You need to be sure the secondary groups should already exist before you manage users that are supposed to belong to them, so you need to declare relationships between them. > Even knowing it's the first version i have to confess that i'm happy > with it because not only resolve dependencies by self but also it > create groups that don't exist. Also i enjoy using functions like > 'defined' which it's great to check current status. > I'm glad you're pleased (now), but you are setting yourself up for pain. In particular, you should avoid the 'defined' function at all costs, as it introduces problematic and unneeded parse-order dependencies. With an ENC at your disposal, 'defined' doesn't even give you anything that you cannot easily achieve by other means. It's not clear to me what practical problems you may now be facing, so I'm going to leave it at commentary for the time being. John -- 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/-/cHEwQzBaMk4J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] proper usage of global variables / node variables / +=
Hello puppet masters, I am cleaning up some puppet modules, using puppet-lint. The warning I am getting is: top-scope variable being used without an explicit namespace I can turn this particular check off, but in doing my research I'm finding all sorts of messages saying to avoid using +=, to avoid using variables in the node scope, and to switch to a parameterized class whenever possible. Okay, I'm game. So, to understand what I'm doing, I'm setting up a yum repository and limiting the includepkgs line to the very minimum amount of packages for reasons of security / policy / insanity / etc. Here is the current implementation of this (which works fine). node standard { $epel_includepkgs += 'puppet augeas-libs facter ruby-augeas ruby-shadow ' class { 'repo_epel': stage => 'pre' } #other stuff } node 'my.node1' inherits standard { include denyhosts } node 'my.node2' inherits standard { include denyhosts include gitlabhq } class repo_epel { yumrepo { 'epel': enabled => 1, descr => 'Extra Packages for Enterprise Linux 6 - \$basearch', mirrorlist => 'https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=\$basearch', failovermethod => priority, gpgcheck=> 1, gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6', require => File['/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6'], includepkgs => $epel_includepkgs, } # other stuff } class denyhosts { $epel_includepkgs += 'denyhosts ' # other stuff } class gitlabhq { $epel_includepkgs += 'libyaml gitolite git-all rvm ' # other stuff } my.node1, and my.node2 will have different (and correct) includepkgs doing it this way (I have like .. 30+ modules for epel and more of other repos to give you an idea) To get rid of the error I tried making the variable $::epel_includepkgs, but that generates the error: err: Could not parse for environment production: Cannot assign to variables in other #namespaces So what is the 'proper' puppet way to accomplish this? I tried a parameterized class like this: class repo_epel ($include_pkgs) { notify { "include_pkgs = $include_pkgs":} } class denyhosts { $repo_epel::include_pkgs += "denyhosts " } but from what I understand that only changes the include_pkgs variable inside the denyhosts scope (or maybe I'm confused). Any help would be appreciated. Thanks -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
[Puppet Users] Re: Inventory access forbidden
Did you generate the necessary certs to access the puppetmaster facts with the dashboard? http://docs.puppetlabs.com/dashboard/manual/1.2/configuring.html#generating-certs-and-connecting-to-the-puppet-master On Thursday, July 5, 2012 3:52:15 AM UTC+2, Dennis Jacobfeuerborn wrote: > > Hi, > I've just set up a puppet server using passenger plus the dashboard and > these parts all work fine but now I have enabled the inventory and added > this to the auth.conf: > > path /facts > auth any > method find, search > allow * > > The dashboard shows "Could not retrieve facts from inventory service: 403 > "Forbidden"" and in the system log i find this: > Jul 5 03:46:35 puppet2 puppet-master[5221]: Denying access: Forbidden > request: puppet.local(192.168.2.45) access to /facts/puppet.local [find] at > line 99 > Jul 5 03:46:35 puppet2 puppet-master[5221]: Forbidden request: > puppet.local(192.168.2.45) access to /facts/puppet.local [find] at line 99 > > Any ideas why this isn't working? > > Regards, > Dennis > -- 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/-/d7ZN1C6yVy8J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Using onlyif
On 07/03/2012 03:15 PM, jcbollinger wrote: > On Monday, July 2, 2012 11:14:25 PM UTC-5, Ryan Coleman wrote: > > Binaries like curl and test must be fully qualified (ex. /bin/rm) or > you must pass the path attribute to your exec resource with a search > path like '/bin:/usr/bin' as the value. > > > > Or you can set a path via Exec's 'path' parameter. Sometimes that's > more convenient and / or clearer. It's also safer. Some badly written scripts won't work unless invoked with a valid PATH environment variable. Cheers, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Re: [Puppet Users] Inventory access forbidden
On Thu, Jul 5, 2012 at 2:52 AM, Dennis Jacobfeuerborn wrote: > Hi, > I've just set up a puppet server using passenger plus the dashboard and > these parts all work fine but now I have enabled the inventory and added > this to the auth.conf: > > path /facts > auth any > method find, search > allow * Where abouts in auth.conf did you place this configuration? Note that it has to be placed *before* the last stanza in the default config which reads: # this one is not strictly necessary, but it has the merit # to show the default policy which is deny everything else path / auth any Hope this helps, Matt. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.