Merge "Give Jenkins the ability to trigger puppet runs"
This commit is contained in:
commit
5a37204bc3
2
modules/openstack_project/files/salt-trigger.sudoers
Normal file
2
modules/openstack_project/files/salt-trigger.sudoers
Normal 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*
|
@ -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,
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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',
|
||||
|
@ -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
|
||||
|
3
modules/salt/templates/tests.reactor.erb
Normal file
3
modules/salt/templates/tests.reactor.erb
Normal file
@ -0,0 +1,3 @@
|
||||
puppet_run:
|
||||
cmd.puppet.run:
|
||||
- tgt: '*'
|
Loading…
Reference in New Issue
Block a user