Puppet

686 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
686
On SlideShare
0
From Embeds
0
Number of Embeds
51
Actions
Shares
0
Downloads
7
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Puppet

  1. 1. Client – Server Model Configuration management Unix-like and Windows Discover by Facter and send to agent
  2. 2. Procedural vs. DeclarativeHow vs. WhatShell vs. Puppet package { "vim": ensure => present, }
  3. 3. Nodes Manifest and Modules node /^wwwd+.example.com/ { include sudo } node jira-dev.researchnow.com/ { include sudo } …
  4. 4. --noop $ puppet agent –test --noop
  5. 5. It’s own DSL…if/else, etc.package { "ssh": name => $operatingsystem ? /(Red Hat|CentOS|Fedora|Ubuntu|Debian)/ => "openssh-server", Solaris => "openssh", }, ensure => installed,} My recommendation: RTFB …. Read The Fowler Book on DSL
  6. 6. Auditfile { /etc/hosts: audit => [ owner, group, mode ],}audit change: previously recorded value owner roothas been changed to owner daemon
  7. 7. Environments, Dev/QA…or Percontributor $ puppet agent –test –v –-environemnt testing
  8. 8. Scaling• Default puppet master is using webrick• You can host it on apache
  9. 9. Externalizing Puppet Configuration• ENC – External Node Classification• LDAP server classification• Database• Ruby script or Perl• Dashboard• Foreman
  10. 10. Foreman
  11. 11. TDD - rspecrequire spec_helperdescribe logrotate::rule do let(:title) { nginx } it { should include_class(logrotate::rule) } it do should contain_file(/etc/logrotate.d/nginx).with({ ensure => present, owner => root, group => root, mode => 0444, }) end context with compress => true do let(:params) { {:compress => true} } it do should contain_file(/etc/logrotate.d/nginx) .with_content(/^s*compress$/) end end context with compress => false do let(:params) { {:compress => false} }
  12. 12. TDD - cucumberFeature: General catalog policy In order to ensure applicability of a hosts catalog As a manifest developer I want all catalogs to obey some general rules Scenario Outline: Compile and verify catalog Given a node specified by "features/yaml/<hostname>.example.com.yaml" When I compile its catalog Then compilation should succeed And all resource dependencies should resolve Examples: | hostname | | localhost |
  13. 13. Tips• # install latest puppet• wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb• sudo dpkg -i puppetlabs-release-precise.deb• sudo apt-get update sudo apt-get install puppetmaster• # chaining• # ntp.conf is applied first, and will notify the ntpd service• # if it changes:• File[/etc/ntp.conf] ~> Service[ntpd]• # Certification tips• puppet cert clean liferay-dev.local• rm -f /var/lib/puppet/ssl/certs/liferay-dev.local.pem• find /var/lib/puppet -type f -print0 |xargs -0r rm• # Debug• puppet master --no-daemonize --debug --verbose –trace• puppet config print manifest• puppet config print all• puppet config print modulepath
  14. 14. What do we have so far? https://github.com/rsn-innovation/puppets

×