1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Puppet</title>
<link rel="stylesheet" type="text/css" href="it.css">
<script type="text/javascript" src="jquery.js"></script><script type="text/javascript" src="jquery.syntax.js"></script><script type="text/javascript" src="yelp.js"></script><link rel="stylesheet" type="text/css" href="main.css">
<link rel="stylesheet" type="text/css" href="custom.css">
<script type="text/javascript" src="http://ubuntu-it.org/sites/all/themes/light-drupal-theme/js/cookies.js"></script><script type="text/javascript" src="http://ubuntu-it.org/sites/all/themes/light-drupal-theme/js/accessibility.js"></script>
</head>
<body>
<script type="text/javascript">var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-8147493-2");
pageTracker._trackPageview();
} catch(err) {}
</script><div id="fixed-header">
<div id="header" class="shadowed curved-bottom"><div class="container">
<ul class="links">
<li><a href="http://help.ubuntu-it.org">Documentazione ufficiale</a></li>
<li><a href="http://wiki.ubuntu-it.org/Documentazione/Indice">Guide della comunità</a></li>
<li class="active"><a href="http://help.ubuntu-it.org/12.04/server/serverguide/it/index.html">12.04 LTS</a></li>
</ul>
<div id="logo">
<div id="ubuntu-it-sites">
<a href="http://www.ubuntu-it.org">web </a><a href="http://wiki.ubuntu-it.org">wiki </a><a href="http://forum.ubuntu-it.org">forum </a><a href="http://planet.ubuntu-it.org">planet </a>
</div>
<a href="http://help.ubuntu-it.org" title="Ubuntu - Documentazione ufficiale"><span>help.</span>ubuntu-it
</a><span>comunità italiana</span>
</div>
<div class="buttons"><div id="accessibility" title="Maggiore focus ai contenuti" onclick="accessibility_toggle();"></div></div>
</div></div>
<div id="subheader"><div class="container"><div class="container-inside"><ul class="links secondary-links">
<li><a href="http://help.ubuntu-it.org/12.04/desktop/index.html" title="Guida utente di Ubuntu 12.04 LTS">Desktop</a></li>
<li class="active"><a href="http://help.ubuntu-it.org/12.04/server/serverguide/it/index.html" title="Guida utente di Ubuntu server 12.04 LTS">Server</a></li>
<li><a href="http://help.ubuntu-it.org/12.04/search.php" title="Ricerna della documentazione di Ubuntu 12.04 LTS">Ricerca</a></li>
</ul></div></div></div>
</div>
<div id="content">
<div id="content-top"></div>
<div class="container">
<div id="tmp-note">Questa guida non è stata ancora completamente tradotta. Se vuoi contribuire alla sua traduzione contatta il <a href="http://wiki.ubuntu-it.org/GruppoTraduzione/" title="Gruppo Traduzione">Gruppo Traduzione</a> di Ubuntu-it.</div>
<div id="search-box"><form action="http://help.ubuntu-it.org/12.04/search.php" id="cse-search-box"><div><input type="text" name="s" value="Cerca ..." onfocus="if(this.value == 'Cerca ...') { this.value = ''; }" onblur="if (this.value == '') {this.value = 'Cerca ...';}"></div></form></div>
<div class="trails"><div class="trail">
<a class="trail" href="index.html" title="Guida a Ubuntu Server">Guida a Ubuntu Server</a> » <a class="trail" href="remote-administration.html" title="Amministrazione remota">Amministrazione remota</a> » </div></div>
<div id="cwt-content"><div id="page">
<div id="content">
<div class="links nextlinks">
<a class="nextlinks-prev" href="openssh-server.html" title="Server OpenSSH">Indietro</a> | <a class="nextlinks-next" href="zentyal.html" title="Zentyal">Avanti</a>
</div>
<div class="hgroup"><h1 class="title">Puppet</h1></div>
<div class="region">
<div class="contents">
<p class="para">
<span class="app application">Puppet</span> is a cross platform framework enabling system administrators to perform common tasks using code.
The code can do a variety of tasks from installing new software, to checking file permissions, or updating user accounts. Puppet is
great not only during the initial installation of a system, but also throughout the system's entire life cycle. In most circumstances
<span class="app application">puppet</span> will be used in a client/server configuration.
</p>
<p class="para">
This section will cover installing and configuring <span class="app application">Puppet</span> in a client/server configuration. This simple example
will demonstrate how to install <span class="app application">Apache</span> using <span class="app application">Puppet</span>.
</p>
</div>
<div class="links sectionlinks"><ul>
<li class="links"><a class="xref" href="puppet.html#puppet-installation" title="Installazione">Installazione</a></li>
<li class="links"><a class="xref" href="puppet.html#puppet-configuration" title="Configurazione">Configurazione</a></li>
<li class="links"><a class="xref" href="puppet.html#puppet-resources" title="Risorse">Risorse</a></li>
</ul></div>
<div class="sect2 sect" id="puppet-installation"><div class="inner">
<div class="hgroup"><h2 class="title">Installazione</h2></div>
<div class="region"><div class="contents">
<p class="para">
To install <span class="app application">Puppet</span>, in a terminal on the <span class="em emphasis">server</span> enter:
</p>
<div class="screen"><pre class="contents "><span class="cmd command">sudo apt-get install puppetmaster</span>
</pre></div>
<p class="para">
On the <span class="em emphasis">client</span> machine, or machines, enter:
</p>
<div class="screen"><pre class="contents "><span class="cmd command">sudo apt-get install puppet</span>
</pre></div>
</div></div>
</div></div>
<div class="sect2 sect" id="puppet-configuration"><div class="inner">
<div class="hgroup"><h2 class="title">Configurazione</h2></div>
<div class="region"><div class="contents">
<p class="para">
Prior to configuring <span class="app application">puppet</span> you may want to add a DNS <span class="em emphasis">CNAME</span> record for
<span class="em emphasis">puppet.example.com</span>, where <span class="em emphasis">example.com</span> is your domain. By default
<span class="app application">Puppet</span> clients check DNS for puppet.example.com as the puppet server name, or
<span class="em emphasis">Puppet Master</span>. See <a class="xref" href="dns.html" title="DNS (Domain Name Service)">DNS (Domain Name Service)</a> for more DNS details.
</p>
<p class="para">
If you do not wish to use DNS, you can add entries to the server and client <span class="file filename">/etc/hosts</span> file. For example, in the
<span class="app application">Puppet</span> server's <span class="file filename">/etc/hosts</span> file add:
</p>
<div class="code"><pre class="contents ">127.0.0.1 localhost.localdomain localhost puppet
192.168.1.17 meercat02.example.com meercat02
</pre></div>
<p class="para">
On each <span class="app application">Puppet</span> client, add an entry for the server:
</p>
<div class="code"><pre class="contents ">192.168.1.16 meercat.example.com meercat puppet
</pre></div>
<div class="note" title="Annotazione"><div class="inner"><div class="region"><div class="contents">
<p class="para">
Replace the example IP addresses and domain names above with your actual server and client addresses and domain names.
</p>
</div></div></div></div>
<p class="para">
Now setup some resources for <span class="app application">apache2</span>. Create a file <span class="file filename">/etc/puppet/manifests/site.pp</span>
containing the following:
</p>
<div class="code"><pre class="contents ">package {
'apache2':
ensure => installed
}
service {
'apache2':
ensure => true,
enable => true,
require => Package['apache2']
}
</pre></div>
<p class="para">
Next, create a node file <span class="file filename">/etc/puppet/manifests/nodes.pp</span> with:
</p>
<div class="code"><pre class="contents ">node 'meercat02.example.com' {
include apache2
}
</pre></div>
<div class="note" title="Annotazione"><div class="inner"><div class="region"><div class="contents">
<p class="para">
Replace <span class="em emphasis">meercat02.example.com</span> with your actual <span class="app application">Puppet</span> client's host name.
</p>
</div></div></div></div>
<p class="para">
The final step for this simple <span class="app application">Puppet</span> server is to restart the daemon:
</p>
<div class="screen"><pre class="contents "><span class="cmd command">sudo /etc/init.d/puppetmaster restart</span>
</pre></div>
<p class="para">
Now everything is configured on the <span class="app application">Puppet</span> server, it is time to configure the client.
</p>
<p class="para">
First, configure the <span class="app application">Puppet</span>agent daemon to start. Edit <span class="file filename">/etc/default/puppet</span>, changing
<span class="em emphasis">START</span> to yes:
</p>
<div class="code"><pre class="contents ">START=yes
</pre></div>
<p class="para">
Then start the service:
</p>
<div class="screen"><pre class="contents "><span class="cmd command">sudo /etc/init.d/puppet start</span>
</pre></div>
<p class="para">
Back on the <span class="app application">Puppet</span> server sign the client certificate by entering:
</p>
<div class="screen"><pre class="contents "><span class="cmd command">sudo puppetca --sign meercat02.example.com</span>
</pre></div>
<p class="para">
Check <span class="file filename">/var/log/syslog</span> for any errors with the configuration. If all goes well the <span class="app application">apache2</span>
package and it's dependencies will be installed on the <span class="app application">Puppet</span> client.
</p>
<div class="note" title="Annotazione"><div class="inner"><div class="region"><div class="contents">
<p class="para">
This example is <span class="em emphasis">very</span> simple, and does not highlight many of <span class="app application">Puppet</span>'s features and
benefits. For more information see <a class="xref" href="puppet.html#puppet-resources" title="Risorse">Risorse</a>.
</p>
</div></div></div></div>
</div></div>
</div></div>
<div class="sect2 sect" id="puppet-resources"><div class="inner">
<div class="hgroup"><h2 class="title">Risorse</h2></div>
<div class="region"><div class="contents"><div class="list itemizedlist"><ul class="list itemizedlist">
<li class="list itemizedlist">
<p class="para">
See the <a class="ulink" href="http://docs.puppetlabs.com/" title="http://docs.puppetlabs.com/">Official Puppet Documentation</a> web site.
</p>
</li>
<li class="list itemizedlist">
<p class="para">
Also see <a class="ulink" href="http://www.apress.com/9781430230571" title="http://www.apress.com/9781430230571">Pro Puppet</a>.
</p>
</li>
<li class="list itemizedlist">
<p class="para">
Another source of additional information is the <a class="ulink" href="https://help.ubuntu.com/community/Puppet" title="https://help.ubuntu.com/community/Puppet">Ubuntu Wiki Puppet Page</a>.
</p>
</li>
</ul></div></div></div>
</div></div>
</div>
<div class="links nextlinks">
<a class="nextlinks-prev" href="openssh-server.html" title="Server OpenSSH">Indietro</a> | <a class="nextlinks-next" href="zentyal.html" title="Zentyal">Avanti</a>
</div>
<div class="clear"></div>
</div>
<div id="pagebottom"></div>
</div></div>
</div>
<div id="content-bottom"></div>
</div>
<div id="footer"><div class="container">
<div id="ubuntulinks">Ubuntu e Canonical sono marchi registrati da Canonical Ltd. <br>
Questa opera è pubblicata sotto una <span style="text-decoration: underline;"><a href="http://help.ubuntu-it.org/legal.html">licenza</a></span> Creative Commons.
</div>
<div id="pagebottom"></div>
</div></div>
</body>
</html>