Puppet Class: confdroid_puppet::main::files

Inherits:
confdroid_puppet::params
Defined in:
manifests/main/files.pp

Summary

Class manages config files for the confdroid_puppet module.

Overview

confdroid_puppet::main::files.pp Module name: confdroid_puppet Author: Arne Teuke (arne_teuke@confdroid)



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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'manifests/main/files.pp', line 6

class confdroid_puppet::main::files (

) inherits confdroid_puppet::params {
  require confdroid_puppet::main::dirs

  if $fqdn != $pt_pm_fqdn {
    file { $pt_puppet_conf_file:
      ensure   => file,
      path     => $pt_puppet_conf_file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => puppet_etc_t,
      seluser  => system_u,
      content  => template($pt_puppet_conf_erb),
      notify   => Service[$pt_agent_service],
    }
    if $pt_use_puppetdb == true {
      file { $pt_node_rb_file:
        ensure  => file,
        owner   => 'root',
        group   => 'root',
        mode    => '0550',
        selrole => object_r,
        seltype => puppet_etc_t,
        seluser => system_u,
        content => template($pt_node_rb_erb),
      }
    }
    if $pt_use_puppetdb != true {
      file { $pt_node_rb_file:
        ensure => absent,
      }
    }
  }

  if $fqdn == $pt_pm_fqdn {
    file { $pt_puppet_conf_file:
      ensure   => file,
      path     => $pt_puppet_conf_file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => puppet_etc_t,
      seluser  => system_u,
      content  => template($pt_puppet_conf_erb),
      notify   => Service[$pt_agent_service,$pt_server_service],
    }

    if $pt_use_puppetdb == true {
      # puppetdb
      file { $pt_puppetdb_conf_file:
        ensure   => file,
        path     => $pt_puppetdb_conf_file,
        owner    => 'root',
        group    => 'root',
        mode     => '0644',
        selrange => s0,
        selrole  => object_r,
        seltype  => puppet_etc_t,
        seluser  => system_u,
        content  => template($pt_puppetdb_conf_erb),
        notify   => Service[$pt_agent_service,$pt_server_service],
      }
      # routes.yaml
      file { $pt_routes_file:
        ensure   => file,
        path     => $pt_routes_file,
        owner    => 'root',
        group    => 'root',
        mode     => '0644',
        selrange => s0,
        selrole  => object_r,
        seltype  => puppet_etc_t,
        seluser  => system_u,
        content  => template($pt_routes_erb),
        notify   => Service[$pt_server_service],
      }
      file { $pt_node_rb_file:
        ensure   => file,
        owner    => 'puppet',
        group    => 'puppet',
        mode     => '0550',
        selrange => s0,
        selrole  => object_r,
        seltype  => foreman_enc_t,
        seluser  => system_u,
        content  => template($pt_node_rb_erb),
      }
    }
    if $pt_use_puppetdb != true {
      file { $pt_puppetdb_conf_file:
        ensure => absent,
      }
      file { $pt_routes_file:
        ensure => absent,
      }
    }
  }
}