Merge "Give Jenkins the ability to trigger puppet runs"

This commit is contained in:
Jenkins 2013-09-13 15:59:41 +00:00 committed by Gerrit Code Review
commit 5a37204bc3
5 changed files with 47 additions and 2 deletions

View File

@ -0,0 +1,2 @@
# Allow jenkins user to send Salt messages to the Salt Master
jenkins ALL=(ALL) NOPASSWD: /usr/bin/salt-call event.fire_master*

View File

@ -10,4 +10,13 @@ class openstack_project::salt_trigger_slave (
jenkins_ssh_public_key => $jenkins_ssh_public_key,
}
file { '/etc/sudoers.d/salt-trigger':
ensure => present,
owner => 'root',
group => 'root',
mode => '0440',
source => 'puppet:///modules/openstack_project/salt-trigger.sudoers',
replace => true,
}
}

View File

@ -49,14 +49,38 @@ class salt::master {
file { '/etc/salt/master':
ensure => present,
owner => 'root',
group => 'root',
owner => 'salt',
group => 'salt',
mode => '0644',
content => template('salt/master.erb'),
replace => true,
require => Package['salt-master'],
}
file { '/srv/reactor':
ensure => directory,
owner => 'salt',
group => 'salt',
mode => '0755',
require => [
Package['salt-master'],
User['salt'],
],
}
file { '/srv/reactor/tests.sls':
ensure => present,
owner => 'salt',
group => 'salt',
mode => '0644',
content => template('salt/tests.reactor.erb'),
replace => true,
require => [
Package['salt-master'],
File['/srv/reactor'],
],
}
file { '/etc/salt/pki':
ensure => directory,
owner => 'salt',

View File

@ -344,3 +344,10 @@ user: salt
# The range server (and optional port) that
# serves your cluster information
#range_server: range:80
##### Salt Reactor settings #####
#########################################
# Execute tests.sls when 'jenkins' tag found
reactor:
- 'jenkins':
- /srv/reactor/tests.sls

View File

@ -0,0 +1,3 @@
puppet_run:
cmd.puppet.run:
- tgt: '*'