Puppet Notes: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
Line 1: Line 1:
== Puppet 4.10 Cheat ==
== Puppet 4.10 Cheat ==
== Server setup ===


https://apt.puppetlabs.com/
https://apt.puppetlabs.com/
Line 44: Line 46:
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ureadahead (0.100.0-19) ...
</pre>
</pre>
=== Windows agent setup ===
https://downloads.puppetlabs.com/windows/
https://downloads.puppetlabs.com/windows/puppet-agent-1.10.0-x64.msi


== agent one off ==
== agent one off ==

Revision as of 01:33, 10 April 2017

Puppet 4.10 Cheat

Server setup =

https://apt.puppetlabs.com/

wget https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
sudo dpkg -i puppetlabs-release-pc1-xenial.deb
sudo apt update
sudo apt-get install aptitude
aptitude search puppet
sudo apt-get install puppetserver puppet-agent puppetdb puppetdb-termini
Setting up puppetdb (4.4.0-1puppetlabs1) ...
Config archive not found. Not proceeding with migration
PEM files in /etc/puppetlabs/puppetdb/ssl are missing, we will move them into place for you
Warning: Unable to find all puppet certificates to copy

  This tool requires the following certificates to exist:

  * /etc/puppetlabs/puppet/ssl/certs/ca.pem
  * /etc/puppetlabs/puppet/ssl/private_keys/pm.quadratic.net.pem
  * /etc/puppetlabs/puppet/ssl/certs/pm.quadratic.net.pem

  These files may be missing due to the fact that your host's Puppet
  certificates may not have been signed yet, probably due to the
  lack of a complete Puppet agent run. Try running puppet first, for
  example:

      puppet agent --test

  Afterwards re-run this tool then restart PuppetDB to complete the SSL
  setup:

      puppetdb ssl-setup -f
Setting up puppetserver (2.7.2-1puppetlabs1) ...
usermod: no changes
Processing triggers for libc-bin (2.23-0ubuntu7) ...
Processing triggers for systemd (229-4ubuntu16) ...
Processing triggers for ureadahead (0.100.0-19) ...

Windows agent setup

https://downloads.puppetlabs.com/windows/

https://downloads.puppetlabs.com/windows/puppet-agent-1.10.0-x64.msi

agent one off

puppet agent --verbose --debug --onetime --no-daemonize

rootmail alias + newaliases

    augeas { 'rootmail':
        context => "/files/etc/aliases",
        onlyif  => "match /files/etc/aliases/*[name='root'][value='$rootmail'] size == 0",
        changes => [
            "rm *[name='root']",
            "set 01/name root",
            "set *[name='root']/value $rootmail",
        ],
    }

    exec { 'newaliases':
        subscribe => Augeas['rootmail'],
        command => "/usr/bin/newaliases",
    }

relayhost

    augeas { 'relayhost':
        context => "/files/etc/postfix/main.cf",
        onlyif  => "match relayhost != '$relayhost'",
        changes => [
            "rm relayhost",
            "set relayhost '$relayhost'",
        ],
    }