[Puppet Users] Re: Dependancy Problems
Hi, I think you can solve this by resolving dependancy in init.pp You may try something like this. init.pp class openstack { include openstack::install class {'nova::controller': require = Class['openstack::install'], } On Saturday, August 17, 2013 2:11:31 AM UTC+5:30, towen27 wrote: I'm having some issues with dependencies for my puppet module/manifests. I've pasted some stuff on http://pastie.org/8243225# The problem I'm having is that Puppet is running the Class{ 'nova::controller' } before putting the .repo file in the /etc/yum.repos.d directory. Since I'm running Fedora 18, it tries to install the OpenStack Folsom packages rather than the Grizzly packages. Plus the nova-conductor package doesn't exsist in Folsom so it really fails! Any help would be appreciated! -- 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] Puppet environments vs App environments
I've setup dynamic environments using git but I'm confused about how environments are actually supposed to be used. We're a small ISP and have freeradius servers, VPN servers and web servers. I've been using environments to enable me as the sysadmin to build and test new manifests/modules before deploying them to our production servers. I have dedicated staging servers, one for each role (web,vpn,aaa), that are configured with the 'staging' environment. My workflow involves developing locally (with a local puppetmaster), pushing commits on the staging branch and then QA on the staging servers and then merging the staging branch into production and pushing to deploy it. However, our web development team have now requested their own staging/production environments for the web applications they are building. I then thought that perhaps these servers should be modelled using environments. Then I thought 'but these are application testing environments running in a production environment so they should have nothing to do with puppet environments'. I've managed to confuse myself, any help untangling my confusion would be greatly appreciated, thank you! -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: Learningpuppet
Hi, I think you have confusion about structure. Structure should be: human: |- manifests |- init.pp |- user.pp 1. init.pp - Contains a class definition. (every class under manifests should be defined in int.pp) 2. human::user (user.pp) is a class which will create user according to your user.pp file (it should be also defined in init.pp) Refer link for better understanding of structure of puppet and basics : http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html Thanks Regards, Sneha More, NTT DATA OSS Center Pune, India On Friday, August 16, 2013 11:14:02 PM UTC+5:30, ytmp123 wrote: Hi Ellison Marks: Thanks. But I don't get what I'm exactly expected to do in this exercise. Is this structure right?: - human - |- manifests - |- init.pp - |- user.pp 1. Does init.pp have to contain a class human, what shall this class do? 2. What does the type human::user (user.pp) to do? Please give me some hints. It would be a great help! -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: Installing Puppet 3 client on a Raspberry Pi
There's an experimental 3rd-party apt repo herehttp://apt.cegeka.be/puppetlabs/, that seems to work for me. Corresponding instructions on how to build those packages yourself are in this blog posthttp://www.dammekens.be/2013/04/04/packaging-puppet-3-1-1-for-arm-raspberry-pi/ . Note my comment below that blog post. I had a dependency issue that caused Ruby 1.8 to be pulled in, while I try to use just Ruby 1.9. If you already use Ruby 1.8, you'll be fine. I've asked the owners to fix that. It would be very nice if Puppetlabs would build packages for the armhf platform, since 'disposable' computing devices like the Raspberry Pi are a good fit for config management. For now, I'm using the above repo. Regards, Martijn Op donderdag 15 augustus 2013 17:36:47 UTC+2 schreef Alastair Montgomery: I'm trying to install the latest Puppet client on my Raspberry PI but I am getting the following errors; wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb sudo dpkg -i puppetlabs-release-wheezy.deb sudo apt-get update W: Failed to fetch http://apt.puppetlabs.com/dists/wheezy/Release Unable to find expected entry 'main/binary-armhf/Packages' in Release file (Wrong sources.list entry or malformed file) Any idea on how to fix this? -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: Possible for each user to have their own testing environment?
Git branching and environments is exactly what we did to solve this problem. We are actually using gitolite which allows us to lock down who can push to certain branches. So anyone can create their own branch, push that up (which creates the proper directories through git hooks) and test with --environment [branch_name] and then when they know it works great, request a merge into our permanent environments like production and testing. Once the new code is merged into its final home, the temporary branch is deleted. The hard part is the git hooks. We actually have a script that emulates the Github WebHook URL functionality and a hook that catches that POST and does all the magic. I included the web pages that helped me get our setup working how we wanted it to. https://github.com/metajack/notify-webhook https://puppetlabs.com/blog/git-workflow-and-puppet-environments/ On Thursday, August 15, 2013 8:14:59 AM UTC-6, Sandra Schlichting wrote: Hello all =) What I would like is a way so multiple people can make changes to all files in /etc/puppet/, but only after they have tested their changes then they git push so /etc/puppet is updated. The git repo is in /etc/puppet. When I read about environments [1] I get the impression that is only for module development, is that correct? Ideally what I would like is each user to have their private environment where they can git pull to. E.g. ssh sandra@puppet cd /home/sandra/puppet git pull # edit files exit ssh root@node puppet agent --environment sandra exit ssh sandra@puppet cd /home/sandra/puppet git push Can something like this be done? And if so, what would my /etc/puppet/puppet.conf look like? Lots of love, Sandra =) [1]: http://docs.puppetlabs.com/guides/environment.html -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: Puppet environments vs App environments
On Monday, August 19, 2013 1:59:46 AM UTC-5, JeremyCampbell wrote: I've setup dynamic environments using git but I'm confused about how environments are actually supposed to be used. We're a small ISP and have freeradius servers, VPN servers and web servers. I've been using environments to enable me as the sysadmin to build and test new manifests/modules before deploying them to our production servers. I have dedicated staging servers, one for each role (web,vpn,aaa), that are configured with the 'staging' environment. My workflow involves developing locally (with a local puppetmaster), pushing commits on the staging branch and then QA on the staging servers and then merging the staging branch into production and pushing to deploy it. However, our web development team have now requested their own staging/production environments for the web applications they are building. I then thought that perhaps these servers should be modelled using environments. Then I thought 'but these are application testing environments running in a production environment so they should have nothing to do with puppet environments'. I've managed to confuse myself, any help untangling my confusion would be greatly appreciated, thank you! Do not read too much into the term environment. Puppet environments are a mechanism for partitioning your machines under management into groups that (may) rely on separate[*] manifests, modules, and data. The feature is often used to implement configuration staging in the form you describe using now, but that is not their only possible use. For example, it might in some cases make sense to use environments to separate machines assigned to different divisions of the company, different geographic locations, etc.. Importantly, if you want to slice your systems along two (or more) different dimensions then you need to flatten those into one. That can certainly be done, but it doesn't scale well. [*] Note, too, that partitioning is incomplete: different environments served by the same master cannot provide different binary plugins (custom facts, functions, types, or providers). Inasmuch as you are uncertain how to proceed, I would avoid creating new Puppet environments for now. You should have a good idea of why you want separate environments before you create any. It is likely that you can use ordinary Puppet facilities within each environment to manage the dev team's different machine roles, if they even have different configuration requirements in the first place. 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 post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] using GIT for environments
On Sun, Aug 18, 2013 at 9:04 PM, me 1 solarflo...@gmail.com wrote: On Sunday, August 18, 2013 6:13:38 PM UTC-4, Jim Toth wrote: There are a few ways to go; probably the best way is to set up a bare repository that you push and pull from in both places, but I'd probably add the development environment as a remote in the in-production directory. cd /path/to/production/repository git remote add devel /path/to/development/directory git merge --ff-only devel/master (--ff-only because I'm paranoid -- that will give you the same sort of warnings that git push would give you if you the trees had diverged). So you're saying adding to the development environment as a remote in the in-production directory is an alternative to using a bare repository then? Yes. I'm new to git and just trying to find an easy way, if using bare repositories is necessary, I don't think git is very good for this at all, its too much trouble for what its worth. (except for extremely large environments, which is rare) I'd say what it's good for is multi-user environments. Or single-user environments, if that user happens to be familiar with git. :-) -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Possible for each user to have their own testing environment?
Dear Brian and John, Thanks a lot for your replies. I was under the impression that site.pp had to be in the environment, which I now see it doesn't have to. =) What I don't quite understand is though is the following: There are four forbidden environment names: - main - master - agent - user These names are already taken by the primary config blockshttp://docs.puppetlabs.com/guides/configuring.html#config-blocks. If you are using Git branches for your environment names, this may mean you’ll need to rename the master branch to something like production or stable. How can a git branch name (master) conflict with content in the puppet.conf file? Hugs, Sandra =) On Friday, 16 August 2013 01:14:44 UTC+2, John Warburton wrote: On 16 August 2013 00:14, Sandra Schlichting littles...@gmail.comjavascript: wrote: Hello all =) What I would like is a way so multiple people can make changes to all files in /etc/puppet/, but only after they have tested their changes then they git push so /etc/puppet is updated. The git repo is in /etc/puppet. When I read about environments [1] I get the impression that is only for module development, is that correct? Ideally what I would like is each user to have their private environment where they can git pull to. E.g. Can something like this be done? And if so, what would my /etc/puppet/puppet.conf look like? This is exactly what we do - each admin has their own environment. We use SVN, so substitute where required, but essentially we force a particular directory structure for every admin and reflect that in the puppetmaster.conf of our lab server. NB the SVN work spaces must be on the same server as the lab puppet server for this to work # Replicate this, and change username as appropriate (one per line) #[Lusername] #modulepath = /u1/username/svn-workspace/puppet/Lusername/modules #manifest = /u1/username/svn-workspace/puppet/Lusername/manifests/site.pp #manifestdir = /u1/username/svn-workspace/puppet/Lusername/manifests Because we have different yum/pkg repos per environment, that capital L for the environment allows us to do some generic regexp matching to override to a single lab repo and not one per admin All changes are a feature branchhttp://nvie.com/posts/a-successful-git-branching-model/, and we wrap the creation of a JIRA ticket, new feature branch name based on JIRA ticket number (UX-) and sym link /u1/username/svn-workspace/puppet/Lusername to /u1/username/svn-workspace/puppet/branches/UX- in a script We then set the environment of whatever development VM/server we need to develop/test the code - including full rebuilds and it just works. We have another script which checks for a valid peer review (reviewboard) then merges the changes back into develop/trunk, and updates the JIRA ticket The only gotcha is if you have multiple feature branches at any time and managing the sym link 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 post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] puppet module install simondean/iis gives error Error: cert already in hash table
For what it's worth, I had the same problem and figured out the particular cert on Windows 7 (64bit) that was causing the issue: -- [Subject] CN=Thawte Timestamping CA, OU=Thawte Certification, O=Thawte, L=Durbanville, S=Western Cape, C=ZA [Issuer] CN=Thawte Timestamping CA, OU=Thawte Certification, O=Thawte, L=Durbanville, S=Western Cape, C=ZA [Serial Number] 00 [Not Before] 1/01/1997 1:00:00 p.m. [Not After] 1/01/2021 12:59:59 p.m. [Thumbprint] BE36A4562FB2EE05DBB3D32323ADF445084ED656 -- I found it under Trusted Root Certification Authorities. After deleting that, I no longer had the module/cert issue. On Wednesday, 17 July 2013 07:54:02 UTC+12, Josh Cooper wrote: On Tue, Jul 16, 2013 at 11:19 AM, Arno den Uijl arnod...@gmail.comjavascript: wrote: I thought i tried the debug and trace options but i this trace was new for me. I looked through the code and I think that it was caused by the fact that there were some certificates installed with the same name. I deleted some from my certificate store and now it runs correct. Thanks for the help. I do think that this can be an issue for more people. I didn't realize MS cert store could contain duplicates. We should be more defensive of this, in general, to ensure the failure to add one cert doesn't stop puppet from running: begin add_cert(x509) rescue OpenSSL::X509::StoreError = detail Puppet.warning Failed to add certificate '#{x509.subject}' end Josh -- Josh Cooper Developer, Puppet Labs *Join us at PuppetConf 2013, August 22-23 in San Francisco - * http://bit.ly/pupconf13* **Register now and take advantage of the Early Bird discount - save 25%!* -- 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] Running classes alone
Hello! I've got a manifest that involves downloading and updating a bunch of different packages using apt, pip, etc. One of my apt-dependencies, dnsmasqhttp://www.thekelleys.org.uk/dnsmasq/doc.html, redirects the machine's DNS. Any modules currently running at that time that use the internet get a temporary name resolution error. Unfortunately, I can't run this class in a different stage, as it creates a dependency cycle with the other things that depend on dnsmasq. Is there a way to force puppet to run a particular class by itself? There are enough other tasks/jobs/whatever-we-call-them that being explicit about the dependencies isn't really worth it (and it'd have to be kept up to date as my manifest grows). Thank you! -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Mcollective: remote commands
what the mcollective client can do is limited to the agents installed on the other side (server side). Puppet lists those agents as being available: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki I don't think that there is an agent that can run random remote commands. On Wed, Aug 14, 2013 at 11:04 PM, Sergey Arlashin sergeyarl.maill...@gmail.com wrote: Hi! Is it possible to use Mcollective to run different cli commands remotely on nodes? Cannot find anything related in the documentation. -- Best regards, Sergey Arlashin -- 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. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Possible for each user to have their own testing environment?
On 2013-08-19 16:23, Sandra Schlichting wrote: Dear Brian and John, Thanks a lot for your replies. I was under the impression that site.pp had to be in the environment, which I now see it doesn't have to. =) What I don't quite understand is though is the following: There are four forbidden environment names: * |main| * |master| * |agent| * |user| These names are already taken by the primary config blocks http://docs.puppetlabs.com/guides/configuring.html#config-blocks. If you are using Git branches for your environment names, this may mean you’ll need to rename the master branch to something like |production| or |stable|. How can a git branch name (master) conflict with content in the puppet.conf file? When using puppet agent --environment=master, the [master] section containing configuration directives (e.g. database connection for puppetdb) will be interpreted by the puppet agent, with less than stellar results. Regards, David -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Running classes alone
On 2013-08-19 14:06, Matt S wrote: Hello! I've got a manifest that involves downloading and updating a bunch of different packages using apt, pip, etc. One of my apt-dependencies, dnsmasq http://www.thekelleys.org.uk/dnsmasq/doc.html, redirects the machine's DNS. Any modules currently running at that time that use the internet get a temporary name resolution error. Unfortunately, I can't run this class in a different stage, as it creates a dependency cycle with the other things that depend on dnsmasq. Is there a way to force puppet to run a particular class by itself? There are enough other tasks/jobs/whatever-we-call-them that being explicit about the dependencies isn't really worth it (and it'd have to be kept up to date as my manifest grows). You might want to look into tags. I've got a few resources which are applied to bootstrap the whole process, which can be applied separately using --tags kickstart::bootstrap, which is used while kickstarting the node. This ensures that when it reboots, it has a properly configured puppet, but doesn't start services in kickstart. Alternatively you can pack the initial installation and configuration of dnsmasq into an exec{} to ensure semi-atomic execution. Not recommended, but possible. Regards, David -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: Puppet environments vs App environments
Hi John, Thank you for a most well considered response given my level of understanding. I'd much appreciate an example of a system sliced along 2 or more different dimensions that need to be flattened into one, this is the only part not clear to me. Regards, Jeremy. On Monday, August 19, 2013 3:49:04 PM UTC+2, jcbollinger wrote: On Monday, August 19, 2013 1:59:46 AM UTC-5, JeremyCampbell wrote: I've setup dynamic environments using git but I'm confused about how environments are actually supposed to be used. We're a small ISP and have freeradius servers, VPN servers and web servers. I've been using environments to enable me as the sysadmin to build and test new manifests/modules before deploying them to our production servers. I have dedicated staging servers, one for each role (web,vpn,aaa), that are configured with the 'staging' environment. My workflow involves developing locally (with a local puppetmaster), pushing commits on the staging branch and then QA on the staging servers and then merging the staging branch into production and pushing to deploy it. However, our web development team have now requested their own staging/production environments for the web applications they are building. I then thought that perhaps these servers should be modelled using environments. Then I thought 'but these are application testing environments running in a production environment so they should have nothing to do with puppet environments'. I've managed to confuse myself, any help untangling my confusion would be greatly appreciated, thank you! Do not read too much into the term environment. Puppet environments are a mechanism for partitioning your machines under management into groups that (may) rely on separate[*] manifests, modules, and data. The feature is often used to implement configuration staging in the form you describe using now, but that is not their only possible use. For example, it might in some cases make sense to use environments to separate machines assigned to different divisions of the company, different geographic locations, etc.. Importantly, if you want to slice your systems along two (or more) different dimensions then you need to flatten those into one. That can certainly be done, but it doesn't scale well. [*] Note, too, that partitioning is incomplete: different environments served by the same master cannot provide different binary plugins (custom facts, functions, types, or providers). Inasmuch as you are uncertain how to proceed, I would avoid creating new Puppet environments for now. You should have a good idea of why you want separate environments before you create any. It is likely that you can use ordinary Puppet facilities within each environment to manage the dev team's different machine roles, if they even have different configuration requirements in the first place. 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 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] Pass same parameter value to multiple classes using Puppet Hiera
I'm using Hiera with Puppet and I want to pass the same parameter value to multiple classes without repeating it. Right now I've got (in Yaml): --- class_a::database_server: myoraclebox.example.com class_b::database_server: myoraclebox.example.com This works, but how can I specify the server only once and still use Puppet's automatic parameter lookup? (I'd rather not embed an explicit Hiera lookup in my manifest, since that would couple it to Hiera.) 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 post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] using GIT for environments
On Sun, Aug 18, 2013 at 9:04 PM, me 1 solar...@gmail.com javascript:wrote: On Sunday, August 18, 2013 6:13:38 PM UTC-4, Jim Toth wrote: There are a few ways to go; probably the best way is to set up a bare repository that you push and pull from in both places, but I'd probably add the development environment as a remote in the in-production directory. cd /path/to/production/repository git remote add devel /path/to/development/directory git merge --ff-only devel/master (--ff-only because I'm paranoid -- that will give you the same sort of warnings that git push would give you if you the trees had diverged). So you're saying adding to the development environment as a remote in the in-production directory is an alternative to using a bare repository then? Yes. I'm new to git and just trying to find an easy way, if using bare repositories is necessary, I don't think git is very good for this at all, its too much trouble for what its worth. (except for extremely large environments, which is rare) I'd say what it's good for is multi-user environments. Or single-user environments, if that user happens to be familiar with git. :-) ok, then here is the problem: $ git merge --ff-only devel/master fatal: 'devel/master' does not point to a commit $ git remote -v preprod /etc/puppet/environments/preprod/puppet/ (fetch) preprod /etc/puppet/environments/preprod/puppet/ (push) $ pwd /etc/puppet -- 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] if defined not working when class is enlcosed within Class[ ]
Hi, I am learning puppet using version 2.7.18 on a fresh ubuntu install. I am trying to test this module https://github.com/liamjbennett/puppet-sabnzbd/blob/master/manifests/init.ppbut I'm having trouble with the if defined(Class['supervisor::service']) section in that it doesn't get run even though the supervisor module is installed. If i put else{ notice(supervisor not defined?) } on the end then I see that notice msg in the 'puppet apply --debug' output. This supervisor module is downloaded/installed OK from Puppet Forge and if I either a) comment out the 'if defined' then it works as expected b) *change the if *defined(Class['supervisor::service']) to read if defined( 'supervisor::service') then it also works as expected. As you can see there is an include supervisor at top of the class which I'm guessing isn't being called in the order needed for the 'if defined' to work and the one without the Class[ ] must work because puppet auto loads the modules from the modulepath and checks if that namespace and module exist? This is all new to me so i could be very wrong but can anyone explain given that init.pp why the 'if defined' isn't working and what is the best way to achieve what the 'if defined' is there for and that's to see if the supervisor module is installed/loaded before entering the if statement and using the module? Many thanks for reading fLo -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] using GIT for environments
On Sun, Aug 18, 2013 at 9:04 PM, me 1 solar...@gmail.com javascript:wrote: On Sunday, August 18, 2013 6:13:38 PM UTC-4, Jim Toth wrote: There are a few ways to go; probably the best way is to set up a bare repository that you push and pull from in both places, but I'd probably add the development environment as a remote in the in-production directory. cd /path/to/production/repository git remote add devel /path/to/development/directory git merge --ff-only devel/master (--ff-only because I'm paranoid -- that will give you the same sort of warnings that git push would give you if you the trees had diverged). So you're saying adding to the development environment as a remote in the in-production directory is an alternative to using a bare repository then? Yes. I'm new to git and just trying to find an easy way, if using bare repositories is necessary, I don't think git is very good for this at all, its too much trouble for what its worth. (except for extremely large environments, which is rare) I'd say what it's good for is multi-user environments. Or single-user environments, if that user happens to be familiar with git. :-) ok, then here is the problem: $ git merge preprod/master fatal: 'preprod/master' does not point to a commit $ git remote -v preprod /etc/puppet/environments/ preprod/puppet/ (fetch) preprod /etc/puppet/environments/preprod/puppet/ (push) $ pwd /etc/puppet -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] using GIT for environments
On Sun, Aug 18, 2013 at 9:04 PM, me 1 solar...@gmail.com javascript:wrote: On Sunday, August 18, 2013 6:13:38 PM UTC-4, Jim Toth wrote: There are a few ways to go; probably the best way is to set up a bare repository that you push and pull from in both places, but I'd probably add the development environment as a remote in the in-production directory. cd /path/to/production/repository git remote add devel /path/to/development/directory git merge --ff-only devel/master (--ff-only because I'm paranoid -- that will give you the same sort of warnings that git push would give you if you the trees had diverged). So you're saying adding to the development environment as a remote in the in-production directory is an alternative to using a bare repository then? Yes. I'm new to git and just trying to find an easy way, if using bare repositories is necessary, I don't think git is very good for this at all, its too much trouble for what its worth. (except for extremely large environments, which is rare) I'd say what it's good for is multi-user environments. Or single-user environments, if that user happens to be familiar with git. :-) ok, then here is the problem: $ git merge --ff-only preprod/master fatal: 'preprod/master' does not point to a commit $ git remote -v preprod /etc/puppet/environments/preprod/puppet/ (fetch) preprod /etc/puppet/environments/preprod/puppet/ (push) $ pwd /etc/puppet -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] using GIT for environments
Hmm...you might need to add git remote update in there. git pull does that by default. On Mon, Aug 19, 2013 at 1:22 PM, me 1 solarflo...@gmail.com wrote: On Sun, Aug 18, 2013 at 9:04 PM, me 1 solar...@gmail.com wrote: On Sunday, August 18, 2013 6:13:38 PM UTC-4, Jim Toth wrote: There are a few ways to go; probably the best way is to set up a bare repository that you push and pull from in both places, but I'd probably add the development environment as a remote in the in-production directory. cd /path/to/production/repository git remote add devel /path/to/development/directory git merge --ff-only devel/master (--ff-only because I'm paranoid -- that will give you the same sort of warnings that git push would give you if you the trees had diverged). So you're saying adding to the development environment as a remote in the in-production directory is an alternative to using a bare repository then? Yes. I'm new to git and just trying to find an easy way, if using bare repositories is necessary, I don't think git is very good for this at all, its too much trouble for what its worth. (except for extremely large environments, which is rare) I'd say what it's good for is multi-user environments. Or single-user environments, if that user happens to be familiar with git. :-) ok, then here is the problem: $ git merge --ff-only preprod/master fatal: 'preprod/master' does not point to a commit $ git remote -v preprod /etc/puppet/environments/preprod/puppet/ (fetch) preprod /etc/puppet/environments/**preprod/puppet/ (push) $ pwd /etc/puppet -- 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. -- Jim Toth jjt...@vcu.edu Applications Analyst, Technology Services (804) 827-1227 -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: if defined not working when class is enlcosed within Class[ ]
So, I can't speak to the authors intentions, but I'll do my best to explain the behavior. As you guessed defined() behaves differently based on what is passed to it. If passed a resource reference, as it is in the module, it will check that that resource has been declared. if passed a string, it will treat it as a type/class name and make sure that the resource has been defined. So, as written, it's checking if a class by the name of supervisor::service has been declared, while the way you write it, it check if anything by the name of supervisor::service has been defined. The 'include supervisor' you noticed does nothing regarding this error, as the type in question is supervisor::service. If I had to guess, at one point in the past, supervisor::service was a class, while it is now a defined type, and the module you're working with hasn't updated or something. On Monday, August 19, 2013 8:33:09 AM UTC-7, Florian Gray Jones wrote: Hi, I am learning puppet using version 2.7.18 on a fresh ubuntu install. I am trying to test this module https://github.com/liamjbennett/puppet-sabnzbd/blob/master/manifests/init.ppbut I'm having trouble with the if defined(Class['supervisor::service']) section in that it doesn't get run even though the supervisor module is installed. If i put else{ notice(supervisor not defined?) } on the end then I see that notice msg in the 'puppet apply --debug' output. This supervisor module is downloaded/installed OK from Puppet Forge and if I either a) comment out the 'if defined' then it works as expected b) *change the if *defined(Class['supervisor::service']) to read if defined('supervisor::service') then it also works as expected. As you can see there is an include supervisor at top of the class which I'm guessing isn't being called in the order needed for the 'if defined' to work and the one without the Class[] must work because puppet auto loads the modules from the modulepath and checks if that namespace and module exist? This is all new to me so i could be very wrong but can anyone explain given that init.pp why the 'if defined' isn't working and what is the best way to achieve what the 'if defined' is there for and that's to see if the supervisor module is installed/loaded before entering the if statement and using the module? Many thanks for reading fLo -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Possible for each user to have their own testing environment?
On Mon, Aug 19, 2013 at 10:23 AM, Sandra Schlichting littlesandr...@gmail.com wrote: Dear Brian and John, Thanks a lot for your replies. I was under the impression that site.pp had to be in the environment, which I now see it doesn't have to. =) What I don't quite understand is though is the following: There are four forbidden environment names: - main - master - agent - user These names are already taken by the primary config blockshttp://docs.puppetlabs.com/guides/configuring.html#config-blocks. If you are using Git branches for your environment names, this may mean you’ll need to rename the master branch to something like production or stable. How can a git branch name (master) conflict with content in the puppet.conf file? Hugs, Sandra =) The environment name is just a directory within the /etc/puppet/environments directory, nothing more. If you use a git branch named 'master', you will just have to check it out into an environment directory with a different name, such as 'production', 'main', etc... It doesn't matter what you want to call the environment directory, as long as it's not one of those 4 you mentioned above, and git does not care what the name of the directory the files are checked out into. Puppet is not doing any sort of checking with git to see what the branch name is. ❧ Brian Mathis -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Running classes alone
Thanks for your reply! My issue was that my dnsmasq class was a) downloading the package b) setting up the service and c) adding monit monitoring scripts for it. The last part was the cyclic dependency issue. A number of things are monitored by monit, and pulling one of them into my 'preload' stage involved pulling all the other dependencies, too, which didn't work. My solution was to split up the dnsmasq class, separating the package download (and initial run) from the rest. I then added this into its own special stage (preload-dnsmasq-main), which solved my problem. I hope this helps future travellers. Best, Matt On Monday, August 19, 2013 10:45:45 AM UTC-4, David Schmitt wrote: On 2013-08-19 14:06, Matt S wrote: Hello! I've got a manifest that involves downloading and updating a bunch of different packages using apt, pip, etc. One of my apt-dependencies, dnsmasq http://www.thekelleys.org.uk/dnsmasq/doc.html, redirects the machine's DNS. Any modules currently running at that time that use the internet get a temporary name resolution error. Unfortunately, I can't run this class in a different stage, as it creates a dependency cycle with the other things that depend on dnsmasq. Is there a way to force puppet to run a particular class by itself? There are enough other tasks/jobs/whatever-we-call-them that being explicit about the dependencies isn't really worth it (and it'd have to be kept up to date as my manifest grows). You might want to look into tags. I've got a few resources which are applied to bootstrap the whole process, which can be applied separately using --tags kickstart::bootstrap, which is used while kickstarting the node. This ensures that when it reboots, it has a properly configured puppet, but doesn't start services in kickstart. Alternatively you can pack the initial installation and configuration of dnsmasq into an exec{} to ensure semi-atomic execution. Not recommended, but possible. Regards, David -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] using GIT for environments
This did it! For a simple setup I think this works great, maybe these instructions should go in the docs somewhere? Thanks for your help. On Monday, August 19, 2013 1:30:57 PM UTC-4, Jim Toth wrote: Hmm...you might need to add git remote update in there. git pull does that by default. On Mon, Aug 19, 2013 at 1:22 PM, me 1 solar...@gmail.com javascript:wrote: On Sun, Aug 18, 2013 at 9:04 PM, me 1 solar...@gmail.com wrote: On Sunday, August 18, 2013 6:13:38 PM UTC-4, Jim Toth wrote: There are a few ways to go; probably the best way is to set up a bare repository that you push and pull from in both places, but I'd probably add the development environment as a remote in the in-production directory. cd /path/to/production/repository git remote add devel /path/to/development/directory git merge --ff-only devel/master (--ff-only because I'm paranoid -- that will give you the same sort of warnings that git push would give you if you the trees had diverged). So you're saying adding to the development environment as a remote in the in-production directory is an alternative to using a bare repository then? Yes. I'm new to git and just trying to find an easy way, if using bare repositories is necessary, I don't think git is very good for this at all, its too much trouble for what its worth. (except for extremely large environments, which is rare) I'd say what it's good for is multi-user environments. Or single-user environments, if that user happens to be familiar with git. :-) ok, then here is the problem: $ git merge --ff-only preprod/master fatal: 'preprod/master' does not point to a commit $ git remote -v preprod /etc/puppet/environments/preprod/puppet/ (fetch) preprod /etc/puppet/environments/**preprod/puppet/ (push) $ pwd /etc/puppet -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com javascript:. To post to this group, send email to puppet...@googlegroups.comjavascript: . Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out. -- Jim Toth jjt...@vcu.edu javascript: Applications Analyst, Technology Services (804) 827-1227 -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: if defined not working when class is enlcosed within Class[ ]
ok, that's great. Thanks for the help. The puppet-docs it says: *Modules are how Puppet finds the classes and types it can use* — it automatically loads any classhttp://docs.puppetlabs.com/puppet/2.7/reference/lang_classes.html or defined typehttp://docs.puppetlabs.com/puppet/2.7/reference/lang_defined_types.html stored in its modules. With this in mind, if *if *defined(Class[ ]) checks for classes.. and in my case 'supervisor::service' is as you mentioned not a class but a define. Is there an equivalent like if defined(Define[ ]) or is best practice to continue using if defined('supervisor::service') to just check for anything of that name. Thanks again fLo On Monday, 19 August 2013 23:33:09 UTC+8, Florian Gray Jones wrote: Hi, I am learning puppet using version 2.7.18 on a fresh ubuntu install. I am trying to test this module https://github.com/liamjbennett/puppet-sabnzbd/blob/master/manifests/init.ppbut I'm having trouble with the if defined(Class['supervisor::service']) section in that it doesn't get run even though the supervisor module is installed. If i put else{ notice(supervisor not defined?) } on the end then I see that notice msg in the 'puppet apply --debug' output. This supervisor module is downloaded/installed OK from Puppet Forge and if I either a) comment out the 'if defined' then it works as expected b) *change the if *defined(Class['supervisor::service']) to read if defined('supervisor::service') then it also works as expected. As you can see there is an include supervisor at top of the class which I'm guessing isn't being called in the order needed for the 'if defined' to work and the one without the Class[] must work because puppet auto loads the modules from the modulepath and checks if that namespace and module exist? This is all new to me so i could be very wrong but can anyone explain given that init.pp why the 'if defined' isn't working and what is the best way to achieve what the 'if defined' is there for and that's to see if the supervisor module is installed/loaded before entering the if statement and using the module? Many thanks for reading fLo -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Re: if defined not working when class is enlcosed within Class[ ]
Since in this case, it's checking that supervisor::service exists so it can declare one, I'd say checking for just 'supervisor::service' would be fine. You may want to stay around and see what other people think though, as I could be missing something. Looking at it again, the check to see if a class has been declared seems really odd... and testing it now that I have a second, it doesn't actually seem to work at all. I'm not sure how idiomatic that is, or was, but maybe someone else can shed some light on it. On Monday, August 19, 2013 8:32:39 PM UTC-7, Florian Gray Jones wrote: ok, that's great. Thanks for the help. The puppet-docs it says: *Modules are how Puppet finds the classes and types it can use* — it automatically loads any classhttp://docs.puppetlabs.com/puppet/2.7/reference/lang_classes.html or defined typehttp://docs.puppetlabs.com/puppet/2.7/reference/lang_defined_types.html stored in its modules. With this in mind, if *if *defined(Class[ ]) checks for classes.. and in my case 'supervisor::service' is as you mentioned not a class but a define. Is there an equivalent like if defined(Define[ ]) or is best practice to continue using if defined('supervisor::service') to just check for anything of that name. Thanks again fLo On Monday, 19 August 2013 23:33:09 UTC+8, Florian Gray Jones wrote: Hi, I am learning puppet using version 2.7.18 on a fresh ubuntu install. I am trying to test this module https://github.com/liamjbennett/puppet-sabnzbd/blob/master/manifests/init.ppbut I'm having trouble with the if defined(Class['supervisor::service']) section in that it doesn't get run even though the supervisor module is installed. If i put else{ notice(supervisor not defined?) } on the end then I see that notice msg in the 'puppet apply --debug' output. This supervisor module is downloaded/installed OK from Puppet Forge and if I either a) comment out the 'if defined' then it works as expected b) *change the if *defined(Class['supervisor::service']) to read if defined('supervisor::service') then it also works as expected. As you can see there is an include supervisor at top of the class which I'm guessing isn't being called in the order needed for the 'if defined' to work and the one without the Class[] must work because puppet auto loads the modules from the modulepath and checks if that namespace and module exist? This is all new to me so i could be very wrong but can anyone explain given that init.pp why the 'if defined' isn't working and what is the best way to achieve what the 'if defined' is there for and that's to see if the supervisor module is installed/loaded before entering the if statement and using the module? Many thanks for reading fLo -- 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.