Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter to manage puppetmaster service status #171

Open
wants to merge 4 commits into
base: production
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add service ensure option to puppet master
  • Loading branch information
Jordi Garcia committed May 3, 2018
commit c4e9293c8e9fa6235fbd6080d3494e654977c68a
3 changes: 3 additions & 0 deletions manifests/master.pp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
# Specifies minute to run the report clean cronjob
# @param report_clean_weekday ([String] Default: '0')
# Specifies weekday to run the report clean cronjob
# @param service_ensure [String] Default: 'running'
# Specifies if the Puppet Master service should be running or stopped
# @param server_type ([String] Default Puppet 4: 'puppetserver' Default Puppet 4: 'passenger')
# Specifies the type of server to use puppetserver is always used on Puppet 4
# @param $external_nodes ([String] Default undef)
Expand Down Expand Up @@ -125,6 +127,7 @@
$report_clean_min = '22',
$report_clean_hour = '21',
$report_clean_weekday = '0',
$service_ensure = 'running',
$server_type = $::puppet::defaults::server_type,
$server_version = 'installed',
$external_nodes = undef,
Expand Down
1 change: 1 addition & 0 deletions manifests/master/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
$report_clean_weekday = $puppet::master::report_clean_weekday
$external_nodes = $puppet::master::external_nodes
$node_terminus = $puppet::master::node_terminus
$service_ensure = $puppet::master::service_ensure

if ($ca_server != undef) {
if ($ca_server == $::fqdn) {
Expand Down
7 changes: 4 additions & 3 deletions manifests/master/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
class puppet::master::server {
include ::puppet::master
include ::puppet::defaults
$sysconfigdir = $::puppet::defaults::sysconfigdir
$java_ram = $::puppet::master::java_ram
$sysconfigdir = $::puppet::defaults::sysconfigdir
$java_ram = $::puppet::master::java_ram
$service_ensure = $::puppet::master::service_ensure

ini_subsetting { 'puppet server Xmx java_ram':
ensure => present,
Expand All @@ -29,7 +30,7 @@
}

service { 'puppetserver':
ensure => 'running',
ensure => $service_ensure,
enable => true,
require => Class[puppet::master::config],
subscribe => [
Expand Down
4 changes: 4 additions & 0 deletions manifests/profile/master.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
# @param java_ram ([String] Default: '2g')
# Set the ram to use for the new puppetserver
# @param manage_deep_merge_package ([Boolean] Default: false)
# @param service_ensure [String] Default: 'running'
# Specifies if the Puppet Master service should be running or stopped
# Whether the [deep_merge gem](https://rubygems.org/gems/deep_merge) should be installed.
# @param manage_hiera_eyaml_package ([Boolean] Default: true)
# Whether the [hiera-eyaml gem](https://rubygems.org/gems/hiera-eyaml) should be installed.
Expand Down Expand Up @@ -146,6 +148,7 @@
$passenger_stat_throttle_rate = '120',
$puppet_fqdn = $::fqdn,
$puppet_version = 'installed',
$service_ensure = 'running',
$server_type = undef,
$server_version = 'installed',
$external_nodes = undef,
Expand Down Expand Up @@ -197,6 +200,7 @@
passenger_pool_idle_time => $passenger_pool_idle_time,
passenger_stat_throttle_rate => $passenger_stat_throttle_rate,
puppet_fqdn => $puppet_fqdn,
service_ensure => $service_ensure,
server_version => $server_version,
external_nodes => $external_nodes,
node_terminus => $node_terminus,
Expand Down