Puppet Class: foreman::service

Defined in:
manifests/service.pp

Summary

Configure the foreman service

Overview

Parameters:

  • apache (Boolean) (defaults to: $foreman::apache)
  • ssl (Boolean) (defaults to: $foreman::ssl)
  • foreman_service (String[1]) (defaults to: $foreman::foreman_service)
  • foreman_service_ensure (Stdlib::Ensure::Service) (defaults to: 'running')
  • foreman_service_enable (Boolean) (defaults to: true)
  • dynflow_manage_services (Boolean) (defaults to: $foreman::dynflow_manage_services)
  • dynflow_orchestrator_ensure (Enum['present', 'absent']) (defaults to: $foreman::dynflow_orchestrator_ensure)
  • dynflow_worker_instances (Integer[0]) (defaults to: $foreman::dynflow_worker_instances)
  • dynflow_worker_concurrency (Integer[0]) (defaults to: $foreman::dynflow_worker_concurrency)


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'manifests/service.pp', line 3

class foreman::service (
  Boolean $apache = $foreman::apache,
  Boolean $ssl = $foreman::ssl,
  String[1] $foreman_service = $foreman::foreman_service,
  Stdlib::Ensure::Service $foreman_service_ensure = 'running',
  Boolean $foreman_service_enable = true,
  Boolean $dynflow_manage_services = $foreman::dynflow_manage_services,
  Enum['present', 'absent'] $dynflow_orchestrator_ensure = $foreman::dynflow_orchestrator_ensure,
  Integer[0] $dynflow_worker_instances = $foreman::dynflow_worker_instances,
  Integer[0] $dynflow_worker_concurrency = $foreman::dynflow_worker_concurrency,
) {
  if $dynflow_manage_services {
    foreman::dynflow::worker { 'orchestrator':
      ensure      => $dynflow_orchestrator_ensure,
      concurrency => 1,
      queues      => ['dynflow_orchestrator'],
    }

    foreman::dynflow::pool { 'worker':
      queues      => [['default', 1], ['remote_execution', 1]],
      instances   => $dynflow_worker_instances,
      concurrency => $dynflow_worker_concurrency,
    }
  }

  if $apache {
    Class['apache::service'] -> Class['foreman::service']

    # Ensure SSL certs from the puppetmaster are available
    # Relationship is duplicated there as defined() is parse-order dependent
    if $ssl and defined(Class['puppet::server::config']) {
      Class['puppet::server::config'] -> Class['foreman::service']
    }
  }

  service { "${foreman_service}.socket":
    ensure => $foreman_service_ensure,
    enable => $foreman_service_enable,
  }

  service { $foreman_service:
    ensure => $foreman_service_ensure,
    enable => $foreman_service_enable,
    before => Service["${foreman_service}.socket"],
  }
}