[Puppet Users] How to only apply my manifests to certain classes?
Hi, I've written a new resolv class, but I only want it to get pushed out (for instance) UAT servers for now. Or perhaps just servers which have apache installed, or just the ones which are part of project xyz. I've been searching through the docs, but I think I'm looking in the wrong place. Also, I get the feeling that there's several ways to achieve this and some of the docs refer to the older ways. What's the current method of limiting certain manifests to certain classes of machines? (have I got my terminology wrong here?) Perhaps someone could put a link in to the best place in the docs that explains this to me? I'm sure I've read about this in the past, but I can't seem to find it again. Thanks in advance! -- 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/-/eLOq3hnPSroJ. 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] How to only apply my manifests to certain classes?
On Thursday, 20 December 2012 16:51:59 UTC, rvs wrote: > On Thu, Dec 20, 2012 at 8:11 AM, Steve Button > > > wrote: > > Hi, > > > > I've written a new resolv class, but I only want it to get pushed out > (for > > > Please let us know a bit more about your setup. > > Thanks, > Roman. > I've used puppet before at several companies, but it's always been already set up before I arrived and I've only modified the existing manifests. Currently I'm at a new site and we're not using Puppet at all, just at the proof of concept stage. I'm aware Puppet is very powerful, which also means it could be very dangerous. I'd like to avoid bringing down the whole IT infrastructure (of course) by rolling out a change to resolv.conf, for example, which could potentially cripple a node. When I make a change I'd like to first test it on one single node, then perhaps 10 in Dev, then after a day or so the rest of Dev. Likewise for UAT and Prod environments. So, that's one requirement... to be able to roll things out gradually to give it time to spot mistakes in the code. I guess the apache / resolv example is a little contrived, and doesn't represent a real use case. More likely we might want certain packages / kernel setting on our Oracle servers, but different ones on our SAP servers. Looking at the example pointed to... node 'www1.example.com', 'www2.example.com', 'www3.example.com' { include common include apache, squid } I guess I could add "include uat" and then put things that are specific to UAT servers only in there. Thanks for all the pointers, I think I've got a lot of reading to do and feeling a little overwhelmed! -- 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/-/w57-Fbff3e4J. 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] PATH when using puppet apply. RVM buggered.
Hi, I'm using "sudo puppet apply" to get a bunch of puppet code to run for me, but when it runs as root, I notice that the $PATH environment variable is showing as :- Notice: /Stage[main]/Main/Node[ubuntu-xenial]/Exec[/bin/echo $PATH]/returns: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin Whereas when I switch to root, I get root@ubuntu-xenial:~# echo $PATH /usr/local/rvm/gems/ruby-2.3.0/bin:/usr/local/rvm/gems/ruby-2.3.0@global/bin:/usr/local/rvm/rubies/ruby-2.3.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/usr/local/rvm/bin This means that rvm does not work properly, and my Ruby / gem is trying to run as 1.9.3 instead of 2.3.0, leading to lots of errors like :- Debug: Executing '/usr/local/bin/gem list --local' Warning: Could not match /usr/local/lib/ruby/1.9.1/yaml.rb:56:in `': Warning: Could not match It seems your ruby installation is missing psych (for YAML output). Warning: Could not match To eliminate this warning, please install libyaml and reinstall your ruby. I have tried searching for this error, but haven't found anything yet so I was hoping someone in the community could point me in the right direction!? Many thanks, Steve Button -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/a82c783e-05f6-451c-9f07-99a46f2e952a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] PATH when using puppet apply. RVM buggered.
Hi, We're not intentionally using rvm to run puppet. We have a RoR application, and we currently want to ensure it runs the correct Ruby version using RVM. For this purpose, we're using the maestrodev/rvm module from the forge. Thanks for coming back so quickly. Steve On Friday, 6 January 2017 11:07:43 UTC, Lowe Schmidt wrote: > > Later versions of puppet comes with their own supported ruby included[0] > > Any specific reason you are using rvm to run puppet? > > [0] > "Starting with Puppet 4, puppet-agent packages do not rely on the OS’s > Ruby version, as it bundles its own Ruby environment. You can install > puppet-agent alongside any version of Ruby or on systems without Ruby > installed. Likewise Puppet Enterprise does not rely on the OS’s Ruby > version, as it bundles its own Ruby environment. You can install PE > alongside any version of Ruby or on systems without Ruby installed. The > Windows installers provided by Puppet Labs don’t rely on the OS’s Ruby > version, and can be installed alongside any version of Ruby or on systems > without Ruby installed." > > https://docs.puppet.com/guides/platforms.html > > -- > Lowe Schmidt | +46 723 867 157 > > On 6 January 2017 at 12:02, Steve Button > wrote: > >> Hi, >> >> I'm using "sudo puppet apply" to get a bunch of puppet code to run for >> me, but when it runs as root, I notice that the $PATH environment variable >> is showing as :- >> >> Notice: /Stage[main]/Main/Node[ubuntu-xenial]/Exec[/bin/echo >> $PATH]/returns: >> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin >> >> Whereas when I switch to root, I get >> >> root@ubuntu-xenial:~# echo $PATH >> >> >> /usr/local/rvm/gems/ruby-2.3.0/bin:/usr/local/rvm/gems/ruby-2.3.0@global/bin:/usr/local/rvm/rubies/ruby-2.3.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/usr/local/rvm/bin >> >> This means that rvm does not work properly, and my Ruby / gem is trying >> to run as 1.9.3 instead of 2.3.0, leading to lots of errors like :- >> >> Debug: Executing '/usr/local/bin/gem list --local' >> >> Warning: Could not match /usr/local/lib/ruby/1.9.1/yaml.rb:56:in `> (required)>': >> >> >> Warning: Could not match It seems your ruby installation is missing psych >> (for YAML output). >> >> >> Warning: Could not match To eliminate this warning, please install >> libyaml and reinstall your ruby. >> >> I have tried searching for this error, but haven't found anything yet so >> I was hoping someone in the community could point me in the right >> direction!? >> >> Many thanks, >> >> Steve Button >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to puppet-users...@googlegroups.com . >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/puppet-users/a82c783e-05f6-451c-9f07-99a46f2e952a%40googlegroups.com >> >> <https://groups.google.com/d/msgid/puppet-users/a82c783e-05f6-451c-9f07-99a46f2e952a%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/305ce6ab-f2ac-4c19-8d80-5f7b978b7bd5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Re: Puppet Community Roles and Profiles
As well as the comment from Thomas, also see the follow up post from Gary Larizza http://garylarizza.com/blog/2014/02/17/puppet-workflow-part-2/ Here's a video from Puppet Conf 2016 https://youtu.be/RYMNmfM6UHw And from Puppet Conf 2014 https://youtu.be/v9LB-NX4_KQ?t=2011 That last one is very long, and the link I posted kicks in about 33 minutes in when he talks about Roles and Profiles. It's worth watching the whole thing, probably in three sittings (bring popcorn) as you'll learn all about Hiera, refactoring, modules. Take notes - you won't remember it all. I'm sure other speakers are available, but Gary is possibly the most entertaining and funny. Which is quite an achievement on such a dry subject. So, in answer to your original question the community very much does use Roles and Profiles and I've personally found it a very useful pattern. Steve On Wednesday, 11 January 2017 22:52:52 UTC, Joe wrote: > > > Does Puppet Community support Roles and Profiles? > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/98b149cf-08a8-4f55-9e96-495230af08a8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Debugging confusion !?
Hi, I've been struggling to debug this Puppet code for a couple of days now. Perhaps it's something obvious but I just can't see it! Can anyone suggest a debugging approach to get this working?? Why is it complaining every time that redis and Ruby are already at the lastest versions? More importantly what is the prereq failure for rvm? Here's the mis-behaving class :- # Install Ruby RVM class profile::rvm { $user = 'myuser' user {$user:} # This is needed to satisfy puppet's require in the single_user_rvm module. notify {"b4rvm":} single_user_rvm::install { $user: , require => Notify['b4rvm']} single_user_rvm::install_ruby { 'ruby-2.3.0': user => 'shazino' } } I only added the notify to try to help me make sense of the debug output a little. usernanme@ubuntu-xenial:/vagrant/puppet$ sudo puppet apply --modulepath=/usr/share/puppet/modules:/vagrant/puppet:/vagrant/puppet/modules:~/.puppet/modules manifests/site.pp Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults Warning: Scope(Concat[/etc/postgresql/9.5/main/pg_ident.conf]): The $force parameter to concat is deprecated and has no effect. Notice: Compiled catalog for ubuntu-xenial.localdomain in environment production in 4.73 seconds Notice: b4rvm Notice: /Stage[main]/Profile::Rvm/Notify[b4rvm]/message: defined 'message' as 'b4rvm' Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install redis-server' returned 100: Reading package lists... Building dependency tree... Reading state information... redis-server is already the newest version (2:3.0.6-1). 0 upgraded, 0 newly installed, 0 to remove and 64 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up redis-server (2:3.0.6-1) ... adduser: The user `redis' already exists. Exiting. insserv: script redis-server: service redis-server already provided! insserv: exiting now! update-rc.d: error: insserv rejected the script header dpkg: error processing package redis-server (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: redis-server E: Sub-process /usr/bin/dpkg returned an error code (1) Error: /Stage[main]/Redis::Install/Package[redis-server]/ensure: change from absent to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install redis-server' returned 100: Reading package lists... Building dependency tree... Reading state information... redis-server is already the newest version (2:3.0.6-1). 0 upgraded, 0 newly installed, 0 to remove and 64 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up redis-server (2:3.0.6-1) ... adduser: The user `redis' already exists. Exiting. insserv: script redis-server: service redis-server already provided! insserv: exiting now! update-rc.d: error: insserv rejected the script header dpkg: error processing package redis-server (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: redis-server E: Sub-process /usr/bin/dpkg returned an error code (1) Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install rubygems' returned 100: Reading package lists... Building dependency tree... Reading state information... ruby is already the newest version (1:2.3.0+1). 0 upgraded, 0 newly installed, 0 to remove and 64 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up redis-server (2:3.0.6-1) ... adduser: The user `redis' already exists. Exiting. insserv: script redis-server: service redis-server already provided! insserv: exiting now! update-rc.d: error: insserv rejected the script header dpkg: error processing package redis-server (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: redis-server E: Sub-process /usr/bin/dpkg returned an error code (1) Error: /Stage[main]/Ruby/Package[rubygems]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install rubygems' returned 100: Reading package lists... Building dependency tree... Reading state information... ruby is already the newest version (1:2.3.0+1). 0 upgraded, 0 newly installed, 0 to remove and 64 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up redis-server (2:3.0.6-1) ... adduser: The user `redis' already exists. Exiting. insserv: script redis-server: service redis-server already provided! insserv: exiting now! update-rc.d: error: insserv rejected the script header dpkg: error processing package redis-server (--configure): subprocess installed post-installation script returned erro
[Puppet Users] restart NginX ONCE (after default file has been removed)
Hi, I've got a small piece of puppet in my profile module to remove the default nginx.conf file which gets installed by the nginx module. # Upon install this file gets created and displays "Welcome to NginX" page, which we don't need. file { '/etc/nginx/conf.d/default.conf': ensure => 'absent', # Need to force NGinx to restart after this change has completed so we don't get a default page. notify => Service['ningx'], } However this fails because the service is defined within with NginX module, not the profile. Am I going about this in the wrong way? Obviously I don't want it to restart every time Puppet runs, only triggered by the file being removed. I was to avoid modifying the component module https://forge.puppet.com/puppet/nginx if at all possible. Thanks, -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/5acbdbb4-8a3b-425a-bc8f-dc72db81322b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.