# setup the autosyncer class profiles::reposync::autosyncer ( Stdlib::Absolutepath $basepath = '/shared/apps/packagerepo', ) { # Ensure the autosyncer script is present and executable file { '/usr/local/bin/autosyncer': ensure => 'file', owner => 'root', group => 'root', mode => '0755', content => template('profiles/reposync/autosyncer.erb'), require => Package['createrepo'], } # daily autosyncr service/timer $_timer = @(EOT) [Unit] Description=autosyncer timer [Timer] OnCalendar=*-*-* 03:00:00 RandomizedDelaySec=1s [Install] WantedBy=timers.target EOT $_service = @(EOT) [Unit] Description=autosyncer service [Service] Type=oneshot ExecStart=/usr/local/bin/autosyncer User=root Group=root PermissionsStartOnly=false PrivateTmp=no EOT systemd::timer { 'autosyncer.timer': timer_content => $_timer, service_content => $_service, active => true, enable => true, require => File['/usr/local/bin/autosyncer'], } }