Difference between revisions of "Puppet"

From ArchWiki
Jump to: navigation, search
(Packages)
Line 4: Line 4:
 
:''Puppet is IT automation software that helps system administrators manage infrastructure throughout its lifecycle, from provisioning and configuration to patch management and compliance. Using Puppet, you can easily automate repetitive tasks, quickly deploy critical applications, and proactively manage change, scaling from 10s of servers to 1000s, on-premise or in the cloud.''
 
:''Puppet is IT automation software that helps system administrators manage infrastructure throughout its lifecycle, from provisioning and configuration to patch management and compliance. Using Puppet, you can easily automate repetitive tasks, quickly deploy critical applications, and proactively manage change, scaling from 10s of servers to 1000s, on-premise or in the cloud.''
  
== Installation ==
+
= Installation =
  
Puppet packages are available in AUR. Install either puppet or puppet-git.
+
Puppet packages are available in AUR. Install either puppet or puppet-git. The maintainer of the puppet AUR packages is not interested in shipping patches to minimize work as well as avoid confusion as to where bugs should go. So I will collect my patches here.
  
==Configuration ==
+
= Configuration =
  
Puppet will look for your configuration in /etc/puppet/manifests/site.pp
+
Puppet will look for your configuration in {{ic|<nowiki>/etc/puppet/manifests/site.pp</nowiki>}}.
 +
 
 +
== Facter ==
 +
 
 +
Facter is a package that gathers facts about the system it runs on. Use with {{ic|<nowiki>puppet facts find facter</nowiki>}}.
 +
 
 +
Facter requires both {{ic|<nowiki>ifconfig</nowiki>}} as well as {{ic|<nowiki>ip</nowiki>}} to gather network related facts.
 +
 
 +
=== Puppet 3.1.0 ===
 +
 
 +
Unfortunately {{ic|<nowiki>ifconfig</nowiki>}} in arch is too new for puppet. This is a ugly patch to work around the problem:
 +
diff -urN facter-1.6.17-orig/lib/facter/util/ip.rb facter-1.6.17/lib/facter/util/ip.rb
 +
--- facter-1.6.17-orig/lib/facter/util/ip.rb    2013-02-25 08:48:04.000000000 +0100
 +
+++ facter-1.6.17/lib/facter/util/ip.rb 2013-02-26 17:56:27.801252980 +0100
 +
@@ -135,6 +135,8 @@
 +
        output = Facter::Util::IP.ifconfig_interface(interface)
 +
      when 'Linux'
 +
        ifconfig_output = Facter::Util::IP.ifconfig_interface(interface)
 +
+      ifconfig_output.gsub!(/inet ([0-9]+\.)/, 'inet addr:\1')
 +
+      ifconfig_output.gsub!(/inet6 ([a-fA-F0-9]+:)/, 'inet6 addr: \1')
 +
        if interface =~ /^ib/ then
 +
          real_mac_address = get_infiniband_macaddress(interface)
 +
          output = ifconfig_output.sub(%r{(?:ether|HWaddr)\s+((\w{1,2}:){5,}\w{1,2})}, "HWaddr #{real_mac_address}")
 +
 
 +
Apply in {{ic|<nowiki>/usr/lib/ruby/gems/1.9.1/gems</nowiki>}}.
  
 
==Packages==
 
==Packages==
  
pacman is supported by puppet. Installing packages works out of the box with puppet 3.1.0 and the git packages.
+
"Pacman" is supported by puppet. Installing packages works out of the box with puppet 3.1.0 and the git packages.
  
 
==Services==
 
==Services==
  
 
===Puppet 3.1.0===
 
===Puppet 3.1.0===
Puppet will to use rc.d to manage services on arch linux. It does support systemd though, and can be forced to use this instead by adding
 
  Service { provider => 'systemd'; }
 
to your site.pp file.
 
  
{{Note|This does not work for me: Puppet complains that two init systems are possible for my system and falls back to init. Still need to figure out how to get this working.}}
+
Puppet has trouble with systemd on arch linux. This diff fixes it:
 +
--- puppet-3.1.0-orig/lib/puppet/provider/service/systemd.rb    2013-02-25 08:49:29.000000000 +0100
 +
+++ puppet-3.1.0/lib/puppet/provider/service/systemd.rb 2013-02-26 16:59:36.828276309 +0100
 +
