Matthew Treinish 492bf12e80
Set an ansible callback directory
This commit adds the code to manage a ansible callback_plugins directory
and sets in the ansible.cfg. This will be used for adding our own
callback plugins.

Change-Id: I697a74a5dbd63e9a87913c96a3e9be93ee7860da
2017-04-28 18:30:16 -04:00

56 lines
1.3 KiB
Puppet

# == Class: ansible
#
class ansible (
$ansible_hostfile = '/etc/ansible/hosts',
$ansible_roles_path = '/etc/ansible/roles',
$ansible_callback_plugins_path = '/etc/ansible/callback_plugins',
$ansible_version = '2.0.2.0',
$ansible_source = undef,
$retry_files_enabled = undef,
$retry_files_save_path = undef,
) {
include ::logrotate
include ::pip
package { 'ansible':
ensure => $ansible_version,
source => $ansible_source,
provider => openstack_pip,
}
if ! defined(File['/etc/ansible']) {
file { '/etc/ansible':
ensure => directory,
}
}
if ! defined(File[$ansible_callback_plugins_path]) {
file {$ansible_callback_plugins_path:
ensure => directory,
require => File['/etc/ansible'],
}
}
file { '/etc/ansible/ansible.cfg':
ensure => present,
mode => '0644',
owner => 'root',
group => 'root',
content => template('ansible/ansible.cfg.erb'),
require => File['/etc/ansible'],
}
::logrotate::file { 'ansible':
log => '/var/log/ansible.log',
options => [
'compress',
'copytruncate',
'missingok',
'rotate 7',
'daily',
'notifempty',
],
}
}