puppet-prod/site/profiles/manifests/puppet/enc.pp
Ben Vincent 8745c6bcb8
All checks were successful
Build / precommit (pull_request) Successful in 3m31s
fix: resolve warnings/errors
- modules/libs/lib/facter/pve_nodelist.rb:11:5: W: [Correctable] Lint/RedundantCopDisableDirective: Unnecessary disabling of Metrics/BlockNesting.a
- site/profiles/manifests/puppet/puppetboard.pp - WARNING: there should be a single space before '=>' on line 158, column 14 on line 158 (check: space_before_arrow)
- site/profiles/manifests/consul/client.pp - WARNING: there should be a single space before '=>' on line 93, column 13 on line 93 (check: space_before_arrow)
- site/profiles/manifests/ntp/client.pp - WARNING: there should be a single space before '=>' on line 44, column 16 on line 44 (check: space_before_arrow)
- site/profiles/manifests/puppet/enc.pp - WARNING: there should be a single space before '=>' on line 14, column 11 on line 14 (check: space_before_arrow)
- site/profiles/manifests/puppet/enc.pp - WARNING: there should be a single space before '=>' on line 18, column 11 on line 18 (check: space_before_arrow)

- set max block nesting to 4
2025-07-08 20:06:50 +10:00

50 lines
1.1 KiB
Puppet

# Class: profiles::puppet::enc
#
# This class manages a Git repository at /opt/puppetlabs/enc. It includes a
# systemd service and timer to keep the repository updated every minute.
# The Git package is installed if not present, and the repository at the given
# location will always reflect the state of the remote Git repository.
class profiles::puppet::enc (
String $repo,
String $release = 'master',
Boolean $force = false,
) {
file { '/opt/puppetlabs/bin/enc':
ensure => absent,
}
file { '/opt/puppetlabs/bin/puppet-enc':
ensure => absent,
}
$_timer = @(EOT)
[Unit]
Description=puppet-enc downloader timer
[Timer]
OnCalendar=*:0/1
RandomizedDelaySec=1s
[Install]
WantedBy=timers.target
EOT
$_service = @(EOT)
[Unit]
Description=puppet-enc downloader service
[Service]
Type=oneshot
ExecStart=/opt/puppetlabs/bin/puppet-enc
User=root
Group=root
PermissionsStartOnly=false
PrivateTmp=no
EOT
systemd::timer { 'puppet-enc.timer':
timer_content => $_timer,
service_content => $_service,
active => false,
enable => false,
}
}