reprepo: enable cron jobs

Enable the Ansible based cron jobs, and disable the puppet host
versions to cut over the mirroring to the new server.

Change-Id: I0ffb1c484e64e67f5a5017dc3c3c8ebcdc3845c8
This commit is contained in:
Ian Wienand 2020-10-28 09:15:20 +11:00
parent 2ff0843b9e
commit 10b2cd5fed
2 changed files with 14 additions and 3 deletions

View File

@ -1,5 +1,9 @@
# == Class: openstack_project::mirror_update # == Class: openstack_project::mirror_update
# #
# NOTE(ianw) : 2020-10-28 all cron jobs disabled
# as mirroring has moved to the mirror-update.opendev.org server
# managed by ansible.
#
class openstack_project::mirror_update ( class openstack_project::mirror_update (
$reprepro_keytab = '', $reprepro_keytab = '',
$admin_keytab = '', $admin_keytab = '',
@ -66,6 +70,7 @@ class openstack_project::mirror_update (
} }
cron { 'reprepro debian': cron { 'reprepro debian':
ensure => absent,
user => 'root', user => 'root',
hour => '*/2', hour => '*/2',
minute => fqdn_rand(45, 'reprepro-debian'), minute => fqdn_rand(45, 'reprepro-debian'),
@ -120,6 +125,7 @@ class openstack_project::mirror_update (
} }
cron { 'reprepro debian security': cron { 'reprepro debian security':
ensure => absent,
user => 'root', user => 'root',
hour => '*/2', hour => '*/2',
minute => fqdn_rand(45, 'reprepro-debian-security'), minute => fqdn_rand(45, 'reprepro-debian-security'),
@ -158,6 +164,7 @@ class openstack_project::mirror_update (
} }
cron { 'reprepro ubuntu': cron { 'reprepro ubuntu':
ensure => absent,
user => 'root', user => 'root',
hour => '*/2', hour => '*/2',
minute => fqdn_rand(45, 'reprepro-ubuntu'), minute => fqdn_rand(45, 'reprepro-ubuntu'),
@ -180,6 +187,7 @@ class openstack_project::mirror_update (
} }
cron { 'reprepro ubuntu-ports': cron { 'reprepro ubuntu-ports':
ensure => absent,
user => 'root', user => 'root',
hour => '*/2', hour => '*/2',
minute => fqdn_rand(45, 'reprepro-ubuntu-ports'), minute => fqdn_rand(45, 'reprepro-ubuntu-ports'),
@ -218,6 +226,7 @@ class openstack_project::mirror_update (
} }
cron { 'reprepro debian ceph nautilus': cron { 'reprepro debian ceph nautilus':
ensure => absent,
user => 'root', user => 'root',
hour => '*/2', hour => '*/2',
minute => fqdn_rand(45, 'debian-ceph-nautilus'), minute => fqdn_rand(45, 'debian-ceph-nautilus'),
@ -240,6 +249,7 @@ class openstack_project::mirror_update (
} }
cron { 'reprepro debian ceph octopus': cron { 'reprepro debian ceph octopus':
ensure => absent,
user => 'root', user => 'root',
hour => '*/2', hour => '*/2',
minute => fqdn_rand(45, 'debian-ceph-octopus'), minute => fqdn_rand(45, 'debian-ceph-octopus'),
@ -292,6 +302,7 @@ class openstack_project::mirror_update (
} }
cron { 'reprepro debian docker': cron { 'reprepro debian docker':
ensure => absent,
user => 'root', user => 'root',
hour => '*/2', hour => '*/2',
minute => fqdn_rand(45, 'debian-docker'), minute => fqdn_rand(45, 'debian-docker'),
@ -328,6 +339,7 @@ class openstack_project::mirror_update (
} }
cron { 'reprepro ubuntu puppetlabs': cron { 'reprepro ubuntu puppetlabs':
ensure => absent,
user => 'root', user => 'root',
hour => '*/2', hour => '*/2',
minute => fqdn_rand(45, 'ubuntu-puppetlabs'), minute => fqdn_rand(45, 'ubuntu-puppetlabs'),
@ -389,6 +401,7 @@ class openstack_project::mirror_update (
} }
cron { 'reprepro ubuntu-cloud-archive': cron { 'reprepro ubuntu-cloud-archive':
ensure => absent,
user => 'root', user => 'root',
hour => '*/2', hour => '*/2',
minute => fqdn_rand(45, 'ubuntu-cloud-archive-mirror'), minute => fqdn_rand(45, 'ubuntu-cloud-archive-mirror'),

View File

@ -1,9 +1,7 @@
- name: Install update cron jobs - name: Install update cron jobs
cron: cron:
name: '{{ _string_name }} reprepro mirror sync' name: '{{ _string_name }} reprepro mirror sync'
# NOTE(ianw) 2020-10-19 : initially disabled so we can try state: present
# manually before we enable everything.
state: absent
job: 'flock -n /var/run/reprepro/{{ _dir }}.lock reprepro-mirror-update {{ _dir }} {{ _volume }} >> /var/log/reprepro/{{ _dir }}.log 2>&1' job: 'flock -n /var/run/reprepro/{{ _dir }}.lock reprepro-mirror-update {{ _dir }} {{ _volume }} >> /var/log/reprepro/{{ _dir }}.log 2>&1'
hour: '*/2' hour: '*/2'
minute: '{{ 45 | random(seed=inventory_hostname) }}' minute: '{{ 45 | random(seed=inventory_hostname) }}'