Difference between revisions of "Puppet"

From ArchWiki
Jump to: navigation, search
(Style clean up. See Help:Style.)
(28 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
[[Category:System administration]]
 
[[Category:System administration]]
 
+
{{Stub|This wiki entry is a work-in-progress.}}
{{Note|This wiki entry is a work-in-progress.}}
+
 
+
 
From [https://puppetlabs.com/puppet/what-is-puppet/ Puppet web site]:
 
From [https://puppetlabs.com/puppet/what-is-puppet/ 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.''
 
:''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.''
  
=Installing puppet=
+
== Installation ==
 +
 
 +
Puppet packages are available in [[AUR]]. Install either {{AUR|puppet}} or {{AUR|puppet-git}}.
 +
 
 +
== Configuration ==
 +
 
 +
Puppet's main configuration file is puppet.conf which is located at
 +
{{ic|<nowiki>/etc/puppet/puppet.conf</nowiki>}}.
 +
You have 3 options to place settings depending if it is a master/agent<br>
 +
  [main]
 +
  [agent]
 +
  [master]
 +
 
 +
Bare minimum of settings are:
 +
* server: The hostname of the puppet server. Default = puppet
 +
* report: Most users should set this to true.
 +
* pluginsync: Most users should set this to true.
 +
* certname: The certified name of the machine (unique identifier) default = fqdn
 +
 
 +
Puppet will look for node configuration in {{ic|<nowiki>/etc/puppet/manifests/site.pp</nowiki>}}.
 +
 
 +
After starting puppet by daemon/cron/standalone, it will generate
 +
certificates in {{ic|<nowiki>/etc/puppet/ssl/</nowiki>}} directory.
 +
And you need to accept this certificaten the puppet master with:
 +
{{ic|<nowiki>sudo puppet cert sign <name></nowiki>}}.
 +
 
 +
== Facter ==
 +
 
 +
Facter is a companion program of puppet that gathers facts about the system it runs on.<br>
 +
commands:
 +
# puppet facts find facter
 +
# facter -p
 +
 
 +
=== Installation ===
 +
Install it from aur {{AUR|ruby-facter}}.
 +
Facter requires both {{ic|<nowiki>ifconfig</nowiki>}} as well as {{ic|<nowiki>ip</nowiki>}} to gather network related facts.
 +
 
 +
With facter 1.7.0 the new {{ic|ifconfig}} in arch will give proper output to IP adresses, but netmask/mtu are still a problem.
 +
 
 +
Netmask has been adressed on github version of facter.
 +
 
 +
== puppet resources ==
 +
===Packages===
  
Puppet packages are available in AUR. Install either puppet or puppet-git.
+
"Pacman" is supported by puppet. Installing packages works out of the box since puppet 3.1.0.
  
=Configuring puppet=
+
===Services===
  
Puppet will look for your configuration in /etc/puppet/manifests/site.pp
+
Since puppet 3.2.1 systemd on archlinux is fully supported.<br>
 +
The systemd provider in Puppet today only uses two commands for the service enable state:<br>
 +
  systemctl is-enabled <unit>, checking return code for the current enable state<br>
 +
  systemctl enable/disable <unit> to change it.
  
==Packages==
+
Otherwise service running will use:
 +
  # systemctl start/stop/restart <unit>
  
pacman is supported in puppet.
+
Using the full unit name unit.service is supported.
  
==Services==
+
== extra/patches ==
 +
===Puppet 3.2.1===
  
===Puppet 3.1.0===
+
If you want to enable the "storeconfig" option in /etc/puppet/puppet.conf you will also need this patch:
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.}}
+
diff -urN puppet-3.1.1-orig/lib/puppet/rails/resource.rb puppet-3.1.1/lib/puppet/rails/resource.rb
 +
--- puppet-3.1.1-orig/lib/puppet/rails/resource.rb      2013-03-13 20:53:21.766846140 +0100
 +
+++ puppet-3.1.1/lib/puppet/rails/resource.rb  2013-03-13 21:01:07.337490296 +0100
 +
@@ -84,7 +86,11 @@
 +
    end
 +
 
 +
    def [](param)
 +
-    super || parameter(param)
 +
+    if param == 'id'
 +
+      super
 +
+    else
 +
+      super || parameter(param)
 +
+    end
 +
    end
 +
 
 +
    # Make sure this resource is equivalent to the provided Parser resource.
  
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 the same place.
  
=Other Software=
+
Before you apply above patch read this:[http://projects.puppetlabs.com/projects/1/wiki/using_stored_configuration using_stored_configuration]
  
Software based on or using puppet in this wiki:
+
==puppetdb ==
 +
PuppetDB is the fast, scalable, and reliable data warehouse for Puppet.<br>
 +
It caches data generated by Puppet, and gives you advanced features at awesome speed with a powerful API.<br>
 +
Puppetdb is in aur install {{AUR|puppetdb}} and {{AUR|puppetdb-terminus}} <br>
 +
[More information: https://github.com/puppetlabs/puppetdb]
  
* [[Puppet Dashboard]]
+
== See also ==
 +
* [[Puppet Dashboard]] - Software based on or using puppet in this wiki.

Revision as of 07:45, 24 August 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 puppetAUR or puppet-gitAUR.

Configuration

Puppet's main configuration file is puppet.conf which is located at /etc/puppet/puppet.conf. You have 3 options to place settings depending if it is a master/agent

 [main]
 [agent]
 [master]

Bare minimum of settings are:

  • server: The hostname of the puppet server. Default = puppet
  • report: Most users should set this to true.
  • pluginsync: Most users should set this to true.
  • certname: The certified name of the machine (unique identifier) default = fqdn

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

After starting puppet by daemon/cron/standalone, it will generate certificates in /etc/puppet/ssl/ directory. And you need to accept this certificaten the puppet master with: sudo puppet cert sign <name>.

Facter

Facter is a companion program of puppet that gathers facts about the system it runs on.
commands:

# puppet facts find facter
# facter -p

Installation

Install it from aur ruby-facterAUR. Facter requires both ifconfig as well as ip to gather network related facts.

With facter 1.7.0 the new ifconfig in arch will give proper output to IP adresses, but netmask/mtu are still a problem.

Netmask has been adressed on github version of facter.

puppet resources

Packages

"Pacman" is supported by puppet. Installing packages works out of the box since puppet 3.1.0.

Services

Since puppet 3.2.1 systemd on archlinux is fully supported.
The systemd provider in Puppet today only uses two commands for the service enable state:

 systemctl is-enabled <unit>, checking return code for the current enable state
systemctl enable/disable <unit> to change it.

Otherwise service running will use:

 # systemctl start/stop/restart <unit>

Using the full unit name unit.service is supported.

extra/patches

Puppet 3.2.1

If you want to enable the "storeconfig" option in /etc/puppet/puppet.conf you will also need this patch:

diff -urN puppet-3.1.1-orig/lib/puppet/rails/resource.rb puppet-3.1.1/lib/puppet/rails/resource.rb
--- puppet-3.1.1-orig/lib/puppet/rails/resource.rb      2013-03-13 20:53:21.766846140 +0100
+++ puppet-3.1.1/lib/puppet/rails/resource.rb   2013-03-13 21:01:07.337490296 +0100
@@ -84,7 +86,11 @@
   end
 
   def [](param)
-    super || parameter(param)
+    if param == 'id'
+      super
+    else
+      super || parameter(param)
+    end
   end
 
   # Make sure this resource is equivalent to the provided Parser resource.

Apply in the same place.

Before you apply above patch read this:using_stored_configuration

puppetdb

PuppetDB is the fast, scalable, and reliable data warehouse for Puppet.
It caches data generated by Puppet, and gives you advanced features at awesome speed with a powerful API.
Puppetdb is in aur install puppetdbAUR and puppetdb-terminusAUR
[More information: https://github.com/puppetlabs/puppetdb]

See also