Skip to content

Commit cd1d356

Browse files
committed
chore: move common system subclasses to common file
Signed-off-by: Sidharth Jawale <sidharth@obmondo.com>
1 parent 55c5913 commit cd1d356

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

modules/enableit/common/data/common.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,22 @@ common::default::classes:
159159
- common::monitoring
160160
- common::hosts
161161

162+
common::system::classes:
163+
- common::system::authentication
164+
- common::system::dns
165+
- common::system::kernel
166+
- common::system::grub
167+
- common::system::failover
168+
- common::system::hardware
169+
- common::system::limits
170+
- common::system::package_management
171+
- common::system::motd
172+
- common::system::nsswitch
173+
- common::system::sshd
174+
- common::system::time
175+
- common::system::cloud_init
176+
- common::system::selinux
177+
162178
## System Settings
163179
common::system::systemd::manage_journald: false
164180
common::system::systemd::manage_resolved: false

modules/enableit/common/manifests/system.pp

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
Hash[String,Hash] $files = {},
3636
Optional[Boolean] $disable_ipv6 = undef,
3737
Optional[Hash[String, Struct[{
38-
content => Stdlib::Base64,
39-
}]]] $service_oneshot = {},
38+
content => Stdlib::Base64,
39+
}]]] $service_oneshot = undef,
4040

4141
Hash[String, Array[Stdlib::IP::Address::V4]] $locations = {},
4242
Eit_types::Encrypt::Params $encrypt_params = ['ssh_authorized_keys.*.key'],
@@ -167,7 +167,7 @@
167167
$_source = $_file_parameters['source']
168168
# Only allow sources that the Obmondo file resource pattern
169169
if $_source and $_source !~ Eit_Files::Source {
170-
fail("Invalid file resource
170+
fail("Invalid file resource
171171
${_element}")
172172
}
173173

@@ -180,7 +180,7 @@
180180
# Service_Oneshot
181181
#################
182182

183-
$service_oneshot.each |$name, $value| {
183+
$service_oneshot.lest || {{} }.each |$name, $value| {
184184
profile::system::service_oneshot { $name:
185185
content => $value['content'],
186186
}
@@ -215,8 +215,8 @@
215215
$_obmondo_system_facts = {
216216
'obmondo_system' => {
217217
'location' => $_location,
218-
'certname' => $facts['networking']['hostname']
219-
}
218+
'certname' => $facts['networking']['hostname'],
219+
},
220220
}
221221

222222
file { "${_puppet_dir}/facter/facts.d/obmondo_system.yaml":
@@ -234,22 +234,8 @@
234234

235235
# NOTE: includes all these system profile, but some are set to enable
236236
# and some set to disable, depending on the requirement.
237-
include common::system::authentication
238-
include common::system::dns
239-
include common::system::kernel
240-
include common::system::grub
241-
include common::system::failover
242-
include common::system::hardware
243-
include common::system::limits
244-
include common::system::package_management
245-
include common::system::motd
246-
include common::system::nsswitch
247-
include common::system::sshd
248-
include common::system::time
249-
include common::system::cloud_init
250-
include common::system::selinux
251-
if $::subscription {
252-
include common::system::updates
237+
lookup('common::system::classes').each | $subclass | {
238+
include $subclass
253239
}
254240

255241
unless lookup('common::system::jumphost::configs', Hash, undef, {}).empty {

0 commit comments

Comments
 (0)