annotate modules/common/manifests/init.pp @ 388:750d36241580

Add missing dependency modules Probably required by SSH, but not obviously listed
author IBBoard <dev@ibboard.co.uk>
date Mon, 03 Jan 2022 17:15:14 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
388
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 # == Class: common
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 #
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 # This class is applied to *ALL* nodes
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 #
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 # === Copyright
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 #
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 # Copyright 2013 GH Solutions, LLC
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 #
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 class common (
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 $users = undef,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 $groups = undef,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 $manage_root_password = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 $root_password = '$1$cI5K51$dexSpdv6346YReZcK2H1k.', # puppet
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 $create_opt_lsb_provider_name_dir = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 $lsb_provider_name = 'UNSET',
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 $enable_dnsclient = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 $enable_hosts = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 $enable_inittab = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 $enable_mailaliases = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 $enable_motd = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 $enable_network = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22 $enable_nsswitch = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 $enable_ntp = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 $enable_pam = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25 $enable_puppet_agent = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26 $enable_rsyslog = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27 $enable_selinux = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 $enable_ssh = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 $enable_utils = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30 $enable_vim = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31 $enable_wget = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 # include classes based on osfamily fact
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33 $enable_debian = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 $enable_redhat = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 $enable_solaris = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
36 $enable_suse = false,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37 ) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
38
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
39 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
40 if is_string($enable_dnsclient) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
41 $dnsclient_enabled = str2bool($enable_dnsclient)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
42 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
43 $dnsclient_enabled = $enable_dnsclient
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
45 if $dnsclient_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
46 include ::dnsclient
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
50 if is_string($enable_hosts) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
51 $hosts_enabled = str2bool($enable_hosts)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
52 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
53 $hosts_enabled = $enable_hosts
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
54 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
55 if $hosts_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
56 include ::hosts
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
57 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
58
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
59 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
60 if is_string($enable_inittab) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
61 $inittab_enabled = str2bool($enable_inittab)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
62 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
63 $inittab_enabled = $enable_inittab
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
64 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
65 if $inittab_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
66 include ::inittab
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
67 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
68
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
69 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
70 if is_string($enable_mailaliases) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
71 $mailaliases_enabled = str2bool($enable_mailaliases)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
72 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
73 $mailaliases_enabled = $enable_mailaliases
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
74 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
75 if $mailaliases_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
76 include ::mailaliases
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
77 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
78
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
79 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
80 if is_string($enable_mailaliases) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
81 $motd_enabled = str2bool($enable_motd)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
82 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
83 $motd_enabled = $enable_motd
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
84 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
85 if $motd_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
86 include ::motd
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
87 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
88
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
89 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
90 if is_string($enable_network) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
91 $network_enabled = str2bool($enable_network)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
92 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
93 $network_enabled = $enable_network
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
94 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
95 if $network_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
96 include ::network
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
97 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
98
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
99 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
100 if is_string($enable_nsswitch) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
101 $nsswitch_enabled = str2bool($enable_nsswitch)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
102 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
103 $nsswitch_enabled = $enable_nsswitch
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
104 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
105 if $nsswitch_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
106 include ::nsswitch
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
107 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
108
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
109 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
110 if is_string($enable_ntp) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
111 $ntp_enabled = str2bool($enable_ntp)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
112 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
113 $ntp_enabled = $enable_ntp
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
114 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
115 if $ntp_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
116 include ::ntp
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
117 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
118
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
119 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
120 if is_string($enable_pam) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
121 $pam_enabled = str2bool($enable_pam)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
122 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
123 $pam_enabled = $enable_pam
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
124 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
125 if $pam_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
126 include ::pam
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
127 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
128
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
129 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
130 if is_string($enable_puppet_agent) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
131 $puppet_agent_enabled = str2bool($enable_puppet_agent)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
132 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
133 $puppet_agent_enabled = $enable_puppet_agent
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
134 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
135 if $puppet_agent_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
136 include ::puppet::agent
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
137 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
138
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
139 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
140 if is_string($enable_rsyslog) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
141 $rsyslog_enabled = str2bool($enable_rsyslog)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
142 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
143 $rsyslog_enabled = $enable_rsyslog
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
144 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
145 if $rsyslog_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
146 include ::rsyslog
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
147 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
148
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
149 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
150 if is_string($enable_selinux) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
151 $selinux_enabled = str2bool($enable_selinux)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
152 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
153 $selinux_enabled = $enable_selinux
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
154 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
155 if $selinux_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
156 include ::selinux
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
157 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
158
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
159 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
160 if is_string($enable_ssh) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
161 $ssh_enabled = str2bool($enable_ssh)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
162 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
163 $ssh_enabled = $enable_ssh
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
164 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
165 if $ssh_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
166 include ::ssh
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
167 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
168
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
169 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
170 if is_string($enable_utils) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
171 $utils_enabled = str2bool($enable_utils)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
172 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
173 $utils_enabled = $enable_utils
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
174 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
175 if $utils_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
176 include ::utils
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
177 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
178
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
179 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
180 if is_string($enable_vim) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
181 $vim_enabled = str2bool($enable_vim)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
182 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
183 $vim_enabled = $enable_vim
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
184 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
185 if $vim_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
186 include ::vim
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
187 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
188
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
189 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
190 if is_string($enable_wget) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
191 $wget_enabled = str2bool($enable_wget)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
192 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
193 $wget_enabled = $enable_wget
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
194 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
195 if $wget_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
196 include ::wget
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
197 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
198
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
199 # only allow supported OS's
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
200 case $::osfamily {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
201 'debian': {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
202 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
203 if is_string($enable_debian) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
204 $debian_enabled = str2bool($enable_debian)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
205 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
206 $debian_enabled = $enable_debian
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
207 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
208 if $debian_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
209 include ::debian
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
210 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
211 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
212 'redhat': {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
213 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
214 if is_string($enable_redhat) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
215 $redhat_enabled = str2bool($enable_redhat)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
216 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
217 $redhat_enabled = $enable_redhat
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
218 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
219 if $redhat_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
220 include ::redhat
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
221 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
222 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
223 'solaris': {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
224 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
225 if is_string($enable_solaris) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
226 $solaris_enabled = str2bool($enable_solaris)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
227 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
228 $solaris_enabled = $enable_solaris
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
229 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
230 if $solaris_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
231 include ::solaris
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
232 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
233 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
234 'suse': {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
235 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
236 if is_string($enable_suse) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
237 $suse_enabled = str2bool($enable_suse)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
238 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
239 $suse_enabled = $enable_suse
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
240 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
241 if $suse_enabled == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
242 include ::suse
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
243 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
244 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
245 default: {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
246 fail("Supported OS families are Debian, RedHat, Solaris, and Suse. Detected osfamily is ${::osfamily}.")
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
247 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
248 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
249
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
250 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
251 if is_string($manage_root_password) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
252 $manage_root_password_real = str2bool($manage_root_password)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
253 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
254 $manage_root_password_real = $manage_root_password
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
255 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
256
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
257 if $manage_root_password_real == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
258
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
259 # validate root_password - fail if not a string
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
260 if !is_string($root_password) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
261 fail('common::root_password is not a string.')
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
262 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
263
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
264 user { 'root':
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
265 password => $root_password,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
266 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
267 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
268
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
269 # validate type and convert string to boolean if necessary
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
270 if is_string($create_opt_lsb_provider_name_dir) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
271 $create_opt_lsb_provider_name_dir_real = str2bool($create_opt_lsb_provider_name_dir)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
272 } else {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
273 $create_opt_lsb_provider_name_dir_real = $create_opt_lsb_provider_name_dir
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
274 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
275
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
276 if $create_opt_lsb_provider_name_dir_real == true {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
277
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
278 # validate lsb_provider_name - fail if not a string
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
279 if !is_string($lsb_provider_name) {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
280 fail('common::lsb_provider_name is not a string.')
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
281 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
282
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
283 if $lsb_provider_name != 'UNSET' {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
284
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
285 # basic filesystem requirements
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
286 file { "/opt/${lsb_provider_name}":
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
287 ensure => directory,
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
288 owner => 'root',
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
289 group => 'root',
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
290 mode => '0755',
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
291 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
292 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
293 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
294
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
295 if $users != undef {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
296
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
297 # Create virtual user resources
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
298 create_resources('@common::mkuser',$common::users)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
299
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
300 # Collect all virtual users
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
301 Common::Mkuser <||> # lint:ignore:spaceship_operator_without_tag
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
302 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
303
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
304 if $groups != undef {
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
305
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
306 # Create virtual group resources
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
307 create_resources('@group',$common::groups)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
308
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
309 # Collect all virtual groups
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
310 Group <||> # lint:ignore:spaceship_operator_without_tag
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
311 }
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
312 }