Working with Puppet
Total Page:16
File Type:pdf, Size:1020Kb
A P P E N D I X A Working with Puppet It is very important to remember that Puppet is an ever-developing tool with an ever-widening community. Not only is the Puppet community growing quickly but many new ideas, developments, patches, and recipes appear every day. This is important for two major reasons: • More often than not, someone has already solved the issue, problem or challenge you are trying to address • New features, functions, and fixes are available in every release It is a good idea to check out the various resources we talk about in the Resources section below, such as the mailing list archives and the Wiki, when you have an issue. These forums are also where announcements are made about new releases of Puppet and related tools. Getting Support and Training Puppet is an open-source tool and there are a lot of sources of information and support available for it (including this book!). In addition, Puppet’s parent company, Puppet Labs, offers the Puppet Enterprise product (the pre-packaged commercial edition of Puppet), support contracts, and custom development, consulting and training programs worldwide. You can find details of these offerings at http://www.puppetlabs.com/. Note Full disclosure: Both authors work for Puppet Labs and have a financial stake in its success. There are also a number of members of the Puppet community who offer services, implementation support and consulting services. Many local systems implementers and consultants also have Puppet, skills should you require assistance. Posting a message on the Puppet mailing list, or your Linux User Group or Open Source Business Association forums seeking help will usually result in offers of assistance. Resources There are a number of useful resources available to get you started with Puppet. We’ll refer to these and other references throughout this book. We also strongly recommend subscribing to the Puppet mailing lists (see below) as a lot of useful information, tips and tricks, and trouble-shooting assistance is presented there. Currently the mailing list has over 3000 subscribers and is an active and helpful community. 289 APPENDIX A WORKING WITH PUPPET The Puppet IRC channel, #puppet on the Freenode network, is also a useful place to visit and ask for help. There are 500 people regularly on the channel and while they are all generally busy system administrators, they can usually spare some time to help people new to Puppet. Note Many of the Puppet developers also hang out in #puppet-dev on the Freenode network. If you have development-related questions, this is a good place to start. Like all requests for help, when asking on email or IRC, you should try to ask a good question. Include your Puppet version, your platform and the exact error you are receiving. The more information you provide, the easier it is for people to help you. Another good resource for information on asking good questions on the Internet is http://catb.org/esr/faqs/smart-questions.html. You can also find a searchable log of IRC conversations available at http://pelin.lovedthanlost.net/puppet/. Web • Puppet Bug Tracker: • http://projects.puppetlabs.com • Puppet Source Code: • https://github.com/puppetlabs/puppet • Facter Source Code: • https://github.com/puppetlabs/facter • MCollective Source Code: • https://github.com/puppetlabs/marionette-collective • Puppet Documentation: • http://docs.puppetlabs.com/ • http://docs.puppetlabs.com/learning/ • http://docs.puppetlabs.com/references/ • Puppet Documentation in PDF: • http://www.puppetlabs.com/resources/downloads/ • Puppet Wiki: • http://projects.puppetlabs.com/projects/puppet/wiki • Puppet FAQ: 290 APPENDIX A WORKING WITH PUPPET • http://docs.puppetlabs.com/guides/faq.html • Puppet Style Guide: • http://docs.puppetlabs.com/guides/style_guide.html • Puppet Labs: • http://www.puppetlabs.com Mailing Lists • Puppet User Group: • http://groups.google.com/group/puppet-users/ • Puppet Developer Group: • http://groups.google.com/group/puppet-dev/ Puppet Module Forge • http://forge.puppetlabs.com Puppet Enterprise • http://www.puppetlabs.com/puppet/puppet-enterprise/ Support (commercial) • http://puppetlabs.com/services/ Training • http://puppetlabs.com/training/ IRC • Puppet IRC Channel: • irc://irc.freenode.net/puppet • Puppet Developers IRC Channel: • irc://irc.freenode.net/puppet-dev 291 Index Agent Forwarding Symbols developing change using branch, 75 agent plugins, MCollective, 276–282 @ character agent section, puppet.conf file, 12 declaring virtual resources, 134, 143 runinterval option, 26 @@ syntax agents, 2 declaring virtual resources, 143 adding definition to nodes.pp file, 20 applying configuration, 24–26 A authenticating, 17 catalog of resources, 5 absent value, ensure attribute, 4 configuring environments, 66–70 access logs configuring master for stored configuration, performance, 117 141 Puppet CA hot standby, 114 configuring reporting, 233 Puppet CA worker configuration, 112 connecting agent, 16–18 testing Puppet master in Apache, 96 connecting master and, 17 account information from ENC, 208–211 creating configuration, 18–21 accounts Ruby DSL module, 211–216 default 30-minute run interval, 265 accounts_ruby module class, 211–212 default checking period, 2 actions environments, 65 Puppet master functions, 43 extending site.pp file, 19 Active Record see Ruby Active Record library Facter tool, 4–5 active standby see Puppet CA hot standby facts, 5 ActiveMQ service, 152 HTTPS load balancing, 108 installing, 152 importance of accurate time, 18 on Debian systems, 154–156 installing on Enterprise Linux systems, 152–154 for Example.com Pty Ltd, 30 Puppet master queue configuration, 156 from source, 10 queue support for stored configurations, 152 on Debian and Ubuntu, 9 requirement of Java and XML config files, 266 on OpenSolaris, 9 stomp protocol, 152 on Red Hat, 8 activerecord/activesupport versions on Windows, 11 installing Ruby on Rails using gem, 140 listing all loaded plugins, 280–282 Add Class page, Dashboard, 174 making changes to development add command, Git tool, 37, 38 environment, 68, 69 Add Group page, Dashboard, 174 master installations, 8 add method, Facter, 243 MCollective see MCollective agents Add Node page, Dashboard, 173 MCollective plugins, 277–282 Advanced Message Queuing Protocol see AMQP mixing releases of Puppet, 7 agent command no configuration available for node, 18 testing load balancer configuration, 103 puppet binary starting, 15 293 INDEX agents (cont.) load balancing multiple masters, 97 reloading configuration files, 278 testing load balancer configuration, 103 resource abstraction layer, 4 testing master in Apache, 96 splaying time for, 117 VirtualHost template, 58, 59 testing against Postfix configuration file, 82 APT repository testing against sshd configuration file, 77 adding RabbitMQ apt repository to Debian, testing against testing environment, 86 267 testing environments with, 70–72 installing Dashboard from DEB, 162 transaction reports from, 231–233 apt-get command verifying authenticity of certificate, 95 installing Puppet on Ubuntu, 9 verifying authenticity of server, 93 installing RabbitMQ, 268 alias metaparameter, 42 ArchLinux AMQP (Advanced Message Queuing Protocol) installing Puppet on, 11 RabbitMQ, 267 arrays installing on Debian, 269 creating, 46 installing on Enterprise Linux, 270 iterating over, 205 Apache arrow operators access logs, 96 list of syntax arrows, 137 ActiveMQ service, 152 relationship-chaining syntax, 136 building host for, 30 tilde arrows, 137 exporting load balancer worker resources, attributes, 3, 4 145, 146, 147 absent value, 4 installing Passenger module ensure attribute, 4 on Debian-based systems, 91–92 metaparameters, 23 on Enterprise Linux, 90–91 overriding, 52 using Ruby Gems, 92 present value, 4 load balancing multiple masters, 97–116 recurse attribute, 55 managing, 56 require attribute, 23 Passenger module, 90 undef value, 53 configuring Apache and, 93–95 audit capabilities, Dashboard, 159 running Dashboard with, 165, 166–167 audit mode, 55 running Foreman with, 180 authentication reverse proxy load balancer, 100 authenticating agent, 17 running master with Passenger and, 90–97 Dashboard, 168 testing master in, 96–97 Foreman, 186 apache class, 58 HTTP Basic authentication, 168 apache::install class, 56 LDAP authentication, 186 apache::service class, 57 load balancing multiple masters, 98, 100, 101, Apache definition, 57–60 102 content attribute, 58 SSL authentication, 90, 94, 95, 97, 101 define syntax, 57 authorization priority parameter, 58 Dashboard, 168 serveraliases parameter, 59 load balancing multiple masters, 102 variables, 58 autoloading, 60 vhost.pp file, 60 autosign mode, certificates, 17 VirtualHost template, 58, 59 Apache front-end load balancer see front-end Apache load balancer B Apache virtual host back-end master worker virtual hosts, 90 configuring Apache and Passenger, 93 configuring unique Rack DocumentRoot, 106 configuring for Dashboard, 166 294 INDEX load balancer configuration, 100 implementing cucumber check, 226 testing, 103, 104, 105, 106 testing failure reporting, 222–223 load balancing multiple masters, 98–100 testing policy, 222–223 backing up files, 26 validating resources, 224–228 balancer_access.log file, 103 writing story describing behavior, 218–221 balancer_error.log file, 104 catalog requests BalancerMember keyword, 101 curl command, 117 balancermember resources, 146, 147 measuring performance, 116, 117 base node CentOS node inheritance, 32, 33 addressing hosts with metadata, 284 Basic authentication, HTTP installing