@@ -3,9 +3,10 @@
 +
  Puppet::Type.type(:service).provide :systemd, :parent => :base do
 +
    desc "Manages `systemd` services using `/bin/systemctl`."
 +
 
 +
-  commands :systemctl => "/bin/systemctl"
 +
+  commands :systemctl => "/usr/bin/systemctl"
 +
 
 +
    #defaultfor :osfamily => [:redhat, :suse]
 +
+  defaultfor :osfamily => [:archlinux]
 +
 
 +
    def self.instances
 +
      i = []
  
You will also need to have the systemctl binary in /bin, not /usr/bin (default in arch linux) for this to work. This can be done by creating a symlink (via puppet).
+
Apply in {{ic|<nowiki>/usr/lib/ruby/gems/1.9.1/gems</nowiki>}}.
  
== See also ==
+
= See also =
 
* [[Puppet Dashboard]] - Software based on or using puppet in this wiki.
 
* [[Puppet Dashboard]] - Software based on or using puppet in this wiki.

Revision as of 21:58, 26 February 2013

Tango-document-new.pngThis article is a stub.Tango-document-new.png

Notes: This wiki entry is a work-in-progress. (Discuss in Talk:Puppet#)

From Puppet web site:

Puppet is IT automation software that helps system administrators manage infrastructure throughout its lifecycle, from provisioning and configuration to patch management and compliance. Using Puppet, you can easily automate repetitive tasks, quickly deploy critical applications, and proactively manage change, scaling from 10s of servers to 1000s, on-premise or in the cloud.

Installation

Puppet packages are available in AUR. Install either puppet or puppet-git. The maintainer of the puppet AUR packages is not interested in shipping patches to minimize work as well as avoid confusion as to where bugs should go. So I will collect my patches here.

Configuration

Puppet will look for your configuration in /etc/puppet/manifests/site.pp.

Facter

Facter is a package that gathers facts about the system it runs on. Use with puppet facts find facter.

Facter requires both ifconfig as well as ip to gather network related facts.

Puppet 3.1.0

Unfortunately ifconfig in arch is too new for puppet. This is a ugly patch to work around the problem:

diff -urN facter-1.6.17-orig/lib/facter/util/ip.rb facter-1.6.17/lib/facter/util/ip.rb
--- facter-1.6.17-orig/lib/facter/util/ip.rb    2013-02-25 08:48:04.000000000 +0100
+++ facter-1.6.17/lib/facter/util/ip.rb 2013-02-26 17:56:27.801252980 +0100
@@ -135,6 +135,8 @@
       output = Facter::Util::IP.ifconfig_interface(interface)
     when 'Linux'
       ifconfig_output = Facter::Util::IP.ifconfig_interface(interface)
+      ifconfig_output.gsub!(/inet ([0-9]+\.)/, 'inet addr:\1')
+      ifconfig_output.gsub!(/inet6 ([a-fA-F0-9]+:)/, 'inet6 addr: \1')
       if interface =~ /^ib/ then
         real_mac_address = get_infiniband_macaddress(interface)
         output = ifconfig_output.sub(%r{(?:ether|HWaddr)\s+((\w{1,2}:){5,}\w{1,2})}, "HWaddr #{real_mac_address}")

Apply in /usr/lib/ruby/gems/1.9.1/gems.

Packages

"Pacman" is supported by puppet. Installing packages works out of the box with puppet 3.1.0 and the git packages.

Services

Puppet 3.1.0

Puppet has trouble with systemd on arch linux. This diff fixes it:

--- puppet-3.1.0-orig/lib/puppet/provider/service/systemd.rb    2013-02-25 08:49:29.000000000 +0100
+++ puppet-3.1.0/lib/puppet/provider/service/systemd.rb 2013-02-26 16:59:36.828276309 +0100
@@ -3,9 +3,10 @@
 Puppet::Type.type(:service).provide :systemd, :parent => :base do
   desc "Manages `systemd` services using `/bin/systemctl`."
 
-  commands :systemctl => "/bin/systemctl"
+  commands :systemctl => "/usr/bin/systemctl"
  
   #defaultfor :osfamily => [:redhat, :suse]
+  defaultfor :osfamily => [:archlinux]
 
   def self.instances
     i = []

Apply in /usr/lib/ruby/gems/1.9.1/gems.

See also