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
This commit is contained in:
Matthew Treinish 2017-04-28 18:18:16 -04:00
parent 0a05c670c3
commit 492bf12e80
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
2 changed files with 14 additions and 6 deletions

View File

@ -1,12 +1,13 @@
# == Class: ansible
#
class ansible (
$ansible_hostfile = '/etc/ansible/hosts',
$ansible_roles_path = '/etc/ansible/roles',
$ansible_version = '2.0.2.0',
$ansible_source = undef,
$retry_files_enabled = undef,
$retry_files_save_path = undef,
$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
@ -23,6 +24,12 @@ class 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,

View File

@ -2,6 +2,7 @@
hostfile=<%= @ansible_hostfile %>
library=/usr/share/ansible
log_path=/var/log/ansible.log
callback_plugins=<%= @ansible_callback_plugins_path %>
roles_path=<%= @ansible_roles_path %>
<% if @retry_files_enabled != :undef -%>
retry_files_enabled=<%= @retry_files_enabled %>