
Instead of a shell script looping over ssh calls, use a simple ansible playbook. The benefit this gets is that we can then also script ad-hoc admin tasks either via playbooks or on the command line. We can also then get rid of the almost entirely unused salt infrastructure. Change-Id: I53112bd1f61d94c0521a32016c8a47c8cf9e50f7
54 lines
1012 B
Puppet
54 lines
1012 B
Puppet
# == Class: ansible
|
|
#
|
|
class ansible {
|
|
|
|
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,
|
|
source => 'puppet:///modules/ansible/ansible.cfg',
|
|
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'],
|
|
}
|
|
|
|
include logrotate
|
|
logrotate::file { 'ansible':
|
|
log => '/var/log/ansible.log',
|
|
options => [
|
|
'compress',
|
|
'copytruncate',
|
|
'missingok',
|
|
'rotate 7',
|
|
'daily',
|
|
'notifempty',
|
|
],
|
|
}
|
|
|
|
}
|