b48c3bc49b
* launch/README: Mention adding yourself to the salt group. * modules/salt/manifests/master.pp: Loosen directory permissions minimally as needed for salt group members to be able to run the launch script without being root. Change-Id: I4e462fe2efabe2200a635c79e4b7a1314bf174a3 Reviewed-on: https://review.openstack.org/27562 Reviewed-by: Jesse Keating <jesse.keating@rackspace.com> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: Monty Taylor <mordred@inaugust.com> Approved: James E. Blair <corvus@inaugust.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
100 lines
1.9 KiB
Puppet
100 lines
1.9 KiB
Puppet
# Class salt::master
|
|
#
|
|
class salt::master {
|
|
|
|
if ($::osfamily == 'Debian') {
|
|
include apt
|
|
|
|
# Wrap in ! defined checks to allow minion and master installs on the
|
|
# same host.
|
|
if ! defined(Apt::Ppa['ppa:saltstack/salt']) {
|
|
apt::ppa { 'ppa:saltstack/salt': }
|
|
}
|
|
|
|
if ! defined(Package['python-software-properties']) {
|
|
package { 'python-software-properties':
|
|
ensure => present,
|
|
}
|
|
}
|
|
|
|
Apt::Ppa['ppa:saltstack/salt'] -> Package['salt-master']
|
|
|
|
}
|
|
|
|
package { 'salt-master':
|
|
ensure => present
|
|
}
|
|
|
|
group { 'salt':
|
|
ensure => present,
|
|
system => true,
|
|
}
|
|
|
|
user { 'salt':
|
|
ensure => present,
|
|
gid => 'salt',
|
|
home => '/home/salt',
|
|
shell => '/bin/bash',
|
|
system => true,
|
|
require => Group['salt'],
|
|
}
|
|
|
|
file { '/home/salt':
|
|
ensure => directory,
|
|
owner => 'salt',
|
|
group => 'salt',
|
|
mode => '0755',
|
|
require => User['salt'],
|
|
}
|
|
|
|
file { '/etc/salt/master':
|
|
ensure => present,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
content => template('salt/master.erb'),
|
|
replace => true,
|
|
require => Package['salt-master'],
|
|
}
|
|
|
|
file { '/etc/salt/pki':
|
|
ensure => directory,
|
|
owner => 'salt',
|
|
group => 'salt',
|
|
mode => '0710',
|
|
require => [
|
|
Package['salt-master'],
|
|
User['salt'],
|
|
],
|
|
}
|
|
|
|
file { '/etc/salt/pki/master':
|
|
ensure => directory,
|
|
owner => 'salt',
|
|
group => 'salt',
|
|
mode => '0770',
|
|
require => File['/etc/salt/pki'],
|
|
}
|
|
|
|
file { '/etc/salt/pki/master/minions':
|
|
ensure => directory,
|
|
owner => 'salt',
|
|
group => 'salt',
|
|
mode => '0775',
|
|
require => File['/etc/salt/pki/master'],
|
|
}
|
|
|
|
service { 'salt-master':
|
|
ensure => running,
|
|
enable => true,
|
|
require => [
|
|
User['salt'],
|
|
File['/etc/salt/master'],
|
|
],
|
|
subscribe => [
|
|
Package['salt-master'],
|
|
File['/etc/salt/master'],
|
|
],
|
|
}
|
|
}
|