Это старая версия документа.


Puppet

Puppet - это кроссплатформенная структура, позволяющая системным администраторам выполнять общие задачи с использованием кода. Код позволяет выполнять различные задачи от установки новых программ до проверки прав доступа файлов или обновлений пользовательских учетных записей. Puppet превосходна не только в процессе изначальной установки системы, но и на протяжении всего жизненного цикла системы. В большинстве случаев puppet используется в конфигурации клиент/сервер.

Этот раздел показывает установку и настройку Puppet в конфигурации клиент/сервер. Этот простой пример демонстрирует как установить Apache с использованием Puppet.

Установка

Для установки Puppet введите в терминале:

sudo apt-get install puppetmaster

На клиентской машине (или машинах) введите:

sudo apt-get install puppet

Настройка

Prior to configuring puppet you may want to add a DNS CNAME record for puppet.example.com, where example.com is your domain. By default Puppet clients check DNS for puppet.example.com as the puppet server name, or Puppet Master. See Domain Name Service (DNS) for more DNS details.

If you do not wish to use DNS, you can add entries to the server and client /etc/hosts file. For example, in the Puppet server's /etc/hosts file add:

127.0.0.1 localhost.localdomain localhost puppet
192.168.1.17 meercat02.example.com meercat02

On each Puppet client, add an entry for the server:

192.168.1.16 meercat.example.com meercat puppet

Replace the example IP addresses and domain names above with your actual server and client addresses and domain names.

Now setup some resources for apache2. Create a file /etc/puppet/manifests/site.pp containing the following:

package {
    'apache2':
        ensure => installed
}

service {
    'apache2':
        ensure => true,
        enable => true,
        require => Package['apache2']
}

Next, create a node file /etc/puppet/manifests/nodes.pp with:

node 'meercat02.example.com' {
   include apache2
}

Replace meercat02.example.com with your actual Puppet client's host name.

The final step for this simple Puppet server is to restart the daemon:

sudo /etc/init.d/puppetmaster restart

Now everything is configured on the Puppet server, it is time to configure the client.

First, configure the Puppetagent daemon to start. Edit /etc/default/puppet, changing START to yes:

START=yes

Then start the service:

sudo /etc/init.d/puppet start

Back on the Puppet server sign the client certificate by entering:

sudo puppetca --sign meercat02.example.com

Check /var/log/syslog for any errors with the configuration. If all goes well the apache2 package and it's dependencies will be installed on the Puppet client.

This example is very simple, and does not highlight many of Puppet's features and benefits. For more information see Resources.

Ссылки

  See the Official Puppet Documentation web site.
  Also see Pro Puppet.
  Another source of additional information is the Ubuntu Wiki Puppet Page.