Skip to content

Commit

Permalink
Merge pull request #123 from voxpupuli/no-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
smortex authored Jul 12, 2021
2 parents f7cae0f + 6affcec commit 02bedc0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 71 deletions.
65 changes: 14 additions & 51 deletions manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,66 +1,29 @@
# @summary Configures chrony
#
# @api private
class chrony::config (
$bindaddress = $chrony::bindaddress,
$bindcmdaddress = $chrony::bindcmdaddress,
$chrony_password = $chrony::chrony_password,
$clientlog = $chrony::clientlog,
$clientloglimit = $chrony::clientloglimit,
$cmdacl = $chrony::cmdacl,
$cmdport = $chrony::cmdport,
$commandkey = $chrony::commandkey,
$config = $chrony::config,
$config_keys = $chrony::config_keys,
$config_keys_group = $chrony::config_keys_group,
$config_keys_manage = $chrony::config_keys_manage,
$config_keys_mode = $chrony::config_keys_mode,
$config_keys_owner = $chrony::config_keys_owner,
$config_keys_template = $chrony::config_keys_template,
$config_template = $chrony::config_template,
$keys = $chrony::keys,
$initstepslew = $chrony::initstepslew,
$leapsecmode = $chrony::leapsecmode,
$leapsectz = $chrony::leapsectz,
$local_stratum = $chrony::local_stratum,
$lock_all = $chrony::lock_all,
$log_options = $chrony::log_options,
$mailonchange = $chrony::mailonchange,
$makestep_seconds = $chrony::makestep_seconds,
$makestep_updates = $chrony::makestep_updates,
$maxslewrate = $chrony::maxslewrate,
$maxupdateskew = $chrony::maxupdateskew,
$peers = $chrony::peers,
$pools = $chrony::pools,
$port = $chrony::port,
$queryhosts = $chrony::queryhosts,
$refclocks = $chrony::refclocks,
$rtconutc = $chrony::rtconutc,
$servers = $chrony::servers,
$smoothtime = $chrony::smoothtime,
$stratumweight = $chrony::stratumweight,
$threshold = $chrony::threshold,
) {
file { $config:
class chrony::config {
assert_private()

file { $chrony::config:
ensure => file,
owner => 0,
group => 0,
mode => '0644',
content => epp($config_template,
content => epp($chrony::config_template,
{
servers => chrony::server_array_to_hash($servers, ['iburst']),
pools => chrony::server_array_to_hash($pools, ['iburst']),
peers => chrony::server_array_to_hash($peers),
servers => chrony::server_array_to_hash($chrony::servers, ['iburst']),
pools => chrony::server_array_to_hash($chrony::pools, ['iburst']),
peers => chrony::server_array_to_hash($chrony::peers),
}
),
}

file { $config_keys:
file { $chrony::config_keys:
ensure => file,
replace => $config_keys_manage,
owner => $config_keys_owner,
group => $config_keys_group,
mode => $config_keys_mode,
content => Sensitive(epp($config_keys_template)),
replace => $chrony::config_keys_manage,
owner => $chrony::config_keys_owner,
group => $chrony::config_keys_group,
mode => $chrony::config_keys_mode,
content => Sensitive(epp($chrony::config_keys_template)),
}
}
17 changes: 7 additions & 10 deletions manifests/install.pp
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# @summary Installs chrony
#
# @api private
class chrony::install (
$package_ensure = $chrony::package_ensure,
$package_name = $chrony::package_name,
$package_source = $chrony::package_source,
$package_provider = $chrony::package_provider,
) {
class chrony::install {
assert_private()

package { 'chrony':
ensure => $package_ensure,
name => $package_name,
source => $package_source,
provider => $package_provider,
ensure => $chrony::package_ensure,
name => $chrony::package_name,
source => $chrony::package_source,
provider => $chrony::package_provider,
}
}
17 changes: 7 additions & 10 deletions manifests/service.pp
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# @summary Manages the chrony service
#
# @api private
class chrony::service (
$service_enable = $chrony::service_enable,
$service_ensure = $chrony::service_ensure,
$service_manage = $chrony::service_manage,
$service_name = $chrony::service_name,
) {
if $service_manage {
service { $service_name:
ensure => $service_ensure,
enable => $service_enable,
class chrony::service {
assert_private()

if $chrony::service_manage {
service { $chrony::service_name:
ensure => $chrony::service_ensure,
enable => $chrony::service_enable,
}
}
}

0 comments on commit 02bedc0

Please sign in to comment.