system-config/modules/salt/manifests/master.pp
Dan Prince 926bf44fe6 RHEL support for salt.
Updates to the salt modules so that they run on RHEL.

Change-Id: Ibdbc35594a018a7f49f3785d527e5c1a71a92a2e
Reviewed-on: https://review.openstack.org/23188
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Khai Do <zaro0508@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2013-03-04 17:59:29 +00:00

72 lines
1.4 KiB
Puppet

# Class salt::master
#
class salt::master {
if ($::operatingsystem == 'Ubuntu') {
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,
}
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'],
}
service { 'salt-master':
ensure => running,
enable => true,
require => [
User['salt'],
File['/etc/salt/master'],
],
subscribe => [
Package['salt-master'],
File['/etc/salt/master'],
],
}
}