07d8b0ff24
With split puppet master infrastructure ansible needs to be told which puppetmaster to talk to. Do this by making puppetmaster a required argument to the puppet ansible playbook. Since we can't rely on the cert listing while this is happening also add puppet master specific host list files which can be used to specify which hosts talk to which puppetmaster via the new ansible playbook feature. Change-Id: I412c2bd6cb390d00d1b9d0e4630e75776edabbb9
66 lines
1.3 KiB
Puppet
66 lines
1.3 KiB
Puppet
# == Class: ansible
|
|
#
|
|
class ansible (
|
|
$ansible_hostfile = '/usr/local/bin/puppet-inventory'
|
|
) {
|
|
|
|
include logrotate
|
|
include pip
|
|
|
|
package { 'ansible':
|
|
ensure => latest,
|
|
provider => pip,
|
|
}
|
|
|
|
if ! defined(File['/etc/ansible']) {
|
|
file { '/etc/ansible':
|
|
ensure => directory,
|
|
}
|
|
}
|
|
|
|
file { '/etc/ansible/ansible.cfg':
|
|
ensure => present,
|
|
mode => '0644',
|
|
owner => 'root',
|
|
group => 'root',
|
|
content => template('ansible/ansible.cfg.erb'),
|
|
require => File['/etc/ansible'],
|
|
}
|
|
|
|
file { '/usr/local/bin/puppet-inventory':
|
|
ensure => present,
|
|
mode => '0755',
|
|
owner => 'root',
|
|
group => 'root',
|
|
source => 'puppet:///modules/ansible/puppet-inventory',
|
|
}
|
|
|
|
file { '/etc/ansible/roles':
|
|
ensure => directory,
|
|
recurse => true,
|
|
source => 'puppet:///modules/ansible/roles',
|
|
require => File['/etc/ansible'],
|
|
}
|
|
|
|
file { '/etc/ansible/library':
|
|
ensure => directory,
|
|
recurse => true,
|
|
source => 'puppet:///modules/ansible/library',
|
|
require => File['/etc/ansible'],
|
|
}
|
|
|
|
include logrotate
|
|
logrotate::file { 'ansible':
|
|
log => '/var/log/ansible.log',
|
|
options => [
|
|
'compress',
|
|
'copytruncate',
|
|
'missingok',
|
|
'rotate 7',
|
|
'daily',
|
|
'notifempty',
|
|
],
|
|
}
|
|
|
|
}
|