
This module has been split out from system-config, and additional files are added to create a proper puppet module. The spec: http://specs.openstack.org/openstack-infra/infra-specs/specs/puppet-modules.html Change-Id: I17aa1f7ec14b89c529efc0820d2d365856091384
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',
|
|
],
|
|
}
|
|
|
|
}
|