Puppet Class: r10k::mcollective

Inherits:
r10k::params
Defined in:
manifests/mcollective.pp

Overview

Install the r10k mcollective agent

Parameters:

  • ensure (Any) (defaults to: true)
  • agent_name (Any) (defaults to: $r10k::params::mc_agent_name)
  • app_name (Any) (defaults to: $r10k::params::mc_app_name)
  • agent_ddl (Any) (defaults to: $r10k::params::mc_agent_ddl_name)
  • agent_path (Any) (defaults to: $r10k::params::mc_agent_path)
  • app_path (Any) (defaults to: $r10k::params::mc_application_path)
  • mc_service (Any) (defaults to: $r10k::params::mc_service_name)
  • http_proxy (Any) (defaults to: $r10k::params::mc_http_proxy)
  • git_ssl_no_verify (Any) (defaults to: $r10k::params::mc_git_ssl_no_verify)
  • root_user (Any) (defaults to: $r10k::params::root_user)
  • root_group (Any) (defaults to: $r10k::params::root_group)


2
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
49
50
51
52
# File 'manifests/mcollective.pp', line 2

class r10k::mcollective (
  $ensure            = true,
  $agent_name        = $r10k::params::mc_agent_name,
  $app_name          = $r10k::params::mc_app_name,
  $agent_ddl         = $r10k::params::mc_agent_ddl_name,
  $agent_path        = $r10k::params::mc_agent_path,
  $app_path          = $r10k::params::mc_application_path,
  $mc_service        = $r10k::params::mc_service_name,
  $http_proxy        = $r10k::params::mc_http_proxy,
  $git_ssl_no_verify = $r10k::params::mc_git_ssl_no_verify,
  $root_user         = $r10k::params::root_user,
  $root_group        = $r10k::params::root_group,
) inherits r10k::params {
  $ensure_file = $ensure ? {
    true  => 'file',
    false => 'absent',
  }

  File {
    ensure => $ensure_file,
    owner  => $root_user,
    group  => $root_group,
    mode   => '0644',
  }

  # Install the agent and its ddl file
  file { 'mcollective_agent_executable':
    path   => "${app_path}/${app_name}",
    source => "puppet:///modules/${module_name}/application/${agent_name}",
  }

  file { 'mcollective_agent_ddl':
    path   => "${agent_path}/${agent_ddl}",
    source => "puppet:///modules/${module_name}/agent/${agent_ddl}",
  }

  # Install the application file (all masters at the moment)
  file { 'mcollective_application_file':
    path    => "${agent_path}/${agent_name}",
    content => template("${module_name}/agent/${agent_name}.erb"),
    require => File["${agent_path}/${agent_ddl}"],
  }

  Service <| title == $mc_service |> {
    subscribe +> [
      File['mcollective_agent_executable'],
      File['mcollective_agent_ddl'],
      File['mcollective_application_file']
    ],
  }
}