puppet-prod/site/profiles/manifests/puppet/enc.pp
Ben Vincent 40c57ede59 feat: add ci build task (#342)
- a ci workflow for build tests
- run pre-commit against all files

Reviewed-on: #342
2025-07-08 20:19:36 +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,
}
}