Re: [Puppet Users] Should all nodes have files in client_yaml/catalog?
On 20 August 2011 21:09, Nan Liu wrote: > On Sat, Aug 20, 2011 at 4:21 AM, garethr wrote: >> I've been looking into using puppet-rundeck and run into a bit of an >> issue that I've traced back to puppet. I have a feeling this is going >> to be my lack of understanding of something or a misconfiguration. >> >> Here's a snippet of code that demonstrates my plight: >> >> https://gist.github.com/9667ad19762bf20bd947 >> >> The above works for only 1 of the 4 nodes, specifically the one that >> the commands are run on which is also the puppet master. >> >> This appears to be down to which files are present in /var/lib/puppet/ >> client_yaml/catalog. >> >> So I think I'm expecting there to be 4 files in that directory, one >> yaml file for each node. Instead I'm only seeing one. If I duplicate >> that file with the relevant node names the above code will run. > > Did you intend to use the Puppet agent's cached catalog? If you want > something current, I believe you should use the :rest terminus to > fetch a current catalog from the master. > The code in question was my attempt to extract a test case for the problem I'm seeing with puppet-rundeck, so the code was more James' than mine. https://github.com/jamtur01/puppet-rundeck/blob/master/lib/puppet-rundeck.rb >From a chat on IRC it looks like this might be an API change, I'm using 2.6.2. G > Thanks, > > Nan > > -- > 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. > > -- Gareth Rushgrove Web Geek morethanseven.net garethrushgrove.com -- 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] How to do release managment integration with puppet?
On 30 November 2012 23:02, Craig White wrote: > > On Nov 30, 2012, at 10:37 AM, Schofield wrote: > >> I am at the beginning of merging the traditional OS/Middleware update >> process with application development release process. The goal is to be >> able to test a complete versioned OS/Middleware/Application stack as it >> moves through dev/test/qa/prod environments. The key here is that entire >> stack is labeled under a single version. In other terms, the node and >> everything on it is aligned under a single version. Right now the >> OS/Middleware is managed by puppet. The application release process is not. >> I'm hoping some folks would like to comment on the following questions I am >> pondering. >> • How to best version puppet classes and control the classification of >> nodes based on the version of the node? >> • Are there ENC's that integrate with SVN/GIT that make this easy? >> • Should application deployment be brought under the control of puppet? >> • If so how do you easily do this without burdening applications >> developers with having to learn something about or have access to puppet? >> • Is there a puppet API that an existing application release processes >> can leverage to trigger OS/Middleware updates when an application version is >> updated? >> Looking forward to your comments. > > I think the general consensus is that puppet is less than optimal for most > software deployments and there are better tools for the job (for example, we > use capistrano here). > I'm not sure 'general consensus' is really true, I think it depends, in particular on size of stack. Capistrano is incredibly easy to get started with but has negatives too (like being push based, often installing/compiling dependencies per machine, not being able to specify broader version dependencies like on the database server) > Puppet is more of a configuration management tool and I suspect that even if > you could shoehorn your software deployment needs into something that puppet > could manage, it would probably be slow and confusing. > Here's a question. Would you define a puppet module for Graphite? Graphite turns out to be a Django base web application. Would you use Capistrano to deploy Graphite? If your own applications were Django based would you use Cap? Not quite as simple I feel. Replying the the original points separately too. G > As for ENC's and 'developer' access, I use foreman (http://theforeman.org) to > provide 'other' user access and I can contain their rights/access within > foreman and yet still, allow them to say install NGINX (with all of it's > pre-requisite packages) from a web based GUI. > > Again, seriously look at capistrano for handling software deployments and I'm > sure that there's others that can do the job too. > > Craig > > -- > 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. > -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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] How to do release managment integration with puppet?
On 30 November 2012 17:37, Schofield wrote: > I am at the beginning of merging the traditional OS/Middleware update > process with application development release process. The goal is to be > able to test a complete versioned OS/Middleware/Application stack as it > moves through dev/test/qa/prod environments. The key here is that entire > stack is labeled under a single version. In other terms, the node and > everything on it is aligned under a single version. Right now the > OS/Middleware is managed by puppet. The application release process is not. > I'm hoping some folks would like to comment on the following questions I am > pondering. > > How to best version puppet classes and control the classification of nodes > based on the version of the node? Although I've not done it myself I've seen people use Puppet environments for versioning. You can also use environment variables on the nodes to help with classification. > Are there ENC's that integrate with SVN/GIT that make this easy? > Should application deployment be brought under the control of puppet? > If so how do you easily do this without burdening applications developers > with having to learn something about or have access to puppet? The vcsrepo module (https://forge.puppetlabs.com/puppetlabs/vcsrepo) supports defining git/bzr/svn checkouts, but another approach would be to package your applications up as system packages (debs for debian/ubuntu, rpms for redhat/centos). This has a number of nice advantages, including making managing the application version just a matter of defining a package resource in puppet. > Is there a puppet API that an existing application release processes can > leverage to trigger OS/Middleware updates when an application version is > updated? So, assuming you do package your applications up as system packages as described then triggering updates to supporting components could be done in the package dependencies, or it could be done with Puppet requires, assuming the dependencies are on the same node. Cross node dependencies are harder however. Some ideas for that thorny problem: https://github.com/jamtur01/puppet-noah/ http://www.slideshare.net/lusis/beyond-the-node-arkestration-with-noah G > > Looking forward to your comments. > > -- > 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/-/vAGrAj_5qpUJ. > 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. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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: puppetlabs/apt and apt::ppa
On 26 December 2012 03:23, Andrey Ageyev wrote: > Fixed by removing dependency File[$sources_list_d] in apt/manifests/ppa.pp > around line 33: > > require => [ > File[$sources_list_d], > Package["${package}"], > ], > > to > require => Package["${package}"], > If you want to do this without changing the module (which will make future updates easier) then you can just specify that resource in your manifests: file { '/etc/apt/sources.list.d': ensure => directory, } I'm not sure why the module has a dependency on something that it doesn't manage though, I tend to try and avoid doing that if possible. G > > среда, 26 декабря 2012 г., 4:22:35 UTC+2 пользователь Andrey Ageyev написал: >> >> Greetings, >> >> I'm trying to add ppa:nginx/stable repo for Ubuntu 12.04.1 LTS. >> Server: puppetmaster-common 3.0.1-1puppetlabs1 >> Agent: puppet 2.7.11 >> >> And when I try to apply manifest - getting: >> puppet agent -t >> info: Caching catalog for wproxy71.tpnt.net >> err: Failed to apply catalog: Could not find dependency >> File[/etc/apt/sources.list.d] for >> Exec[add-apt-repository-ppa:openstack-ppa/bleeding-edge] at >> /etc/puppet/modules/apt/manifests/ppa.pp:38 >> >> The folder - /etc/apt/sources.list.d exists. >> Does anybody know what's can be wrong? >> >> Thanks, >> Andrey. >> >> > -- > 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/-/CEgiBNLSA6cJ. > > 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. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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] testing puppet manifests
The best starting point is probably rspec-puppet. The tutorial is a good starting point and you'll find a growing number of modules available with small test suites. These are good for testing logic based on passed parameters, or template rendering. http://rspec-puppet.com/tutorial/ Gareth On 28 January 2013 14:43, Scott Anderson wrote: > The information I can find is somewhat spotty.. but is there a good way to > test puppet manifests. > > It seems that using 'puppet apply --noop' only really tests the syntax. I am > looking for more functional tests for things like templates before they go > into a prod environment. Right now the way I have been testing is to put > some test code on the puppetmaster and watch the logs very closely. this is > not ideal, any suggestions? > > -- > 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. > Visit this group at http://groups.google.com/group/puppet-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Integration testing infrastructure
Bryan Berry gave a talk at FOSDEM a couple of days ago about integration testing for infrastructure. He talked about a tool that's come out of the Chef community called Test Kitchen, and pointed out it should be possible to use it to test Puppet code too. I've put together a quick demo of doing that here: https://github.com/garethr/tk-demo-puppet Any feedback welcome. At the moment it's a proof of concept, but I'd like to see it exist for real - probably with Support for providing a Puppetfile. G -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Integration testing puppet
Bryan Berry gave a talk at FOSDEM a couple of days ago about integration testing for infrastructure (https://speakerdeck.com/bryanwb/dont-shrug-integration-testing-for-infrastructure-with-ruby-frameworks). He talked about a tool that's come out of the Chef community called Test Kitchen, and pointed out it should be possible to use it to test Puppet code too. I've put together a quick demo of doing that here: https://github.com/garethr/tk-demo-puppet The demo brings up two virtual machines, applies a set of puppet manifests and then runs some tests to assert things worked - all in one command and with limited configuration. The open issue on test kitchen for the multi provisioner support is ere https://github.com/opscode/test-kitchen/issues/36 Any feedback welcome. At the moment it's a proof of concept, but I'd like to see it exist for real. Or if anyone has a good approach to this problem already I'd love to see it? Cheers Gareth -- Gareth Rushgrove Web Geek morethanseven.net garethrushgrove.com -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Configuration Management
On 26 August 2013 19:14, Florin Dragu wrote: > I'm are looking at ways to improve the way we do config management. > > I know Puppet is very good at managing deploy time OS and env config, > however, when it comes to app/code config it gets a bit tricky as there are > various levels of config: build vs deploy vs runtime/dynamic. > > For dynamic/runtime config I'm thinking about tools like Zookeeper, but I'm > also keen on using feature toggles that have their own config (similar to > Togglz framework). > > Ideally, I would like to not manage config in multiple places, but have one > place where all the tools (Puppet, Zookeeper and Togglz) can pull the config > from (or have it pushe d from that central place). > > Any ideas how to approach something like this? or am I combining too many > things in one and making a mess of it? > The approach in Puppet for separating data tends to be to use Hiera: https://github.com/puppetlabs/hiera One of the many nice things about Hiera is you can have multiple backends, so for instance a Zookkeeper backend (https://github.com/zahna/hiera_zookeeper) or my recent stab at a etcd backend (https://github.com/garethr/hiera-etcd) For Togglz you could probably write a StateRepository for Zookeeper or similar. Gareth > Thanks, > Florin > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users. > For more options, visit https://groups.google.com/groups/opt_out. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Module contributing guidelines
I finally added a CONTRIBUTING file to one of my open source puppet modules which has seen a bunch of people submitting pull requests. https://github.com/garethr/garethr-docker/blob/master/CONTRIBUTING.md This comes up on GitHub when submitting a new pull request or issue like so: https://github.com/garethr/garethr-docker/issues/new I was after some feedback before adding it to a bunch of other projects, and also looking for any other good CONTRIBUTING files for puppet modules. Seems like one of those things that benefits from a community consensus. Gareth -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2BSzKxyP8jLidnzfzDB73qMdrQQ3w9sj%2BtiBrZUYLfavg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Re: Choo choo here comes the FOSDEM train
I'll be around from Friday afternoon for FOSDEM, and also in Gent for Config Management Camp. Gareth Rushgrove IRC/Twitter/GitHub: @garethr Gareth On 19 January 2014 18:03, Klavs Klavsen wrote: > I'll be there as well.. saturday and sunday only though. (FiXion on irc) > > see http://blog.klavsen.info/ for a larger picture :) > > looking forward to seeing you there. > > -- > 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/e6c4f157-e59a-427b-9135-c1229a9314b2%40googlegroups.com. > > For more options, visit https://groups.google.com/groups/opt_out. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yJtgyxdk0sEaj3ECk0g7yrB-%3DmvzmfWBj-JsVUxhztZ-Q%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Code coverage for puppet resources
For anyone else who likes writing tests for their puppet manifests, I've just added basic code coverage to rspec-puppet: A blog post here about how to use it: http://www.morethanseven.net/2014/01/25/code-coverage-for-puppet-modules/ I'd be interested in any feedback on how to improve or add to this. Cheers Gareth -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLzEYJ4vbMh28PwoHoYwtGGTnfpra16TnoGrFuGqyGuSg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] checking is package is installed ?
On 28 January 2014 18:21, kaustubh chaudhari wrote: > Hi, > > How do we check if the package is installed, before installing it. > > I with to uninstall a package which i can do with ensure => absent, but > before doing this, i would like to check if the package really exists on the > system or not? > > Can someone help in here or redirect me to the correct documentation. > This isn't really how puppet works, but that's a good thing. By saying absent you're not saying "uninstall this package" you're saying "I want this package to be absent". Therefore when you run the Puppet code with ensure => absent on a system where the package isn't already installed it won't do anything, the state is already as you have requested. Under the hood it will check if the package is already installed - you don't have to do this yourself. Think of Puppet as describing the state you want, not as running a series of commands and you'll write much better code. Gareth > -Kaustubh > > -- > 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/90e7a177-d567-4b7c-8fe7-cb30e06af0be%40googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLWRAssd0%3Dufe23VsWs67nC_vphHRf4CWMV0%2BzZGdS8Dw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Puppet vs "typical" release management / change management
On 4 February 2014 14:11, Jason Antman wrote: > Steve, > > I'll leave it up to others to answer your question more directly, as I'm not > sure I really can - it's been a while since I worked in an ITIL shop. What I > will say, though, since inevitably *someone* will, is that ITIL contains > some good concepts and some bad ones. Overall, I'd never work in an ITIL > shop again, I find it far too restrictive and slow. > > When you mentioned "the devops approach", are you referring to agile and > deploying/releasing very often? Or... something else? > > In my opinion (and yes there are very smart people who feel otherwise) ITIL > is a band-aid for having poor review processes, poor testing, and people who > either don't know what they're doing or can't take responsibility. I work in > a web shop that deploys application code about twice a day, which most of us > consider to be painfully slow. We treat Puppet as "infrastructure as code" - > we make a change, have a git branch peer-reviewed, deploy to a development > server and test there (which will ideally be automated in the future, via > both rspec and server-spec, and some tests against monitoring), assuming the > tests pass we push to an identical test environment, and if it passes there > too, we push to production. > > So, to cut short the ITIL-bashing (under the assumption that you probably > didn't choose ITIL for your organization, and any more of it will have you > cursing my name), if by "devops" you meant rapid deployment/release or even > continuous deployment/release, then I'd go so far as to say it's totally in > conflict with the low-confidence, slow-moving CAB approach of ITIL. > One approach here is to move towards things being defined as Standard Change in ITIL terminology. These are basically low-risk pre-approved changes, ie. things that you do so often that going to a CAB isn't needed. Traditionally changes to infrastructure would be infrequent, scary and definitely require approval. However, if you have automated review, testing and audit tracking procedures and are releasing changes daily then it's perfectly possible to view these as standard changes. Basically lean in and learn some of the terminology. Build trust and reduce (and talk about) risk. Gareth > The other thing I should mention is that we're a pretty strong devops shop - > culturally (as is the meaning of devops) and in practice. We work extremely > closely with dev, engineers/ops are involved in all dev tickets from the > first elaboration, ops is included on most dev code reviews and vice versa. > That's probably a requirement to make things work smoothly as I mentioned > above. > > -Jason > > > On 02/04/2014 05:05 AM, Steven James wrote: >> >> Hi there. >> >> I'm look to see if anybody has any advice to share around how the >> implementation of Puppet affects the "typical" ITIL based release >> management and change management processes. >> >> From a change perspective, I'm thinking that the whole risk thing >> associate with the CAB for example, should get a whole lot better as a >> result of version controlled infrastructure manifests, ability to provide >> infrastructure code diffs, noop runs against bare metal, with the option of >> running a few noop runs against current patch set...will probably help. >> >> How else does the ITIL base change process have to typically (er) >> change...to accommodate the devops approach? >> >> Similar question for release management. How does the introduction of >> Puppet typically affect the release management process? >> >> Any input greatly appreciated. >> >> SteveJames >> -- >> 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/CAB_ORUv5NbgL-L4SattZ5y5V9G0r4BHgfVx6Pd-WVp8frHcdXg%40mail.gmail.com. >> For more options, visit https://groups.google.com/groups/opt_out. > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/52F0E6E9.5040309%40jasonantman.com. > > For more options, visit https://groups.google.com/grou
[Puppet Users] Puppet module template mentioned at contributor summit
This came up in discussion a couple of times at the Puppet contributor summit at Config Management Camp in Gent over the last couple of days so I thought I'd write up. A while ago I put together a pretty complete/opinionated skeleton for puppet modules. Especially if you're not too familiar with ruby or the ruby ecosystem, or just getting started with testing it should be a useful starting point. https://github.com/garethr/puppet-module-skeleton I've added a bunch more features (including a Guardfile, resource coverage and support for Beaker integration tests) and got round to writing up a blog post about what and why: http://www.morethanseven.net/2014/02/05/a-template-for-puppet-modules/ Hopefully it's useful to a few people. Any features or issues let me know. Gareth -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2BiRQPPKk8yTLBMiHCNOsLdNFYeaPO8oTCCcuaASj6SaQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Code coverage for puppet resources
On 7 February 2014 02:51, gh wrote: > On 1/26/14 7:50 AM, Gareth Rushgrove wrote: >> For anyone else who likes writing tests for their puppet manifests, >> I've just added basic code coverage to rspec-puppet: >> >> A blog post here about how to use it: >> >> http://www.morethanseven.net/2014/01/25/code-coverage-for-puppet-modules/ >> >> I'd be interested in any feedback on how to improve or add to this. >> >> Cheers >> >> Gareth >> > > Gareth, > > Great blog post. I tried this on a module with 100% coverage and notice > that it reports back 50% coverage. After some poking around, found that > it is checking code in spec/fixtures/, the stdlib module actually. There > seems to be an open issue[1] regarding the inability to exclude things. > Curious if you found a work around for testing your code and not the > modules pulled in from .fixtures.yml. > Currently the rspec-puppet coverage stuff does check coverage across all resources, including those from dependent modules. For example this module depends on the puppetlabs/apt module - https://travis-ci.org/garethr/garethr-nginx/jobs/18133670#L113 I purposefully didn't add too much configuration to the first pass of the code, but it would be simple to add some options to ignore specific modules (I think). I thought I'd wait to see if anyone found it useful first. Gareth > [1] - https://github.com/lemurheavy/coveralls-public/issues/184 > > BR, > -g > > -- > 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/52F44A2E.3070903%40garretthoneycutt.com. > For more options, visit https://groups.google.com/groups/opt_out. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2B-pZuGexUYciyXDkENL4EQQSJqTBHzaB5NfW9eujt%3D3g%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Puppet module template mentioned at contributor summit
On 28 February 2014 10:20, Craig Dunn wrote: > > The main difference between Gareth's current params.pp and the 'defaults.pp' > model I was suggesting is that in the Gareth's pattern the params class is > inherited by the base class, and all the component subclasses reference the > variables explicitly in the scope of base::params eg: > > service { $<%= metadata.name %>::params::service_name: > Actually that's weird. I don't actually do that in any of my actual modules based on this skeleton. I probably merged a pull request without looking properly. I'll fix. Anything in params should never be referenced directly outside init in my view. Gareth > Since the params class is not parameterized there is no way to easily > override this data using hiera/data mapping. > > By making the base class parameterized, with it's defaults being set in > 'defaults.pp' (defaults is a more sensible name than params for this > example) and having your component subclass reference $::baseclass::var you > can override data on class declaration or in hiera using data mapping. > > It's not that different, but allows for more flexibility and tighter hiera > integration > > Craig > > > > On Wed, Feb 26, 2014 at 2:43 PM, Alessandro Franceschi wrote: >> >> Craig, >> Not sure to have understood the difference between a defaults.pp pattern >> and a params.pp pattern, given that I suppose that if there were parameters >> in the main module class of Gareth's example they would inherit values in >> params.pp exactly as the defaults example you've written. >> Can be elaborate or link examples of this defaults.pp pattern? >> >> To the list of public modules skeletons let me add this one, that follows >> stdmod naming conventions: >> https://github.com/stdmod/puppet-skeleton-standard >> >> and this alternative with Rip's data in module approach: >> https://github.com/stdmod/puppet-skeleton-standard/tree/hiera >> >> Al >> >> >> On Wednesday, February 26, 2014 10:37:59 AM UTC+1, Craig Dunn wrote: >>> >>> >>> This is cool, though I realise that it's a (self confessed) opinionated >>> module design, the only thing that really stands out for me is that it >>> follows a rather old, and limited, 'params.pp' pattern. There is no place >>> for Hiera in this model without hard coding hiera lookup functions in the >>> classes. Personally I think a 'defaults.pp' pattern is more sensible in >>> todays Puppet. >>> >>> Eg: >>> >>> class base ( >>>$parameter = $base::defaults::$parameter >>> ) inherits base::defaults { >>> ... >>> } >>> >>> class base::defaults { >>>$parameter = $logic ? { >>> 'foo' => 'bar' >>>} >>> } >>> >>> >>> Your classes can then look up values as $base::parameter. This allows >>> the module to default (rather than dictate) attributes based on whatever >>> logic you want to implement but allows the implementer to override the >>> values either at the resource declaration or using Hiera data mapping for >>> base::parameter. >>> >>> Regards >>> Craig >>> >>> >>> >>> On Wed, Feb 5, 2014 at 5:38 PM, Gareth Rushgrove >>> wrote: >>>> >>>> This came up in discussion a couple of times at the Puppet contributor >>>> summit at Config Management Camp in Gent over the last couple of days >>>> so I thought I'd write up. >>>> >>>> A while ago I put together a pretty complete/opinionated skeleton for >>>> puppet modules. Especially if you're not too familiar with ruby or the >>>> ruby ecosystem, or just getting started with testing it should be a >>>> useful starting point. >>>> >>>> https://github.com/garethr/puppet-module-skeleton >>>> >>>> I've added a bunch more features (including a Guardfile, resource >>>> coverage and support for Beaker integration tests) and got round to >>>> writing up a blog post about what and why: >>>> >>>> http://www.morethanseven.net/2014/02/05/a-template-for-puppet-modules/ >>>> >>>> Hopefully it's useful to a few people. Any features or issues let me >>>> know. >>>> >>>> Gareth >>>> >>>> -- >>>> Gareth Rushgrove >>>>
Re: [Puppet Users] Puppet module template mentioned at contributor summit
On 1 March 2014 09:38, Gareth Rushgrove wrote: > On 28 February 2014 10:20, Craig Dunn wrote: >> >> The main difference between Gareth's current params.pp and the 'defaults.pp' >> model I was suggesting is that in the Gareth's pattern the params class is >> inherited by the base class, and all the component subclasses reference the >> variables explicitly in the scope of base::params eg: >> >> service { $<%= metadata.name %>::params::service_name: >> > > Actually that's weird. I don't actually do that in any of my actual > modules based on this skeleton. I probably merged a pull request > without looking properly. > > I'll fix. > > Anything in params should never be referenced directly outside init in my > view. > Changed to: service { $<%= metadata.name %>::service_name: With the params on init making overriding in hiera easy. Cheers for the heads up. Gareth > Gareth > >> Since the params class is not parameterized there is no way to easily >> override this data using hiera/data mapping. >> >> By making the base class parameterized, with it's defaults being set in >> 'defaults.pp' (defaults is a more sensible name than params for this >> example) and having your component subclass reference $::baseclass::var you >> can override data on class declaration or in hiera using data mapping. >> >> It's not that different, but allows for more flexibility and tighter hiera >> integration >> >> Craig >> >> >> >> On Wed, Feb 26, 2014 at 2:43 PM, Alessandro Franceschi wrote: >>> >>> Craig, >>> Not sure to have understood the difference between a defaults.pp pattern >>> and a params.pp pattern, given that I suppose that if there were parameters >>> in the main module class of Gareth's example they would inherit values in >>> params.pp exactly as the defaults example you've written. >>> Can be elaborate or link examples of this defaults.pp pattern? >>> >>> To the list of public modules skeletons let me add this one, that follows >>> stdmod naming conventions: >>> https://github.com/stdmod/puppet-skeleton-standard >>> >>> and this alternative with Rip's data in module approach: >>> https://github.com/stdmod/puppet-skeleton-standard/tree/hiera >>> >>> Al >>> >>> >>> On Wednesday, February 26, 2014 10:37:59 AM UTC+1, Craig Dunn wrote: >>>> >>>> >>>> This is cool, though I realise that it's a (self confessed) opinionated >>>> module design, the only thing that really stands out for me is that it >>>> follows a rather old, and limited, 'params.pp' pattern. There is no place >>>> for Hiera in this model without hard coding hiera lookup functions in the >>>> classes. Personally I think a 'defaults.pp' pattern is more sensible in >>>> todays Puppet. >>>> >>>> Eg: >>>> >>>> class base ( >>>>$parameter = $base::defaults::$parameter >>>> ) inherits base::defaults { >>>> ... >>>> } >>>> >>>> class base::defaults { >>>>$parameter = $logic ? { >>>> 'foo' => 'bar' >>>>} >>>> } >>>> >>>> >>>> Your classes can then look up values as $base::parameter. This allows >>>> the module to default (rather than dictate) attributes based on whatever >>>> logic you want to implement but allows the implementer to override the >>>> values either at the resource declaration or using Hiera data mapping for >>>> base::parameter. >>>> >>>> Regards >>>> Craig >>>> >>>> >>>> >>>> On Wed, Feb 5, 2014 at 5:38 PM, Gareth Rushgrove >>>> wrote: >>>>> >>>>> This came up in discussion a couple of times at the Puppet contributor >>>>> summit at Config Management Camp in Gent over the last couple of days >>>>> so I thought I'd write up. >>>>> >>>>> A while ago I put together a pretty complete/opinionated skeleton for >>>>> puppet modules. Especially if you're not too familiar with ruby or the >>>>> ruby ecosystem, or just getting started with testing it should be a >>>>> useful starting point. >>>>> >>>>> https://github.com/garethr/puppet-mo
Re: [Puppet Users] Any Puppet Labs alternatives to test-kitchen
Beaker works pretty well, once you get it setup. Here's a simple example module with some very simple acceptance tests with beaker. https://github.com/garethr/garethr-nginx Compared to Test Kitchen the command line UI is lacking but it's early days. For running tests is good, and worth using based on the couple of modules I'd converted so far. Gareth On 10 March 2014 14:01, Nikola Petrov wrote: > Look at https://github.com/puppetlabs/beaker although I am not using it > myself so I cannot tell you if it is stable enough. > > -- > Nikolavp > > On Sun, Mar 09, 2014 at 10:35:53AM -0700, Louis wrote: >> Any Puppet Labs alternatives for ... >> >> https://github.com/test-kitchen/test-kitchen >> >> >> -- >> 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/64db5228-05b6-4438-abe4-632183dafc1d%40googlegroups.com. >> 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/20140310140113.GA934%40nikolavp-desktop. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2Bo9inXJDzY_c_JtRYBiSEtJzaf35%2Be9MzBN0cOfosiVA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Slides TDD with puppet - puppetcamp paris yesterday
Ha. Snap. A talk I gave at Puppetcamp London: https://speakerdeck.com/garethr/test-driven-development-for-puppet And another talk from Loaddays by Garrett: http://www.slideshare.net/gh/20140406-loa-daystddwithpuppettutorial That's three talks with the same title in less than a week. I believe we're on to something. Gareth On 9 April 2014 11:19, Johan De Wit wrote: > Hi, > > http://www.slideshare.net/johandw/20140408-tdd-puppetcampparis > > Comments are welcome > > Grts > > > Johan > > > -- > Johan De Wit > > Open Source Consultant > > Red Hat Certified Engineer (805008667232363) > Puppet Certified Professional 2013/2014 (PCP006) > _ > Open-Future Phone +32 (0)2/255 70 70 > Zavelstraat 72 Fax +32 (0)2/255 70 71 > 3071 KORTENBERG Mobile+32 (0)474/42 40 73 > BELGIUM http://www.open-future.be > _ > > Next Events: > Puppet Introduction Course | > http://www.open-future.be/puppet-introduction-course-14th-april > Puppet Advanced Training | > http://www.open-future.be/puppet-advanced-training-15-till-17th-april > Linux Training | https://www.open-future.be/linux-training-5-till-9th-may > Puppet Introduction Course | > https://www.open-future.be/puppet-introduction-course-12th-may > Subscribe to our newsletter | http://eepurl.com/BUG8H > > -- > 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/53451EBC.3090608%40open-future.be. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2B9CbwHCpSwO17OVdNh%2Bga06e2aaV6j95CSVDv3LkcRAg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Newbie question: extending Puppet to employ AWS - firewall issues?
Hi Ian On 25 November 2014 at 08:22, Ian Hayes wrote: > A newbie question on using Puppet. I'm planning to use Puppet to spin up > new test environments for a web app within a firewall protected corporate > software dev environment. At some point we are going to run out of in house > server resource, so I am looking at the idea of using AWS as a flexible > resource pool. > > For example, I want to deploy 11 test environments and the in house > facility can only support 10, so I want to spin up the 11th in AWS. Are > there any basic tutorials available for how to accomplish this? Also do I > need to worry about firewall issues? > We (I work for Puppet Labs) just shipped a module that allows for managing some parts of AWS using the Puppet DSL. https://github.com/puppetlabs/puppetlabs-aws This module is a preview, it's not able to manage everything in AWS at the moment but we're adding more support soon. We'd love to know what else you'd like to be able to do with it though. With regards AWS, on the network/firewall front you might want to look at AWS VPC (Virtual Private Cloud) http://aws.amazon.com/vpc/. This would allow you to create a VPN between your internal firewalls and AWS, basically extending your network. In terms of Puppet code on the AWS instances, assuming you're running the same operating system in AWS and your local infrastructure, your Puppet modules should work exactly the same. Gareth > > -- > 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/40bc9325-f1fc-4b4f-97a3-1e7691b3779e%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLaFGgSusf0-BBt%2BfUjwxwKKTVL18Xjj5LNZoabkJGZrg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] not able to run Linux command through puppet
On 5 January 2015 at 19:33, Spriya wrote: > Hi, > > I am trying to run linux command through puppet. when i run the same command > in the command line it is working fine. But when i placed it in the puppet > it is throwing me an error. > > Here is the code: > > Facter.add('unknownjava') do > setcode do > %x(`/usr/bin/diff <(/bin/sort /home/weblogic/javafoundmodified.txt) > <(/bin/sort /home/weblogic/authorizedjava.txt) > > /home/weblogic/unknownjava.txt | /bin/sed -i 's/^.//' > /home/weblogic/unknownjava.txt`) > end > end > > > Here is the error: > sh: command substitution: line 0: syntax error near unexpected token `(' > sh: command substitution: line 0: `/usr/bin/diff <("/bin/sort > /home/weblogic/javafoundmodified.txt") <("/bin/sort > /home/weblogic/authorizedjava.txt") > /home/weblogic/unknownjava.txt | > /bin/sed -i 's/^.//' /home/weblogic/unknownjava.txt' > sh: command substitution: line 0: syntax error near unexpected token `(' > I'm guessing here a little but I think this is because the command is executing under sh, and when you run in manually it's executing under bash. So try something like: (`bash -c /usr/bin/diff Gareth > > > -- > 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/8b32a0d5-f06a-4598-9f72-b5a3aca4a610%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2BznKWE-qB07Zp_GX%2BvdzM71TM9eDmd29Dg9NmA_0h3Pw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] rspec-puppet: let( :title ) isn't setting title
t; diff-lcs (>= 1.2.0, < 2.0) > rspec-support (~> 3.1.0) > rspec-mocks (3.1.3) > rspec-support (~> 3.1.0) > rspec-puppet (1.0.1) > rspec > rspec-support (3.1.2) > > > PLATFORMS > ruby > > > DEPENDENCIES > facter (>= 1.7.0) > puppet (>= 3.3) > puppet-lint (>= 0.3.2) > puppetlabs_spec_helper (>= 0.1.0) > > -- > 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/39cf1edd-aa4f-4370-8674-4b041e4cfa86%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yJHCKCGx3wrS0ZquBXoee%3DiP22oD1jn64Sjed57S4Z7Lw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] beaker
On 6 February 2015 at 01:33, Marc Lucke wrote: > Hi, > > I'm having excruciating problems with just getting beaker to run on Fedora > 21, Ubuntu 14.10 and even CentOS6. I don't normally ask for help because > frankly I don't need it. I use rbenv & native versions of Ruby and although > it's a pain in the flower to get bundle to install everything, bundle exec > rake spec works fine, it's only when it comes to spinning up a SUT that I > get issues. > > The first issue I get is centos. I can't get centos-64-x64-vbox4210-nocm in > the puppetlabs-apache to get past the initial vagrant ssh stage. So I > specified centos-65-x64-virtualbox-puppet instead & then it will get to that > point. However it fails with: > > - > Allocated a PTY on 10.255.116.82 for "sudo -E /sbin/service sshd restart" > Warning: Try 1 -- Host 10.255.116.82 unreachable: connection closed by > remote host > Warning: Trying again in 1 seconds > ... > Warning: Trying again in 5 seconds > Warning: Try 6 -- Host 10.255.116.82 unreachable: connection closed by > remote host > Warning: Trying again in k seconds > > Warning: Try 11 -- Host 10.255.116.82 unreachable: connection closed by > remote host > Warning: Trying again in 89 seconds > Failed to connect to 10.255.116.82 > Failed: errored in CLI.provision > # > > /home/mlucke/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/beaker-2.3.0/bin/beaker:6 > Cleanup: cleaning up after failed run > - > > I set v.gui=true in ~/.vagrant.d/Vagrantfile & if I logged in & did 'sudo -E > /sbin/service sshd restart' before the failure to connect, I could get it to > keep going. The beaker test I'd written was fine, but the beaker-rspec test > of the puppetlabs-apache module did not. > > The second issue I get is trying to use docker, & an issue I get I also get > in vagrant when trying the puppetlabs-apache test, & that is the error: > "mock_framework configuration option must be configured before any example > groups are defined" > > I'm tearing my hair out with this. It shouldn't be this hard? > What version of Vagrant are you using? Vagrant recently switched from a fixed ssh key to a generated one, and I ran into a similar problem. The latest version of Vagrant is 1.7.2. Gareth > So anyway, I'd like to ask if anyone here can test puppetlabs-apache with > beaker-spec if they could please please tell me versions of vagrant, ruby, > OS etc. Better still if you have a box to share that'd be great (I did find > one on vagrantcloud but couldn't get it working). Ultimately to avoid the > vagrant you can't run a virtualbox inside a virtualbox problem, I'd love > beaker to use docker instead. > > Finally, the machine doing the beaker tests is behind a proxy, & complexity > behind that is fiendish. I can get part of the way with vagrant-proxyconf & > building base docker images with proxies set except that beaker rebuilds the > docker container without the env - grrr! > > > Cheers > > -- > 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/54D40BDE.5000706%40marcsnet.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yKqSmrPR13KfyRFMPwvW11jW5e_-%3DDyHNVCj-H2MkRKuA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Announce: Puppet Language Style Guide 2.0
On 2 February 2015 at 21:58, Trevor Vaughan wrote: > Inline > > On Mon, Feb 2, 2015 at 3:24 PM, Garrett Honeycutt > wrote: > >> >> Awesome work on the new style guide! > > > Completely agree! > >> >> >> == Section 5 >> Why the arbitrary line length? Puppet's DSL does not have the ability to >> break lines, such as '\' in bash, so imposing any limit does not buy >> anything, certainly not readability. If you want to give clear error >> messages that improve readability they will include the variable and its >> data which could be greater than 140 characters. In essence, until there >> is a way to break lines in the DSL, there should not be any limit to how >> long a line could be. >> > > 100% agree with this. I always turn off line length checking because > otherwise, it's completely unreadable over time. > >> >> == Section 9.6 >> This suggests that using symbolic modes (mode => 'u=rw,g=r,o=r') are >> acceptable. What is the purpose of this? This decreases readability and >> understanding. > > > How do you do this with numeric modes? > > mode => 'o-rwx' > > I.e. I don't care what U and G are but O better not be rwx. > > I would say that numeric should be 'preferred' but that symbolic should be > completely acceptable. > >> >> == Section 10.2 >> Would add that includes should happen right after defining parameters >> and before validation. >> > > I'd like to vote for putting all validation at the bottom of the file. > > Honestly, we're getting quite heavy in the amount of cruft in the files in > general. > > For a file with 30 parameters: > > ~ 120 lines of comments > ~ 30 lines of parameters > ~ 30 lines of validation Worth noting that much of the validation is type checking, and with actual real types coming in 4.0 I'm looking forward to deleting much of those lines of validate_ function calls. http://puppet-on-the-edge.blogspot.co.uk/2014/06/optionally-typed-parameters.html Gareth > > This is *before* you get to any code. And, of course, the processor has to > ignore all that stuff, which could be upwards of a couple of MB of data for > large code sets. > > Would moving the comments to another file be better? modulename/doc/init.md, > modulename/doc/subclass.md, etc...? > > Anyway, back to my point. Having 30 more lines of stuff to wade through > before I get to code is just irritating, particularly when Puppet prints out > the exact line for validation when it errors out causing an immediate lookup > capability. > > Should there be some standard for 'Here There Be Code?'. > > For Example: > > # Commenty goodness > # > class foo ( > ... 30 params that point to another file ... > ) { > > ... 40 lines of validation magic > > ## I LOVE CODE ## > > user { 'something_useful': } ... > > == Section 10.2.7 > > I tend to order things in resource alphabetical order because then, if I'm > looking for a file resource, it's in the 'F' section. And I still like the > fact that order doesn't matter in Puppet unless I tell it to. Accordingly, > should I happen to break my order accidentally, I really don't want to care. > >> == Section 10.4 >> Suggest adding that chaining arrow syntax should only be used with the >> reference syntax and not between resources. The example below is a bad >> use of the chaining arrows that leads to changing ordering by >> inadvertently moving resources around. This is easy to do when merging >> software. >> >> package { 'foo': >> ensure => present, >> } -> >> >> service { 'food': >> ensure => running, >> } >> > > 100% Agree. This is very difficult to troubleshoot. > >> >> == Section 10.6 >> Suggest that while having required parameters for defines is OK, having >> them for classes is not. There should never be required parameters for a >> class. This breaks the ability to `include` a class. >> > > No, I disagree here. There are (many) times that I *need* you to give me a > parameter, I can't make one up that is magically correct. Moving this to a > define-only state means that we have to start slinging around singleton > defines which is what parameterized classes got us away from. > > I'd rather have my compile break than end up with a system doing something > nonsensical, particularly when the security of the system may be at risk. > >> >> > &g
Re: [Puppet Users] Module Design Pattern
On 6 May 2016 at 12:19, Alexander Dacre wrote: > I'm looking to build my first module with custom types and providers, but I > have some questions that I've been unable to find answers to. > > Lets say I have an application with a REST API that allows the creation of > widgets. My custom type and provider would define what the widget looks like > and contain code on how to create/delete etc. The problem is that the REST > API is authenticated with basic auth over HTTPS. Now, my question: what is > the general best practice for taking these credentials? Class parameters? On > a type instance basis? > I have a few examples of this. I think my first recommendation would be to reuse a existing method of providing the authentication details if one exists for the API in question. So for instance: https://github.com/garethr/garethr-kubernetes https://github.com/puppetlabs/puppetlabs-aws The Kubernetes module includes code to parse a standard kubernetes.conf file. The AWS module loads config from environment variables or from a config file (or just uses IAM so no config internal required), as is standard for all the official AWS tools. The Azure module does similar, but implements the logic itself which might be of use. https://github.com/puppetlabs/puppetlabs-azure/blob/master/lib/puppet_x/puppetlabs/azure/config.rb Personally I don't think of authentication details as a property of the type, more a property of the host. By decoupling the two you open up options for dealing with those secrets how ever the end consumer wants, ie. use keywhiz or vault or conjur, file permissions, manage with Puppet resource, auditd rules, etc. All without requiring direct Puppet integration. Gareth > Thanks, > A > > -- > 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/9b21c33e-e442-4890-91f3-b15baf47acec%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yL7JSCBsxLjSCejZi5eBYqHT7b-k-XXGj3prk6iFxPD9w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Is there a way to publish a module via the Forge API?
Hi Amos On 20 May 2016 at 05:51, Amos Shapira wrote: > Hello, > > I didn't find a way to upload a module to the Forge using the Forge API. Is > this possible? > > I find it a bit weird that a tool which advocates "infrastructure as code" > doesn't cater for options to script module uploads. > It is indeed possible. Better that possible, there is even have a handy tool that provides a nice user interface for doing so. https://github.com/voxpupuli/puppet-blacksmith Blacksmith provides a number of useful commands for determining how you want to go about releasing your modules. The simplest is to just run: rake module:release The README has lots more details. Gareth > Am I missing something? > > 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/8cbb7e19-dbf8-4f06-9a52-76ebb5c24287%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLuq4iVt0w%3DzxZmLj6-Fdzr4uU6N8u1NGPqGSdo9KOBDA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Puppetserver package for Ubuntu Xenial not yet available?
On 18 May 2016 at 23:29, Martijn wrote: > That's excellent news Matthaus. Thanks. > > Op woensdag 18 mei 2016 20:04:18 UTC+2 schreef Matthaus Litteken: >> >> Martijn, >> Yes, there is a plan for releasing Xenial packages. There are puppetserver >> and puppetdb releases tentatively planned for tomorrow that will contain >> Xenial support. >> Just to say I installed these successfully this morning. You'll just need to add the Xenial puppet collection repository from: wget https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb Gareth > -- > 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/c62a46c4-3447-4aab-ad19-0d9f57282108%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yJy%3DE6VZrM4BgGxMMfudhmNhhhM6BLTauRD6zADK-zBpg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Puppet "autoconfigured" clients on AWS - classes from EC2 tags/userdata
On 26 May 2016 at 22:11, Martin Langhoff wrote: > Hi Puppeteers, > > folks are mapping "role" from EC2 tags or userdata into a `case` > statement in site.pp to choose a pre-built configuration. > > I wonder whether there is a way to bring in a listing of classes, as > can be done with hiera (`hiera_include("classes")`). > There are lots of hints and tips in this white paper. https://puppet.com/blog/making-life-puppet-and-aws-or-other-cloud-services-easier In particular it covers using the policy based autosigning and trusted facts to secure doing what I think you're doing. Obviously I'm biased as I now work at Puppet, but it's definitely worth a read. Gareth > thoughts? > > > > m > -- > martin.langh...@gmail.com > - ask interesting questions > - don't get distracted with shiny stuff - working code first > ~ http://docs.moodle.org/en/User:Martin_Langhoff > > -- > 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/CACPiFCJK%2BAAVgpdo7LBi_H1AGfKyuF9HJbPaD21FMn_dcQzFDg%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yKOhovji58TXZGOwKj7p3Gw_wLtVx0i4KpJTrm%3Du_mKcw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Puppet-in-Docker
Hi All A few folks might have seen this yesterday, but just in case. https://puppet.com/blog/puppet-docker-running-puppet-container-centric-infrastructure I've been working on a set of Docker images for running Puppet software, so Puppet Server, PuppetDB, etc. The blog post above covers why and when this might be useful, but a few examples: * You want to run Puppet on something like CoreOS, PhotonOS or Atomic where containers are the defacto way of installing software * You want a full local development environment (including on WIndows or OSX) with minimal overhead The Dockerfiles and various build tools are available on GitHub: https://github.com/puppetlabs/puppet-in-docker And the images are available today on Docker Hub: https://hub.docker.com/u/puppet/ We've also created a number of examples that show a few tips and tricks, including standing up the server stack using Docker compose: https://github.com/puppetlabs/puppet-in-docker-examples These are an experimental way of packaging up and releasing Puppet software intended for those people already familiar with Docker. We'd love any feedback about what you like and don't like, what you'd like to see in the future or anything vaguely related. And a quick thanks to all the people in the Puppet community who have rolled their own versions of this at some point or another. By having an official Puppet repo we're hoping that for the common case we can get everyone collaborating on a shared set of Dockerfiles/images, and that with many eyes come all the good ideas, but we want to make them a good starting point for advanced users too. Cheers Gareth -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yJiXCCBoBeZCB90oi9JGSCbVbirYrG2ha460L3aHgTsHg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Re: Puppet-in-Docker
On 4 June 2016 at 17:01, Thomas Müller wrote: > Hi Gareth >> >> >> >> * You want to run Puppet on something like CoreOS, PhotonOS or Atomic >> where containers are the defacto way of installing software >> * You want a full local development environment (including on WIndows >> or OSX) with minimal overhead >> >> The Dockerfiles and various build tools are available on GitHub: >> >> https://github.com/puppetlabs/puppet-in-docker >> > > Just at the right time. Wanted to start playing around with runnning a > master in a docker. > Excellent, do let us know how you get on. > Browsing the Dockerfile on github I wondered why the config is not managed > by puppet (apply). I would have expected that after the agent is installed > that* everything else would be configured by Puppet manifests. > > Have not thought about it very long but it seems to me that managing the > config in puppet manifests would be cool. :-)I thinks of having a complete > control-repo style environment inside the Dockerfile directory to use with > puppet apply. > In the case of these initial images the amount of post package installation configuration is minimal, or in some cases even none [1]. So I stuck with a more Dockerfile native approach. I definitely think there are cases where Puppet makes a good tool for image configuration though. I was talking to a few folks about this example [2] using Rocker to avoid the resulting image size being too large just last week. I think one of the benefits (that might make this repository flip over to using Puppet later) would be the ability to create many images from a single Puppet codebase. This would avoid some of the repetition that often follows Dockerfiles around. I have some ideas for some quite nifty Puppet-native tooling here too. If anyone is going to be at DockerCon come and say Hi on the Puppet booth. I'm giving a talk about the pros and cons of Dockerfile, and on the need for higher level tools for image building that would probably be of interest. [1] https://github.com/puppetlabs/puppet-in-docker/blob/master/puppet-agent-ubuntu/Dockerfile [2] https://github.com/puppetlabs/puppet-rocker-demo [3] http://dockercon2016.sched.org/event/70Ng/the-dockerfile-explosion-and-the-need-for-higher-level-tools G > - Thomas > > * > https://github.com/puppetlabs/puppet-in-docker/blob/master/puppetserver-standalone/Dockerfile#L11 > > -- > 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/ec6ddc1e-e66d-4151-b92f-0a8e05cc072b%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLyv3%2BrmPJea3_%2BByjhqVkhn81wC7fbRTxKQ-iZ1kTOXg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] check if the package is installed and compare the version
HI Stanislas On 17 June 2016 at 10:23, puppetstan wrote: > Hi, > > > I'm not an expert on puppet and I have some syntax problems > > > I would check if the package is installed and compare the version of the > package with the version I would like to see installed > > > IF the package is installed with the correct version DO NOTHING > > BUT if it is not installed or installed but not the correct version, > uninstall it and download the right package with the right version and > install > Puppet as a language is declarative, rather than imperative. So the package resource actually does exactly what you describe here. package { "xyz": ensure => '1.2', } The above would, if it finds xyz installed at version 1.2 do nothing. If it's not installed, or installed at a previous version, it will update the package to the specified version. Gareth > > I started to do something that is not terrible and I would like your help to > answer my problem > > > thank you very much in advance > > > here is the beginning of what I've done > > > if package { 'xyz' ensure=> '1.2'} > do nothing > > else { > exec => rpm -e xyp-packagebadversion > > > file { "/tmp/xyz-packagegoodversion": >ensure => 'present', >source => "puppet:///modules/package/xyz-packagegoodversion" > > } > > package { "xyz": > ensure => '1.2', > provider => 'rpm', > source => "/tmp/xyz-packagegoodversion" > } > > -- > 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/4835a155-1a2c-4857-b0a4-090dd1a28657%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2Bndr33VBAXcK4nnZZTcyn3orV%3DsLZB8F4tv%3DNFFA9mow%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Code coverage for puppet resources
On 17 June 2016 at 15:24, Chris Denneen wrote: > Gareth, > > I know this thread is old but do you have a way in the Rakefile to exclude > the dependent modules? > For example dependent modules that include different package resources based > on OSfamily and version are something that module controls and tests I just > need to make sure that the module is included in my catalog and any defined > types used in my module get tested. (dependentmodule::resource['foo']) > I've seen some other posts hacking rspec coverage.rb which probably isn't > good (https://github.com/rodjek/rspec-puppet/issues/364). > I've noticed the filtered?(resource) in rspec-puppet just documented of how > to implement. > Hopefully you can help here. > I _think_ the coverage support now does this by default? Anything from fixtures should now be ignored. https://github.com/rodjek/rspec-puppet/pull/258 Other folks have made a whole bunch of improvements to the coverage support in rspec-puppet since I added it. Gareth > Thanks > > On Friday, February 7, 2014 at 5:54:06 AM UTC-5, garethr wrote: >> >> On 7 February 2014 02:51, gh wrote: >> > On 1/26/14 7:50 AM, Gareth Rushgrove wrote: >> >> For anyone else who likes writing tests for their puppet manifests, >> >> I've just added basic code coverage to rspec-puppet: >> >> >> >> A blog post here about how to use it: >> >> >> >> >> >> http://www.morethanseven.net/2014/01/25/code-coverage-for-puppet-modules/ >> >> >> >> I'd be interested in any feedback on how to improve or add to this. >> >> >> >> Cheers >> >> >> >> Gareth >> >> >> > >> > Gareth, >> > >> > Great blog post. I tried this on a module with 100% coverage and notice >> > that it reports back 50% coverage. After some poking around, found that >> > it is checking code in spec/fixtures/, the stdlib module actually. There >> > seems to be an open issue[1] regarding the inability to exclude things. >> > Curious if you found a work around for testing your code and not the >> > modules pulled in from .fixtures.yml. >> > >> >> Currently the rspec-puppet coverage stuff does check coverage across >> all resources, including those from dependent modules. For example >> this module depends on the puppetlabs/apt module - >> https://travis-ci.org/garethr/garethr-nginx/jobs/18133670#L113 >> >> I purposefully didn't add too much configuration to the first pass of >> the code, but it would be simple to add some options to ignore >> specific modules (I think). I thought I'd wait to see if anyone found >> it useful first. >> >> Gareth >> >> > [1] - https://github.com/lemurheavy/coveralls-public/issues/184 >> > >> > BR, >> > -g >> > >> > -- >> > 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/52F44A2E.3070903%40garretthoneycutt.com. >> > For more options, visit https://groups.google.com/groups/opt_out. >> >> >> >> -- >> Gareth Rushgrove >> @garethr >> >> devopsweekly.com >> morethanseven.net >> garethrushgrove.com > > -- > 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/2d63d692-f837-42da-a44e-c5b73dbfa015%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yKS57JXfBCxKm8Bi%2BWUgyTU3xWch%2BM_eoec-WAUapFkjQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] How to have a Puppet module install a particular version of something (docker, for instance)
On 17 June 2016 at 18:36, David Karr wrote: > I'm stepping through "Puppet for Containerization". The very first exercise > fails to start up the docker service, apparently because of an invalid > command-line option ("-d") sent to docker in the systemd service > description. This is being done by the "garethr/docker" Puppet module from > the forge. I determined that this was happening because the exercise was > specifying a somewhat older version of the module, and simply changing the > Puppetfile to use the newer version fixed the problem. Apparently this > option used to be valid in an older version of docker, but had since been > removed. > > It occurred to me that this situation likely happened because the Puppet > module was written a while ago, and it likely just specified to install the > latest version of docker. > > What I'd like to understand, at least in the scope of this particular module > (https://github.com/garethr/garethr-docker), and perhaps in general, what > exactly is a "best practice" for specifying an exact version of a dependency > to install, as I likely wouldn't have seen this error if the module > installed a specific version of Docker that this was known to work with. > > I did search through the code of the module, but although seeing that > perhaps > https://github.com/garethr/garethr-docker/blob/f1f701c5d4845c6dbb85d817d99a4cf9b0c2edae/manifests/params.pp > is where this might go, I didn't see a clear answer for how this might have > been changed to do that. > > Just so it's clear, I'm not suggesting that this change should be made in > this particular module, but if I did have a module that had to work with a > particular version of one or more dependencies, understanding how this > module would be changed to effect that might be a good guide in the future. > The general approach is to set default values in the params.pp. In fact the module in question does that for Compose here: https://github.com/garethr/garethr-docker/blob/master/manifests/params.pp#L74 I took the decision to set the default to latest for the version of docker installed because Docker itself moves quite quickly. And you nearly always want the latest released version in this case imho. If instead I'd preferred to set a specific version for the module then I would have set a default value in params.pp here: https://github.com/garethr/garethr-docker/blob/master/manifests/params.pp#L6 (mainly because Docker moves quite quickly) they have a habit of breaking changes in minor versions. I try and call this out in the Changelog when this happens, for instance for this particular case: https://github.com/garethr/garethr-docker/blob/master/CHANGELOG.md#2016-02-12---version-51 Gareth > -- > 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/dbac3102-c2ec-4d26-8f71-7a51e992eeac%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yKJRT-XXJMa8mB78LKQxjv-XZ5oTC_CBBoUEuKEhbjyTA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] puppet-agent package on FreeBSD
On 17 June 2016 at 23:42, Dan Mahoney wrote: > All, > > I keep seeing updates about a new release of a standalone puppet agent. > > Other than small file size and a possible reduced dependency set, is there > any useful point in porting it to FreeBSD? > > Right now, on FreeBSD, pkg shows the following subset of things for a "pkg > search puppet" (there are other things that aren't relevant, like a Nagios > plugin and the like): > > puppet37-3.7.5_1 Configuration management framework written in > Ruby > puppet38-3.8.4_1 Configuration management framework written in > Ruby > puppet4-4.4.1 Configuration management framework written in > Ruby > puppetdb-2.3.8_1 PuppetDB storeconfigs backend > puppetdb-terminus-2.3.4_1 PuppetDB storeconfigs backend terminus module > puppetdb-terminus4-4.0.0 PuppetDB storeconfigs backend terminus module > puppetdb4-4.0.0PuppetDB storeconfigs backend > puppetserver-2.2.1 Puppet Server running in the JVM > > None of these version numbers seem to align with the things I see being > announced here -- do the packages being built here basically include the > agent? > > We have lots of nodes where we don't need a full puppet server, but I don't > know how much code that would actually save. (Disk is cheap) > This is a good place to start to understand what the puppet-agent package is: https://docs.puppet.com/puppet/latest/reference/about_agent.html Specifically it's an all-in-one package which includes Puppet as well as all it's dependencies (including Ruby, OpenSSL, etc.) and some additional Puppet-related tools. I would guess the puppet4-4.4.1 package you mentioned includes Puppet 4.4.1. You can see from the above page that that version of Puppet was included in the puppet-agent 1.4.1 release. (the latest version is 1.5.2, which includes Puppet 4.5.2) The advantage of the puppet-agent package in this context is that the whole thing can be validated as known-good. So you're not left managing a separate version of Ruby and the other Ruby dependencies. Some prefer managing everything themselves, so whether a puppet-agent package for FreeBSD meets your needs is a bigger question. But it would have the the 4.5.x series of Puppet rather than the older 4.4.1 version. Gareth > -Dan > > -- > > > Dan Mahoney > Techie, Sysadmin, WebGeek > Gushi on efnet/undernet IRC > ICQ: 13735144 AIM: LarpGM > Site: http://www.gushi.org > --- > -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yJEd%3DYC5Td9e2gaCONUimnhD1SBYDctwgWqP9W%2BMmEFgw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] puppet-agent package on FreeBSD
On 19 June 2016 at 01:58, Dan wrote: > On Sat, 18 Jun 2016, Gareth Rushgrove wrote: > >> On 17 June 2016 at 23:42, Dan Mahoney wrote: >>> >>> All, >>> > >> Specifically it's an all-in-one package which includes Puppet as well >> as all it's dependencies (including Ruby, OpenSSL, etc.) and some >> additional Puppet-related tools. > > > [snip] > >> The advantage of the puppet-agent package in this context is that the >> whole thing can be validated as known-good. So you're not left >> managing a separate version of Ruby and the other Ruby dependencies. >> Some prefer managing everything themselves, so whether a puppet-agent >> package for FreeBSD meets your needs is a bigger question. But it >> would have the the 4.5.x series of Puppet rather than the older 4.4.1 >> version. > > > It would mean building and compiling everything separately -- it's not quite > a "meta package", which is just a package that installs several sub-packages > -- it seems to be more that it drops those dependencies into a private > namespace like /usr/local/puppet/bin/ruby or something like that? So if you > have some tool that upgrades openSSL, the puppet version stays the same? > Correct. For the most part everything goes into /opt/puppetlabs. > What I was hoping for -- but I guess it isn't -- is a smaller, faster, > fewer-dependencies tool (think spamc, written in c, versus the full on > perl-based spamassassin). Or perhaps, think busybox versus many of the > standard tools it can replace. I guess it's not that. > > Alas not, but that's the direction things are heading. For instance take Facter. Facter prior to 2 is implemented in Ruby. It requires the Ruby runtime and related system dependencies. Facter 3 is implemented in C++ and compiled down to a native binary. The native version of Facter is definitely "smaller, faster, fewer dependencies". It's the Facter shipped as part of the puppet-agent all-in-one package today. Gareth > -Dan > > -- > Dan Mahoney > Techie, Sysadmin, WebGeek > Gushi on efnet/undernet IRC > ICQ: 13735144 AIM: LarpGM > Site: http://www.gushi.org > --- > -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLjbS7xT3bH%2BXdsKTOiV8UoNuR5g4qCXx2rqMLVjRvceg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] How to have a Puppet module install a particular version of something (docker, for instance)
On 19 June 2016 at 01:14, David Karr wrote: > On Saturday, June 18, 2016 at 6:56:16 AM UTC-7, garethr wrote: >> >> On 17 June 2016 at 18:36, David Karr wrote: >> > I'm stepping through "Puppet for Containerization". The very first >> > exercise >> > fails to start up the docker service, apparently because of an invalid >> > command-line option ("-d") sent to docker in the systemd service >> > description. This is being done by the "garethr/docker" Puppet module >> > from >> > the forge. I determined that this was happening because the exercise was >> > specifying a somewhat older version of the module, and simply changing >> > the >> > Puppetfile to use the newer version fixed the problem. Apparently this >> > option used to be valid in an older version of docker, but had since >> > been >> > removed. >> > >> > It occurred to me that this situation likely happened because the Puppet >> > module was written a while ago, and it likely just specified to install >> > the >> > latest version of docker. >> > >> > What I'd like to understand, at least in the scope of this particular >> > module >> > (https://github.com/garethr/garethr-docker), and perhaps in general, >> > what >> > exactly is a "best practice" for specifying an exact version of a >> > dependency >> > to install, as I likely wouldn't have seen this error if the module >> > installed a specific version of Docker that this was known to work with. >> > >> > I did search through the code of the module, but although seeing that >> > perhaps >> > >> > https://github.com/garethr/garethr-docker/blob/f1f701c5d4845c6dbb85d817d99a4cf9b0c2edae/manifests/params.pp >> > is where this might go, I didn't see a clear answer for how this might >> > have >> > been changed to do that. >> > >> > Just so it's clear, I'm not suggesting that this change should be made >> > in >> > this particular module, but if I did have a module that had to work with >> > a >> > particular version of one or more dependencies, understanding how this >> > module would be changed to effect that might be a good guide in the >> > future. >> > >> >> The general approach is to set default values in the params.pp. >> >> In fact the module in question does that for Compose here: >> >> >> https://github.com/garethr/garethr-docker/blob/master/manifests/params.pp#L74 >> >> I took the decision to set the default to latest for the version of >> docker installed because Docker itself moves quite quickly. And you >> nearly always want the latest released version in this case imho. > > > Thanks for the reply, Gareth. > > As someone who strives for build repeatability, it sounds to me like the > reasoning you gave (volatile versioning) would be the reason to NOT always > use the latest. > At least as a Docker user I nearly always want to be running latest. In my experience with fast moving software you're best biting the bullet and paying the incremental cost of regular upgrades, rather than say doing jumps from 1.8 to 1.12. In cases where you want to run a specific version you can be explicit about the version either in your Puppet code or in hiera. So it's the default rather than a hard requirement. To clarify as well, when I said latest I really meant 'present' in Puppet terms. So you get the latest version on first install, but it's not set to automatically update existing installs, unless of course you set your hiera or the relevant parameter to 'latest'. A lot of this depends on how you use Puppet and how you roll out changes mind. Most modules take the same approach, ie. specifying the relevant package should be 'present', which means on first install on a clean system you get the latest version. Gareth > -- > 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/bf4352e2-429c-4835-8421-e72349b94761%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2BLvStbnmyRqkV%2Bqi6wF7mO0UkSDNWPEhzBxxk6DmUavA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] puppet strings workflow
Hi Hamel On 20 June 2016 at 10:14, wrote: > Hello, > > I'm trying to setup a documentation workflow based on puppet-strings and I > have some questions. > > 1) Is this too early? Should I stick to a plain README file? > 2) Is there any public module that is considered to follow best practice > right now? My question is where can I find a real life example of a module > documented with puppet-strings? > 3) I can't figure out how the documentation generated with puppet strings > can be presented in a standard manner, I have the impression that module > reference should be in the README, but I can't find a way to automatically > generate it from the comments in .pp files. Copying the documentation from a > puppet strings export to the README manually is really not something I'm > eager to do. > > Regards > > Thomas HAMEL > I've been using Strings for a bit and find it more useful than documenting the classes and params by hand, as well as much quicker. I've mainly been using GitHub pages to host the resulting docs, so for instance: http://puppetlabs.github.io/puppetlabs-docker_platform/ Gareth > -- > 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/dff001d8-2ddc-4fd7-8c64-19821dd9a941%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2BYg17yPAP%3DN62oGQRcLcPT%2Bbx7D-2sSOSrZOByE%2B04UQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Loading predefined docker image
Hi On 29 June 2016 at 03:51, Fuad P T wrote: > hi, > I am using Puppet open source to configure my nodes. I want to configure my > nodes as docker engines. I achieved this by this by using 'garathe-docker' > module. But i am unable to load my predefined docker image to nodes. What i > mean is, i am having 'image.tar' which was created by using 'docker save' > command from another machine and copied to puppet master. I want to load > 'image.tar' as my docker image. I tried to to extract the tar file. But not > working. Please help. You should be able to pass docker_tar to docker::image based on: https://github.com/garethr/garethr-docker/blob/master/manifests/image.pp#L20 If that's what you're trying and it's not working then please do post a gist of the code you're running and the error messages you're seeing. Thanks Gareth > > Thanks in advance... > > -- > 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/5866416e-a31e-4b58-89ed-28445a81fe59%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLGa6qngDv%3D3Ru%2BHvUE8gBgadBv_dBCoUqrssnj7ikRKA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] A Scalable HA Setup with on 2 configs, check this out !
On 17 September 2016 at 15:06, Neil - Puppet List wrote: > Hello > > I've run multiple puppet masters behind ha proxy for a few years now. I have > multiple masters, with haproxy rules directing some clients to particular > masters. I only have one puppet master as CA. I've about 600 clients. > > Initially I was concerned about only having one CA. But all it does is sign > new clients and revoke old. Haproxy trusts the clients based on this CA and > a revoke list from the CA. > > If the CA went down all existing clients would are fine, I've tested that. I > can't sign new clients or revoke existing until I recover the CA but in my > environment that's no big deal. I have backups of the CA and a new one would > not take long to spin up. > > So I wonder why you want multiple CA. What benefits would it bring? > > Happy to share example haproxy config etc if you are interested. > I'd certainly be interested in the example if you don't mind. Gareth > Cheers, > > Neil > > > On 12 Sep 2016 16:07, "Peter Kristolaitis" wrote: >> >> Serial numbers on SSL certificates are important, and your setup will >> generate many duplicate serial numbers. Ergo, this is bad. >> >> Related problem: Did you test revoking a client certificate? I suspect >> not, because the above issue will bite you. >> >> >> On 2016-09-12 12:48 AM, Ivan Arjune wrote: >> >> Did i figure out something new here, because I've been digging at this for >> a week and don't see anyone doing it like this. >> >> What i'm doing is running multiple puppetmasters behind haproxy. Each >> puppetmaster is an active ca server and share a common certificate. It >> works like a charm, in a lab. >> >> Step 1. created a common certificate that all the puppetservers will >> share. >> Step 2. point webserver.conf to the shared certs. >> Not a step 3. hit the masters through haproxy >> >> I posted this up on ask.puppet.com a few days ago and nobody seems >> interest in it. Either it's a stale forum, which i believe is true, or they >> think i'm crazy. Maybe you do to, ugg >> >> Here is the orig. post with details on the setup. >> Puppet CA Shared Certificate Guide: Scalable Puppet? >> >> I'm looking to put this into production on an infra. with around 200 >> nodes. I think it's a good idea, but can't figure out why I don't see >> anyone doing it like this yet. >> >> Million dollar question: >> Why must i use a centralized the ca server? >> >> >> >> >> -- >> 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/6dcd4a20-909c-4373-892f-0f7a3e69d19d%40googlegroups.com. >> 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/c5dbbb59-4de7-720f-3424-3135db424522%40alter3d.ca. >> 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/CAAohVBfGJx14uUqocAXPw7oJvBdVsenQhE4rjDSNCXCwjM94Vg%40mail.gmail.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLdmbE9QZ2%2BZ-OpuFGyt-mNRF5n2NuQ21SFiNTyTEbA0g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Testing Puppet code survey
Hi All I'm doing a talk at PuppetConf, all about testing Puppet code, and I'm looking for more qualitative data. If you have 5 minutes I'd love for you to complete this short survey: https://goo.gl/forms/wvKFi62SHDvcvO2o2 Please do share with colleagues or other Puppet using folks you may know. The more data the more interesting the analysis. Thanks Gareth -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2BOTTtZhrQW5vnBSJLN1quJ_Gfkv8MjG_AOgDAftk%3DLzA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Re: New to Puppet :wanted more information of VM provisioning in puppet
On 23 November 2016 at 07:56, Klavs Klavsen wrote: > lxd module for puppet can provision lxc 'vm's - and puppet-virt module can > provision kvm's. > > But normally puppets place in the footchain - is NOT provisioning.. there > are much better tools for this (razor etc.) - which then hands over OS > system configuration to puppet. > So, this really depends on what you mean by 'provisioning'. It's a common word but invariably means different things to different people in different organisations 'provisioning' different things. Ritesh, if you'd like to expand on what exactly you're attempting to do then I'm sure the responses will be clearer and more relevant. But as an overview for everyone: Razor is a bare metal provisioning tool from Puppet, so if you're provisioning from bare metal it's definitely worth looking at https://docs.puppet.com/pe/latest/razor_intro.html You mention VM's specifically, at which point it depends on the hypervisors/platform. There are different modules for the some different flavours here, for instance: AWS - https://github.com/puppetlabs/puppetlabs-aws vSphere - https://forge.puppet.com/puppetlabs/vsphere (note that this is only available for Puppet Enterprise customers) Azure - https://github.com/puppetlabs/puppetlabs-azure There is also the puppet-virt module mentioned above which has some support for Xen and KVM and the like: https://github.com/carlasouza/puppet-virt The modules tend to focus on exposing VMs as Puppet resources. This means you can use the Puppet command line tools to launch or manage VMs, but more interestingly you can also describe them in Puppet code and have a code-first provisioning workflow which is great for auditability and understanding your infrastructure. Gareth > -- > 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/ec0061c8-9463-4fa0-9405-4f17543de440%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yKuGB%3DypLyMEdWEdUepHBXxmF8XLpM3PBNFSzVMkWZKuA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Over-engineering rant
roblem everyone has. Thanks Gareth > > -- > Jakov > > -- > 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/d7250279-33b4-9d91-445c-7eaf81a13b14%40gmail.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yKsvkUnz%2B6bBMm0x5yud%2B_gZH-DErZy3PzPLJzdvzWJkg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] rspec testing dependancies
On 1 April 2015 at 15:37, choffee wrote: > Hi, > > I am having some trouble testing some classes using rspec. > > I have three classes. init, service and config. > > service contains just the service settings with a class setting for service > name eg. > > class tc::service ( >$service_name => tc::service_name > ) { > >service {'tc': > service_name => $service_name >} > } > > init has a param for setting the service name > > class tc ( >$service_name => tc::params::service_name > ) inherits tc::params { > >class {'tc::service': > service_name => $service_name >} >include tc::config > } > > The config class has something that notifies the service > > class tc::config { > file {'/foo/bar': > notify => Service['tc'], > } > } > > I am trying to test the service and config modules using rspec and get all > sorts of errors about variable blank or classes not being loaded. > > Is there some way to better set this up from a puppet point of view? I think a common pattern that does this would be: https://github.com/garethr/garethr-docker/blob/master/manifests/init.pp#L190-L195 Here we're saying: Install requires config, which notifies service. > Should I just test the init class? ( Seems to go against the unit tests a > bit ) I would say test the public interface not the implementation. If you intend your individual classes to be public, test them directly. If you don't then test them via the public interface (often init.pp). Their are a bunch of bits in https://speakerdeck.com/garethr/test-driven-development-for-puppet which might be useful. The above linked Docker module also has a somewhat large (300+ tests) rspec-puppet test suite which might be worth looking at, at least to see how I approached the problem. Gareth > Is there a way in rspec to shim a class so that things like Service['tc'] > appear to be available to the config class? > > Thanks > > john > > -- > 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/eb3d3791-d2e3-483c-9005-0b61626df7e7%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2BZ7OCBxgxMQ10UWcqO_gHfi3CL1f_KFTTMtsU7r3AT8A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Re: Puppet Opensource: handling EC2 instances on AWS
On 15 April 2015 at 12:06, Nick Howes wrote: > You could set tags on EC2 instances, and use those to classify them. You > might write a new fact called e.g. ec2_server_role, that reads in a tag from > the server, then use that fact (possibly in the default node definition, > depending on how you do things) to decide what role the node has. > > Writing custom facts: > https://docs.puppetlabs.com/facter/2.4/custom_facts.html > > I'd recommend writing your fact in a module that Puppet can distribute by > pluginsync, so you don't have to worry about pushing this custom fact script > to nodes. > > Alternatively there may well be existing modules on the Forge which can > expose tags as facts for you. > This module exposes EC2 tags to facter. https://github.com/mrzarquon/puppet-ec2tags Gareth > > On Tuesday, 14 April 2015 13:07:24 UTC+1, akash bhatia wrote: >> >> Hello, >> >> i have setup the Puppet Infra on internal datacentre at my work centre. >> >> i am able to group the agents based on nomenclature of their domain names >> >> eg: >> web1.office.org >> web2.office.org >> >> db1.office.org >> >> and so on.. and i can group them in my site.pp using the regular >> expression. >> >> i just want to understand the concept of how to achieve the same on the >> AWS, where we dont have liberty to customise domain name while creating a >> new instance in AWS EC2. >> >> Any URLs or basic idea should be highly appreciated. >> >> Thanks in Advance !! >> >> >> >> >> -- >> Cheers, >> Akash > > -- > 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/606cb1b8-de5d-43fe-b40b-a1675289fe93%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLedQh-U%2B%3DwBjxovXYd%2BxRkrpDYmuMpxDF1cRo0xkK2Kg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Strategies for Source Control with Puppet 4
Hi Rachel I'd probably take at least a look at r10k, which is an opinionated deployment tool for the problem you describe. https://github.com/puppetlabs/r10k The official documentation covers Puppet Enterprise but I think the majority of it will be applicable, especially in terms of getting a sense of what and why. https://docs.puppetlabs.com/pe/latest/r10k.html And as always Gary has a bunch of blog posts which cover more the workflow. http://garylarizza.com/blog/2014/02/18/puppet-workflow-part-3/ http://garylarizza.com/blog/2014/03/07/puppet-workflow-part-3b/ You could probably get away without given the size of deployment, but I definitely prefer using a Puppetfile to bring in first or third party modules from separate repos anyway, at which point you pretty much have what r10k refers to as a control repo. r10k then just gives you nearly-free environments based on git branches - which given the low cost then opens up some possibilities which might prove useful. If you just want the modules in separate repos part then also take a look at librarian-puppet which just does that part: https://github.com/rodjek/librarian-puppet And sure lots of other folks here have opinions and workflows too that work for them Gareth On 5 July 2015 at 08:25, Rachel Andrew wrote: > Hi all > > just wondering how you are all managing source control. > > I’m setting up a new Puppet Master and migrating my nodes to it (I’ve only > got 7 servers so we’re small fry). I only have need for the default > production environment right now and I like to keep simple things simple as > we’re not about to end up with 100s of nodes. > > I *could* just check the code directory into git, although I’d probably want > to .gitignore the puppetlabs and other 3rd party modules we use, however it > occurs to me that I could create a bunch of repositories, one for each of our > custom modules, one for the heiradata and so on. Is there an accepted best > practice for this? Any issues people have encountered? > > -- > > Rachel Andrew > > http://www.rachelandrew.co.uk > http://twitter.com/rachelandrew > > > > -- > 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/6FE5FEFB-CF7A-43F8-8A1E-0176C55CB824%40gmail.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yJydZMHzMkQbP4C8c%2BTGufneEW_9wMtC_QwwdG48NuwfA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Dictating class evaluation order
: >>>> >>>> On 07/19/2015 01:19 AM, Andrew Langhorn wrote: >>>> >>>> class apps::reservations { >>>> >>>> >>>> include tomcat >>>> >>>> >>>> tomcat::instance { ‘reservations’: >>>> >>>> ensure => present, >>>> >>>> http_port => 8080, >>>> >>>> } >>>> >>>> >>>> } >>>> >>>> >>>> However, when I run Puppet against a Vagrant VM, it tells me that the >>>> tomcat class hasn’t been evaluated, so it can’t use tomcat::instance >>>> (because of underlying failures when using the Tomcat module): >>>> >>>> >>>> ==> app: Warning: Scope(Tomcat::Instance[reservations]): Could not look >>>> up qualified variable 'tomcat::instance_basedir'; class tomcat has not been >>>> evaluated >>>> >>>> >>>> Hmm, if the resource declaration is lexically preceded by an 'include >>>> tomcat' then this should not happen. >>>> >>>> In this case, the order in your manifest is really important. Is your >>>> snippet truly representative of your actual code? >>>> >>>> Regards, >>>> Felix >>> >>> -- >>> 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/2d506a73-c86a-4ddd-bfd4-09579565bd04%40googlegroups.com. >>> >>> For more options, visit https://groups.google.com/d/optout. >> >> >> >> >> -- >> Join us at PuppetConf 2015, October 5-9 in Portland, OR - >> www.2015.puppetconf.com >> Register early to save 40%! >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Puppet Users" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/puppet-users/w9mVNiq8kAk/unsubscribe. >> To unsubscribe from this group and all its topics, 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/CACZQQfO4BWWK3_aZ2xBWSRaKGnGp00uaA66DVFxkL-7jdOadbA%40mail.gmail.com. >> >> For more options, visit https://groups.google.com/d/optout. > > > > > -- > Andrew Langhorn > Web Operations > Government Digital Service > > e: andrew.langh...@digital.cabinet-office.gov.uk > t: +44 (0)7810 737375 > a: 6th Floor, Aviation House, 125 Kingsway, London, WC2B 6NH > > -- > 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/CANCa_Wb%3DS72jJ45fbYU4eag5CedYYUxoBCc6eY8L3uXxyWZ8-A%40mail.gmail.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yJ6rosUveAyYA42FRcdrNU2ruhB8ZA%3D0-EtQWQD%2BWYy1g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Troubles with AWS module and TXT record.
Hi On 29 July 2015 at 18:34, wrote: > Hello friends, > > Having an issue with one of the aws modules I have created (dns) utilizing > the puppet-labs aws module. I am using PE v 3.7 > > The DNS module is keeping some Route53 entries in line the module is run and > several A records CNAME and txt records are validated. When it gets to this > one record in particular the puppet run shows that it is modifiying records, > however it does not, and returns the below messages : > > Info: Checking if TXT record domain.com. exists > > Notice: > /Stage[main]/Awsmanager::Dns::domain_com/Route53_txt_record[domain.com.]/ttl: > ttl changed 'value' to 'value' > Notice: > /Stage[main]/Awsmanager::Dns::domain_com/Route53_txt_record[domain.com.]/values: > values changed ['"values"', '"values"'] to '"values" > "values"' > Info: Updating TXT record scalert.com. > Error: > /Stage[main]/Awsmanager::Dns::domain_com/Route53_txt_record[domain.com.]: > Could not evaluate: > > The module is then able to move onto the next CNAME A records, TXT records > with no problem. Anyone have any ideas ? Im thinking it might be a syntax > issue with my TXT record, but the acknowledgement of value changes has me > wondering. > If you could provide a gist of the Puppet code you're applying that would be useful. >From the change notices this might be to do with passing multiple values or quoting inconsistencies is my first guess. Gareth > 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/e1bea6d2-5967-4dc2-903e-36cc74c5832b%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yKzSO63121r1%3DzG-nSRB5yV_0cT5mZjd9gVfQQtqMzeAw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Puppet Module spec testing
On 4 August 2015 at 20:37, Peter Berghold wrote: > Is there a newer set of documents on doing Spec testing of Puppet modules > than this link? > https://puppetlabs.com/blog/the-next-generation-of-puppet-module-testing > > I am running into a brick wall getting this to work so I have to assume I'm > doing something wrong... > If you could post a test case I'd be happy to take a look. My experience is starting from a working example is useful, shameless self promotion I know but, the puppet module skeleton should run a set of unit tests out of the box: https://github.com/garethr/puppet-module-skeleton Even if you don't use the skeleton you should be able to get the tests running at least and then port to your own module. Gareth > -- > 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/CAArvnv14GJ0v6Ef0rS4KAcrOf1C%3DUiu%3DpM%2BsnJcxjsptqeipCQ%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yKw%3Do1Ub5SOoMJ4pyvbQR77vk6yxxyJ5VXvJNw%2BYX0f5g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Write a basic custom module for puppet
On 17 September 2015 at 15:27, Arnau wrote: > Hi, > > https://docs.puppetlabs.com/puppet/latest/reference/modules_fundamentals.html > > Maybe start with: > > puppet module generate user-modulename > puppet module generate assumes a pure Puppet module, rather than one using the Ruby API. The larger skeleton I maintain has the trappings of a Ruby module, but it's fairly large at this point: https://github.com/garethr/puppet-module-skeleton > you'll get the basic stuff. > > HTH, > > 2015-09-17 8:46 GMT+02:00 : >> >> I have some experience handling puppet modules but this time I wrote some >> code in Ruby that I'd like to port to a custom puppet module. I already have >> read puppetlabs documentation( puppetforge, Beginner's guide )about writing >> custom modules but I still don't get a basic idea to build from zero a dummy >> custom puppet module to test it. >> >> >> Do you know where can I find some practical examples to build a dummy >> custom puppet module? >> The following is a pretty small/simple native type and provider. https://github.com/garethr/garethr-digitalocean It's not the best code but it works and it's not complicated, so for getting started purposes it's potentially a nice start to follow as long as you know a little Ruby. The following blog posts also give a good introduction to some of the concepts that are worth understanding. http://garylarizza.com/blog/2013/11/25/fun-with-providers/ http://garylarizza.com/blog/2013/11/26/fun-with-providers-part-2/ http://garylarizza.com/blog/2013/12/15/seriously-what-is-this-provider-doing/ And do feel frree to post code in gists for feedback here. I'd love to know what you're building too. Gareth >> -- >> 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/4cca7c51-e51a-46be-8b3f-ff8fc802d038%40googlegroups.com. >> 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/CAM69jx9Zhfd4npRUc26csPoF%2BnOcKTo5keHO-Zk3jWYB0mMTGQ%40mail.gmail.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yK1NfyujAcDBiDZGsmf42bntuGuY9UwoZUA9CYDTq4d4w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] rake coverage failing with rspec-puppet
On 12 October 2015 at 16:42, Rich Burroughs wrote: > Hey folks, > > I'm using a pretty recent version of Gareth's module skeleton and the > included Rakefile. I can run "rake spec" fine but I don't seem to be able to > get the "rake covereage" task to work. > What are you trying to get coverage for? If Puppet code you just need to drop a file into your rspec-puppet spec folder. See https://github.com/rodjek/rspec-puppet#producing-coverage-reports or for more details http://www.morethanseven.net/2014/01/25/code-coverage-for-puppet-modules/ The latest version of the skeleton now includes proper coverage support for ruby code as well using simplecov. https://github.com/garethr/puppet-module-skeleton/blob/master/skeleton/spec/spec_helper.rb#L6-L16 Specifically this will generage ruby coverage reports in a .coverage folder and a report to stdout just by running spec. Simplecov has other formatters you can add too. If memory serves the rake coverage task is from puppetlabs-spec-helper. rcov only works on Ruby 1.8. It probably wants removing. Gareth > -- > > $ bundle exec rake coverage > rake aborted! > NoMethodError: undefined method `rcov=' for > # > > Tasks: TOP => coverage > (See full trace by running task with --trace) > > -- > My first thought was to try "gem install rcov" but that blew up pretty > badly. I did some googling and got the impress that rcov is no longer in > use, and to use simplecov instead, but I installed that and I'm getting the > same result. > > I'm on OS X Mavericks/10.9.5. > > > Thanks, > > Rich > > > > -- > 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/CAPGcbtBgKvsGcWNkKK1RLvvUAvoYpa4yV7KXybm1JRw7L8X1Nw%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yJ5%2Bqr64-r190Gp7Zt0OTQy7%2BrhfnY8QX2J5EfrLQ%2BnWA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] rake coverage failing with rspec-puppet
On 18 October 2015 at 12:03, Rich Burroughs wrote: > Hi Gareth, > > Thank you. I wrote this right after PuppetConf and I was thinking, I should > have asked him about this while we were talking :) > > It's for rspec-puppet. I'll check out those links. I think I tried this with > a new module that is using a very recent version of your skeleton. > In which case you don't need a rake command, just to drop a file like the following in the spec folder: https://github.com/garethr/garethr-docker/blob/master/spec/classes/coverage_spec.rb Will give you coverage results like this: https://travis-ci.org/garethr/garethr-docker/jobs/84828196#L1075 Gareth > > Rich > On Sun, Oct 18, 2015 at 10:32 AM Gareth Rushgrove > wrote: >> >> On 12 October 2015 at 16:42, Rich Burroughs >> wrote: >> > Hey folks, >> > >> > I'm using a pretty recent version of Gareth's module skeleton and the >> > included Rakefile. I can run "rake spec" fine but I don't seem to be >> > able to >> > get the "rake covereage" task to work. >> > >> >> What are you trying to get coverage for? >> >> If Puppet code you just need to drop a file into your rspec-puppet >> spec folder. See >> https://github.com/rodjek/rspec-puppet#producing-coverage-reports or >> for more details >> http://www.morethanseven.net/2014/01/25/code-coverage-for-puppet-modules/ >> >> The latest version of the skeleton now includes proper coverage >> support for ruby code as well using simplecov. >> >> >> https://github.com/garethr/puppet-module-skeleton/blob/master/skeleton/spec/spec_helper.rb#L6-L16 >> >> Specifically this will generage ruby coverage reports in a .coverage >> folder and a report to stdout just by running spec. Simplecov has >> other formatters you can add too. >> >> If memory serves the rake coverage task is from >> puppetlabs-spec-helper. rcov only works on Ruby 1.8. It probably wants >> removing. >> >> Gareth >> >> > -- >> > >> > $ bundle exec rake coverage >> > rake aborted! >> > NoMethodError: undefined method `rcov=' for >> > # >> > >> > Tasks: TOP => coverage >> > (See full trace by running task with --trace) >> > >> > -- >> > My first thought was to try "gem install rcov" but that blew up pretty >> > badly. I did some googling and got the impress that rcov is no longer in >> > use, and to use simplecov instead, but I installed that and I'm getting >> > the >> > same result. >> > >> > I'm on OS X Mavericks/10.9.5. >> > >> > >> > Thanks, >> > >> > Rich >> > >> > >> > >> > -- >> > 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/CAPGcbtBgKvsGcWNkKK1RLvvUAvoYpa4yV7KXybm1JRw7L8X1Nw%40mail.gmail.com. >> > For more options, visit https://groups.google.com/d/optout. >> >> >> >> -- >> Gareth Rushgrove >> @garethr >> >> devopsweekly.com >> morethanseven.net >> garethrushgrove.com >> >> -- >> 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/CAFi_6yJ5%2Bqr64-r190Gp7Zt0OTQy7%2BrhfnY8QX2J5EfrLQ%2BnWA%40mail.gmail.com. >> 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/CAPGcbtAVQy3k1KumeB0RwHJRbAq6rhncrpMfs1Jfe6fMfHXikA%40mail.gmail.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLKu0A7pdXixmamWgty3OkA0Cvbd%3D4TFs3HBbWrzobOwQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Beaker and mock services
On 20 October 2015 at 08:49, Alex Harvey wrote: > Hi all, > > I am investigating whether or not I can use Beaker to do acceptance testing > on roles and profiles. > > I've had a look at Liam Bennett's excellent blog posts - > http://tech.opentable.co.uk/blog/2014/09/01/testing-puppet-with-beaker-pt-dot-3-testing-roles/ > http://www.slideshare.net/liamjbennett/cfgmgmt2015-testing-with-beaker > > I need to handle a situation in my tests where, say, a role that I am > testing will apply a base class which will cause the node, for instance, to > join a FreeIPA domain. But I don't want Beaker to actually build a FreeIPA > box. And I don't want my short-lived node to join a real FreeIPA domain. > > I would hope that Beaker could either build Mock Services > https://en.wikipedia.org/wiki/Mock_object > > Or better still, tell Beaker to expect the base class to try to apply the > FreeIPA class, and just pretend it succeeds. Just as you can stub out > methods in rspec etc. > > Has anyone done anything like this before? > You can actually do something like that :) Beaker is going to run you Puppet code on the node(s) it spins up, probably using apply manifest like so: apply_manifest(pp, :catch_failures=>true) If this sees an error while doing so (because your FreeIP class doesn't apply) then it will throw an error. However... If you check the API docs you can see: http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Helpers/PuppetHelpers#apply_manifest_on-instance_method apply_manifest(pp, :accept_all_exit_codes => true) This will run your puppet code and not throw an error. Now, whether this works for you really depends on if any other classes depend on the FreeIPA class. And you can't easily test for idempotent runs easily with this. Another approach if you can change the puppet code is to introduce a switch in the profile, for instance if a fact exists like MOCK_FREEIPA you could not include the class. And then drop that fact into your beaker test environment. Also see the other points about testing at different levels but you can absolutely do it in your acceptance tests. Gareth > Kind regards, > Alex Harvey > > -- > 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/5493914c-ecc9-42e4-ad90-4151e0e75fbc%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yL5ikcYWFGyhrYeFtqkauTX%3DE4vjsVj_tb7AYHpk%3D_Myg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Still mud-wrestling with spec testing
Hi Peter On 27 November 2015 at 20:23, Peter Berghold wrote: > So, > > Now that my schedule has some slack in it I've turned my attention back to > doing spec testing of my Puppet modules. Taking a really really simple > module that I wrote as an example I started in again. > > Here is the one and only file making up the class. > > -- init.pp -- > class ntp { > > package { 'ntp': > ensure => latest > } > service { 'ntp': > ensure => running, > enable => true, > require => Package[ntp] > } > > > } > - > > That should be really easy to run tests against in my opinion. I wrote a > Gemfle for the occasion. > > -Gemfile--- > source 'https://rubygems.org' > > puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : > ['>= 3.3'] > gem 'puppet', puppetversion > gem 'puppetlabs_spec_helper', '>= 0.1.0' > gem 'puppet-lint', '>= 0.3.2' > gem 'facter', '>= 1.7.0' > gem 'rake','>= 0.0.0' > gem 'spec','>= 0.0.0' > > and my spec file looks like this: > > --- spec/classes/init_spec.rb --- > require 'spec_helper' > describe 'ntp', :type => 'class' do > > context 'On Debian' do > let :facts do { > :osfamily => 'Debian' > } > end > > it { > should contain_package('ntp').with({ 'name' => 'ntp' }) > should contain_service('ntp').with({ 'name' => 'ntp' }) > } > end > > end > --- > > and when I run "rake spec" I get this (severely trimmed) set of errors: > -errors-- > 1) ntp On Debian should contain Package[ntp] with name => "ntp" > Failure/Error: should contain_package('ntp').with({ 'name' => 'ntp' }) > > ArgumentError: >wrong number of arguments (2 for 1) > > > Looks to me after reading "The Next Generation of Puppet Module Testing" at > this page: > https://puppetlabs.com/blog/the-next-generation-of-puppet-module-testing > there should only be one argument to "with" so.. if that's not an > authoritative page for that information, which one is? > That blog post is a good 3 years old. Probably the best place to look for up-to-date information is the rspec-puppet site itself. http://rspec-puppet.com/ You'll also find lots of examples in the the supported and approved modules on the Forge, and the module skeleton I maintain generates working tests out-of-the-box from which you could copy the requisite files. https://github.com/garethr/puppet-module-skeleton My guess here is this is something to do with versions or some other file you're using to setup the tests. If you checkout the skeleton above you should be able to do: puppet module generate yourname/ntp cd ntp bundle install bundle exec rake spec You don't need to then use the resulting module if you don't want, but you should have a working setup from which you can port to your existing modules. Gareth > Can somebody clarify for me what;s going on here? > > > -- > 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/CAArvnv0%3DEobRO49%3DhYNuf6D2e2feN4md2rFqmx%2BGySCNByhtCw%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2BZtf46%2Bf5ht4A1SVB%2B_uJE3AQ4OCo9V4H0ovrkbeywyA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Puppet Module Writing - understanding clearly package dependency resolution
On 29 November 2015 at 03:54, Warron French wrote: > Hello, I am working on writing my first puppet module. I am pretty skilled > in writing complex shell (bash, ksh, sh) scripts so I have some questions in > general about writing a thorough puppet module. > > I want to write a single puppet module to support installation, > configuration and service management of system audit (auditd for example) on > different operating systems. Specifically, Solaris 10 {x86|SPARC} and > CentOS {x86_64}. > > I know that if I have a yum repo (for CentOS) and run the command yum update > audit it will then update all of the dependencies automatically. > > So, my question is, do I need to provide syntax like the following: > > package {'audit': > ensure => latest, > name=> "${auditpkg}", > require => Package['audit-libs'] > } > > Or will the CentOS puppet agent node simply run the yum installation/update > automatically and update the audit-libs package; without any concerns? > This all depends on the package provider under the hood. In this case it sounds like that's Yum. So when Puppet runs here it will actually run Yum to install or update the package as required, in order to match the model you've described that the audit package should be the latest version. If that package automatically updates the audit-libs package (or other packages) that will happen too. > Also, and this probably might not be appropriate for this particular > email/post, but I would like to know, since Solaris 10 does not work with > repositories (correct me if I am wrong); do I need to skip the idea of > writing this module in support of Solaris 10 (even though my workplace is > still using it). I am not looking for opinions on this matter, I am looking > to know if there is a way to get puppet to update Solaris 10 systems with > puppet modules against software packages? > It depends here if you're using a package manager for Solaris already, or if you're open to using one. The difference being there are several, from memory non of which are standard, depending on your Solaris variant you're running. A quick check says the Puppet package resources supports pkgutil, sun, sunfreeware and blastwave which all target Solaris. You can find the details here: https://docs.puppetlabs.com/references/latest/type.html#package-providers Gareth > -- > 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/c4033b69-903f-4c25-8f8a-db46e049aca2%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLJa5%2B3m4YYB0Uru9K4WYcRWfL6OMv137L%2BCnMmUiJ%3DJg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Re: Custom provider woes and questions
On 7 December 2015 at 19:30, Peter Berghold wrote: > Nevermind... figured out what was going on.. and fixed that problem and > now a more bugs to squash... > > How do I raise a failed exception in a provider (this before I start > googleing) :-) > You can use the fail method as seen here. https://github.com/garethr/garethr-digitalocean/blob/master/lib/puppet/provider/droplet/v2.rb#L96 Gareth > On Mon, Dec 7, 2015 at 9:53 AM Peter Berghold > wrote: >> >> This email has two parts: >> >> First part >> >> Looking at "Sh*t Gary Says" seems to imply I may be going about creating >> custom types/providers. I am currently creating a type under >> lib/puppet/type/{typename}.rb without that logic doing anything with the >> actual logic being in lib/puppet/provider/{typename}/ruby.rb which has >> worked fine for me in the past. >> >> Someone confirm/deny. >> >> Second part >> >> I've created a pair of custom types/providers, one to set parameters and >> the other to set state. The issue I'm running into is the state provider >> is trying to work and the parameter provider doesn't even seem to be loading >> in Puppet at all without any sort of error showing up. >> >> Here is how they are being invoked in a manifest: >> >> myparmtype { 'instance': >> parm1=>'value1', >> parm2=>'value2' >> } >> -> >> mystatetype{'instance': >>state =>'mystate' >> } >> >> Sorry for the obfuscation, but what I'm working on is largely company >> proprietary. >> >> Thoughts anybody? >> >> Is there a limit to the number of types/providers a module can have? >> > -- > 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/CAArvnv20aBVzYQyU5ifFJQcuVQPEaCp63VntLMMXBBmP9%3D5SRw%40mail.gmail.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2BGg3K4-%3DnDTxjfrYrhk8d9EA-CxrWS20TBXfmvdWq1uw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] Puppet Kubernetes module released
Hey all We've just shipped a 0.1.0 version of a module to manage Kubernetes resources like Pods, ReplicationControllers and Services. This is a bit of a proof-of-concept, but it supports all the Kubernetes resources and appears to work pretty well. https://forge.puppetlabs.com/garethr/kubernetes https://github.com/garethr/garethr-kubernetes We have a small deluge of blog posts going over the details, including a full hello-world example. https://puppetlabs.com/blog/managing-kubernetes-configuration-with-puppet https://puppetlabs.com/blog/kubernetes-guestbook-example-puppet https://puppetlabs.com/blog/building-your-own-abstractions-kubernetes-puppet If anyone is doing anything with Puppet and Kubernetes (or interested in doing so) let me know, I'll love to chat next year. ## Bonus point Most of the code in the module is automatically generated from the Kubernetes swagger schema using another tool I knocked up: https://github.com/garethr/puppet-swagger-generator This undoubtedly isn't a general purpose tool yet, it likely works well only for the Kubernetes definitions for now. But if anyone has an interest in code generation or other Swagger-powered applications which would benefit from Puppet types let me know. Cheers Gareth -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2BFhAN2CRScmvKm30sYsgiQhsAP-ydyA68H%2BJfmT6%3D7gg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Slightly Off-Topic: CI Test of Puppet module fail
The error from Travis suggests a linting issue, specifically: manifests/config/mysql.pp - WARNING: ensure found on line but it's not the first attribute on line 24 My guess for why you're not seeing that locally, but it's coming up in Travis is that the version of puppet-lint is unspecified. I'd wager that locally you have an older version, but Travis is installing the latest. https://github.com/thbe/puppet-bacula/blob/master/Gemfile#L7 Looking at this more closely however the plot thickens. It looks like it might be a bug in puppet-lint. https://github.com/thbe/puppet-bacula/blob/master/manifests/config/mysql.pp#L24 The code referenced does use ensure, but as an attribute of a nested data structure, not as a parameter. Two options present: * Add a control comment to ignore the check for that line, described here: http://puppet-lint.com/controlcomments/ * Determine the local version of puppet-lint that is passing the check and pin to that version in your Gemfile I'd also open the issue over on https://github.com/rodjek/puppet-lint/issues as I think it's a bug. Cheers (and definitely not off-topic. This list is for pretty-much anything that's useful to users of Puppet in my view. Gareth On 19 January 2016 at 11:54, Thomas Bendler wrote: > > Hello, > > I have a small problem with a Puppet module I've wrote. The module is: > > https://forge.puppetlabs.com/thbe/bacula > > When I check the module locally with: > > bundle exec rake validate && bundle exec rake lint && bundle exec rake spec > SPEC_OPTS='--format documentation' > > it says everything is fine. When I deploy the module on my test box, it work > fine. When I pass my commit to Travis CI, it fail: > > https://travis-ci.org/thbe/puppet-bacula/builds/103322979 > > Any Ideas? > > Regards Thomas > -- > Linux ... enjoy the ride! > > -- > 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/CAELoU1OO_vbiJoG2gmEEbnjE23LnUvH7yYJZmk4t_W9NoK_rSg%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2Bgu9uEbG6eooEHTQsxaFu8N6dNme5Qm0QhFKhDAxu2CA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Use nodes with defined resource in nginx configuration
On 19 January 2016 at 11:34, Lowe Schmidt wrote: > Exported resources would accomplish what you are trying to do, as long as > you don't often and rapidly remove and add upstream app-hosts. > If you find you do want to change things more rapidly, integrating with a service discovery mechanism is a nice approach. This repo, and accompanying presentation I gave last year demonstrate using Consul, along with the Consul module and Hiera backend to accomplish dynamic changes to configuration of an nginx upstream. The demo uses Puppet Enterprise but the approach is general purpose, and the modules are all open source and from the wider Puppet community. https://github.com/puppetlabs/puppet-enterprise-consul-docker-demo https://speakerdeck.com/garethr/service-discovery-and-configuration-management The key trick is to use some sort of watcher (in my case the build-in consul watcher setup using the ::consul::watch Puppet type) to detect changes across the cluster as they happen and to run Puppet to update the proxy straight away. Gareth > -- > Lowe Schmidt | +46 723 867 157 > > On 18 January 2016 at 14:29, Frederik Bjerggaard Nielsen > wrote: >> >> Hi, >> >> I am working on making our puppet infrastructure more dynamic where I can >> add any number of nodes and these will automatically be applied in another >> nodes configuration. >> >> An example: >> I have X number of hosts running a Java application, which are defined by >> our javaapp module with the following define in it (simplified): >> >> define javaapp::site ( >> $site_name, >> $site_port ) { >> # Doing some stuff regarding deployment etc here >> } >> >> These are defined in the site.pp file like this: >> >> javaapp::site { 'app01': >> play_site_name=> 'app01', >> play_site_port=> 9100, >> } >> >> We have a nginx reverse proxy in front of these application servers where >> I need to forward requests to a range of servers. Currently my nginx >> template looks like this: >> >> upstream app-hosts { >> server <%= @host_app_01 %>:9100; >> server <%= @host_app_02 %>:9100; >> } >> >> Where @host_app_01 and @host_app_02 have been defined globally in the >> site.pp file with the IP of the nodes. >> >> What I would like to do is to collect an array of the nodes with a >> specific javaapp site name and use it in the nginx template. >> >> I have read a little about exported resources, but I can't figure out >> whether it is the right thing for this situation? >> >> Is it even possible to do with puppet? >> >> We are running puppet version 3.7.5. >> >> Thanks in advance. >> >> Regards >> Frederik Nielsen >> >> -- >> 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/a3bcb7c2-f8bb-4b4b-a901-a328662e2266%40googlegroups.com. >> 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/CAC-wWcQTTqcZe1x3rfswQmTyV1pzMKNcMSFe5RHNZtCB43Q8pw%40mail.gmail.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2BuGBmHjuAeQ2YTYVM%2B9K3yixpRe3FvffzHLFuu2jby2w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Prefetch in custom types in Puppet v4?
On 19 January 2016 at 01:52, Jakov Sosic wrote: > Hi guys, > > > I've noticed the following problem with one of my providers in v4. > > This is the original prefetch method I used: > >def self.prefetch(resources) > instances.each do |prov| >if resource = resources[prov[:name]] > resource.provider = prov > +resource.provider = new(prov) >end > end >end > > > > This was throwing out following errors: > > Error: Failed to apply catalog: undefined method `intern' for > # > > > > After that I changed it to: > > def self.prefetch(resources) > instances.each do |prov| > if resource = resources[prov[:name]] > resource.provider = new(prov) > end > end > end > > Now, puppet agent doesn't throw out any error, but when I run: > > # puppet resource myprovider > Error: Could not run: undefined method `name' for # > > My guess is it's an issue in your self.instances method and a matter of exactly where you're called new. I nearly always having something like: def self.prefetch(resources) instances.each do |prov| if resource = resources[prov.name] resource.provider = prov end end end Where instances returns an array of objects created using new. def self.instances some_list_of_things.collect do |obj| new({ name: obj.name, ensure: :present, }) end end Hopefully that helps, if not I'd recommend posting a gist of the self.instances method or a pointer to the whole provider. Thanks Gareth > Any ideas?? > > -- > 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/569D96C4.6070309%40gmail.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yJ_4Hn2S468HC16LVWvdsvLqNKLYFDiqyD89GrWg8S7OA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] New Docker module features, compose and network
Hi All I've just added a couple of features to the Puppet Docker module, specifically to use Docker Compose alongside Puppet and to configure Docker networks. https://github.com/garethr/garethr-docker#networks https://github.com/garethr/garethr-docker#compose Thanks to Scott Coulton for some of the earlier work on these. These features are in master now and I'll hopefully ship a 5.1 release of the module shortly. I'd love any feedback on them from folks who might be using Puppet and Docker. Cheers all Gareth -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLv1t0UzvUsUOZGOxmc0bD2Y7SE9CYt7Y74W7NaRxK7aQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Test define in module with rspec_puppet
On 16 February 2016 at 09:37, Thomas Bendler wrote: > Hi @all, > > I have a small problem with my module test using spec_puppet. I use the > Puppetlabs MySQL module to create databases in my module. When running "rake > spec" my coverage report that not all resources are tested: > > <--- snip ---> > Mysql_database[test1] > Mysql_grant[test1@localhost/test1.*] > Mysql_user[test1@localhost] > <--- snap ---> > > How can I include this resources in my spec file to get tested also? I've > already added the classes to the spec file but this did not solve the > problem: > > <--- snip ---> > it { is_expected.to contain_class('mysql::server') } > it { is_expected.to contain_class('mysql::server::backup') } > it { is_expected.to contain_class('mysql::server::account_security') } > it { is_expected.to contain_class('mysql::server::mysqltuner') } > <--- snap ---> > You should be able to do something like the following if memory serves: it { is_expected.to contain_mysql_database('test1') } Gareth > Is it necessary to create a spec file for each define? Are there any public > examples that I can use for education? > > Regards Thomas > -- > Linux ... enjoy the ride! > > -- > 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/CAELoU1Pt%3Db1zjGOLrcsp-rEbO%2Bncy_Jv-cu-bqRGXY%3DrsATkHg%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLVKzpin%2BQ_VYLi%2BtbswNr1KOzZbL-4Tu6idgQmU_aLRA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Announce: A REPL for the puppet language
#x27;/tmp/test1', '/tmp/test2'].each |String $file_path| { >>> >> file{$file_path: ensure => present}} >>> => ["/tmp/test1", "/tmp/test2"] >>> >> ['/tmp/test1', '/tmp/test2'].each |String $file_path| { >>> >> file{$file_path: ensure => present}} >>> => Evaluation Error: Error while evaluating a Resource Statement, >>> Duplicate declaration: File[/tmp/test1] is already declared in file :1; >>> cannot redeclare at line 1 at line 1:57 >>> >> >>> >>> >>> >>> Corey >>> >>> >>> >>> -- >>> 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/5D035294-B3D9-450B-A0E3-4882858B2008%40nwops.io. >>> 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/CAPGcbtAc9vkuSf%2BuQX5jjrRA3Pfmeb3SZUhz0O2Vw6Ak0PTc1g%40mail.gmail.com. >> >> 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/CAC-wWcROypnxZn%2BHGAdqd_BQxTtzSw0SosYwUC07C1FRgEb1mg%40mail.gmail.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yKHnajXT8n%2BFh7p7zySQp_zXY2SK%3Di63j2c21VCzRi7_A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Re: Announce: A REPL for the puppet language
On 21 February 2016 at 03:26, Jo Rhett wrote: > Puppet 4 is only supported with the all-in-one packaged Ruby. You don’t > choose your own. > Just to clarify, Puppet 4 will happily run from a gem on a ruby outside the AIO package. This is actually very common in the case of unit testing modules on Travis of Jenkins for instance. The language from the documentation states "the Ruby version bundled with puppet-agent is the recommended version. Other versions are not recommended and we make no guarantees about their performance with Puppet." Given that, using the combinations from the puppet-agent package is a useful guide in cases where you really can't use the AIO for some reason: https://docs.puppetlabs.com/puppet/4.3/reference/about_agent.html. ie. if you're using Puppet 4.3.2 then you can have some level of confidence that Ruby 2.1.8 is a good choice (mainly because that's what is getting lots of testing as per the table on https://docs.puppetlabs.com/guides/platforms.html. Gareth > On Feb 20, 2016, at 6:10 PM, Corey Osman wrote: > > The gem requires puppet 3.8+. So whatever version of ruby puppet runs on is > supported by puppet-repl. > > If you want to run ruby 2.3 I would suggest using puppet 4.3+. But I am > not even sure puppet 4.3 runs on ruby 2.3 yet. > > On Friday, February 19, 2016 at 3:04:39 PM UTC-8, Corey Osman wrote: >> >> Hi, >> >> I created a REPL for the puppet language this week. This is something that >> has been lacking for quite some time. >> >> >> https://github.com/nwops/puppet-repl >> >> Install: gem install puppet-repl >> bash$ prepl >> >> >> It is currently at version 0.0.1 but is still very functional. >> >> >> MacBook-Pro-2~ % prepl >> Puppet Version: 4.2.2 >> Puppet Repl Version: 0.0.1 >> Created by: NWOps >> Type "exit", "functions", "types", "reset", "help" for more information. >> >> >> $hostname = 'node123.company.com' >> => node123.company.com >> >> $hostname =~ /node/ >> => true >> >> split($hostname, 'node') >> => ["", "123.company.com"] >> >> ['/tmp/test1', '/tmp/test2'].each |String $file_path| { >> >> file{$file_path: ensure => present}} >> => ["/tmp/test1", "/tmp/test2"] >> >> ['/tmp/test1', '/tmp/test2'].each |String $file_path| { >> >> file{$file_path: ensure => present}} >> => Evaluation Error: Error while evaluating a Resource Statement, >> Duplicate declaration: File[/tmp/test1] is already declared in file :1; >> cannot redeclare at line 1 at line 1:57 >> >> >> >> >> >> Corey >> >> >> > > -- > 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/a0f8f102-10db-4eec-9862-6d162b718ed5%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > > > -- > Jo Rhett > Net Consonance : net philanthropy to improve open source and internet > projects. > > -- > 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/FBE71E5F-0EF8-479E-957F-B7845573AE9D%40netconsonance.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLY46Q9upe5fNbdpmNTV16ztk5HV%2BQzp0YRp9sMFZ1KMA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Usage of aws module from resource abstraction layer
On 3 March 2016 at 20:12, Sergey Zemlyanoy wrote: > Hey folks, > > How you guys maintain your ec2 instances using aws module from command line? > I intend to rely on RAL or mco to be able to provision instances on demand, > without declaring them in puppet/hiera, but just take defaults from there. I > want to let my build server to execute command like: > > puppet resource ec2_instance ensure=present = > > so it could take defaults(ami, region etc) from hiera and kick few build > instances with unique hostnames. > > I faced with some issues here: not all params can be passed to RAL, namely > user_data, blockdevices > > > puppet resource ec2instance someinstance ensure=present region=eu-central-1 > imageid=x securitygroups='x' subnet=x instancetype=m3.medium > blockdevices=[{'deleteontermination':'true', 'volumesize':10, > 'devicename':'/dev/sda'}] Error: Could not run: Invalid parameter setting > volumesize:10, > > > seems its not possible to pass hash to 'puppet resource' either. > Yup, that's the current issue with that you propose via puppet resource. The other approach is to use the -e (execute) flag on puppet apply like so: http://www.puppetcookbook.com/posts/simple-adhoc-execution-with-apply-execute.html As it sounds like you're automating this anyway that should just be a matter of syntax, rather than the simple key=value pairs that resource uses you can use the full Puppet language. Which also means you could create some basic defined types which provide the defaults and only pass in the variables that change. Gareth > Any thoughts on how can I pass these attributes or how to force usage of > defaults from hiera? > > Much appreciated, Sergey > > -- > 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/5e530737-2231-489c-b5e1-1f8f480ff772%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yJteXp8e_NEaYNeTQsZ_UerCih%2BB6PhG5cLg2s%2B6qBpsA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Re: Usage of aws module from resource abstraction layer
On 4 March 2016 at 10:55, Sergey Zemlyanoy wrote: > Thanks for reply, > > Will check that link. > Re defined type this is what I already was thinking about but I literally > can't call my new type from RAL command while it works perfectly for generic > puppet applies. From what I know only ruby types can be passed to 'puppet > resource', am I right? > This is unfortunately true at present. However if you use the puppet apply -e trick you can use defined types. > Thnaks > > -- > 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/e60aae5a-61bf-4238-99c2-6bdcf3feed0f%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yKFaRbcHby4QAWdCmeR1cgMcp%2B_7AFAL3Q6TvHE%2B8ZTnA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] When usion puppet docker_platform with vagrant virtualbox the docker container is not started and after restart the docker daemon is not started
Hi Torsten The bold values represent the defaults, so you shouldn't need to specify them. You also have some other options set that I don't think are required. Could you try with the following: class { 'docker': } docker::image { 'jenkinsci/jenkins:2.0-beta-1': } docker::run { 'Jenkins2Beta1': ports=> '8080:8080', volumes => '/virtual_storage/jenkins_home:/var/jenkins_home', } I think what is happening here is that by specifying detach you are separating the docker container from the init script which is generated by the module. With regards to the docker daemon starting on boot, I think that's the init scripts shipped with Docker. These vary depending on the OS unfortunately. Puppet should be telling the service to be enabled: https://github.com/garethr/garethr-docker/blob/master/manifests/service.pp#L198. Let us know if that resolves your issue. Gareth On 4 April 2016 at 20:56, 'Torsten Kleiber' via Puppet Users wrote: > Hi! > > I try to create a virtualbox machine with vagrant and puppet provider. > > According to the documentation > https://forge.puppetlabs.com/puppetlabs/docker_platform/readme#class-docker > I have create following manifest: > > class { 'docker': > service_enable => true, > service_state => 'running', > } > docker::image { 'jenkinsci/jenkins:2.0-beta-1': > require => Class['docker'], > } > > docker::run { 'Jenkins2Beta1': > image=> 'jenkinsci/jenkins:2.0-beta-1', > detach => true, > ports=> '8080:8080', > volumes => '/virtual_storage/jenkins_home:/var/jenkins_home', > running => true, > extra_parameters => ['--restart unless-stopped'], > require => Docker::Image['jenkinsci/jenkins:2.0-beta-1'], > } > > With the bold configuration I would expect the my container 'Jenkins2Beta1' > should be started after provisioning, which is not the case. > I have to determine the id of the container manual via "sudo docker ps -all" > and start it then via "sudo docker start ". > > Furthermore after restarting the virtualbox machine via "vagrant halt" and > "vagrant up" the docker daemon has to be started manually via "sudo docker > daemon". > > What is wrong in my manifest? > > Kind regards > Torsten > > -- > 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/389a99f5-793d-4448-8ffd-cd8adb7f6236%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yJxDbNUzDCnv9gjOBSxY3nyxu54s-mzeYST%2B1kvSBOD_g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] When usion puppet docker_platform with vagrant virtualbox the docker container is not started and after restart the docker daemon is not started
ts from a tarball to create a filesystem > image > info Display system-wide information > inspect Return low-level information on a container or image > kill Kill a running container > load Load an image from a tar archive or STDIN > login Register or log in to a Docker registry > logoutLog out from a Docker registry > logs Fetch the logs of a container > network Manage Docker networks > pause Pause all processes within a container > port List port mappings or a specific mapping for the CONTAINER > psList containers > pull Pull an image or a repository from a registry > push Push an image or a repository to a registry > renameRename a container > restart Restart a container > rmRemove one or more containers > rmi Remove one or more images > run Run a command in a new container > save Save an image(s) to a tar archive > searchSearch the Docker Hub for images > start Start one or more stopped containers > stats Display a live stream of container(s) resource usage > statistics > stop Stop a running container > tag Tag an image into a repository > top Display the running processes of a container > unpause Unpause all processes within a container > updateUpdate resources of one or more containers > version Show the Docker version information > volumeManage Docker volumes > wait Block until a container stops, then print its exit code > > Run 'docker COMMAND --help' for more information on a command. > > -- > 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/685674a9-e42a-4687-82ba-087eba6aed87%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yJApqtwbOgU3fJndB8Kj5u_RKSo5JPALKeabggbDxhZLw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] When usion puppet docker_platform with vagrant virtualbox the docker container is not started and after restart the docker daemon is not started
On 6 April 2016 at 21:29, 'Torsten Kleiber' via Puppet Users wrote: > Hi Gareth! > > garethr/docker module does start the docker daemon after reboot via vagrant > halt / up. > But unfortunately the container does only exist and start after initial > provisioning, but is not there anymore (via "sudo docker ps -all") after > same vagrant restart. > If you could open an issue at https://github.com/garethr/garethr-docker/issues Please include as much information as possible and any output from commands run. Which OS, version of Puppet, version of Docker and the module, that sort of thing. In particular any boot errors from the init scripts would likely be useful. Gareth > Kind regards > Torsten > > -- > 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/cf7b27ec-5fe2-48e4-a329-aa23227343dc%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6y%2BtKP-p6OeR%3Dd%3DK_5NHmfTjFNunMk5VBV-XhtS4cmpKQQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] Puppet Types auto generator
Hey Christoph On 7 April 2016 at 09:15, Christoph Andreas Torlinsky wrote: > Hello there, i'm looking for a puppet types generator tool / toolkit as we > have an API (Restful interface) and spec files that we would like > to convert to puppet types for some use. If anyone has any tips, that is > most welcomed. > I'm aware of two public projects that do this currently (if other folks know of others please link to them here, that would be great to see): The Puppet Labs DSC module generates the types based on DSC MOF files: https://github.com/puppetlabs/puppetlabs-dsc/blob/master/build/dsc/templates/dsc_type.rb.erb And my Kubernetes module (https://github.com/garethr/garethr-kubernetes/) generates all the types and providers based on a Swagger specification. You can see the implementation of the generator in this repo: https://github.com/garethr/puppet-swagger-generator. The code is pretty rough but it works really well. I'm not aware of any higher-level tools yet for doing this. It's not a super common pattern yet, but my guess is it will become more and more interesting/powerful as more and more software ships with first class APIs for integration. If anyone wants to chat more about that problem let me know. Cheers Gareth > many thanks, > > c > > -- > 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/d714b52a-c7f7-4104-ba1a-cb697a893d0a%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- 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/CAFi_6yLkK_TaoCKyrESjbALGzcL%2BSe1YY4c8mNj1My1w0hs6qQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.