system-config/playbooks/roles/mirror-update/tasks/main.yaml
Ian Wienand 6ee7a5a116 mirror-update/reprepro : use common functions
This converts the reprepro mirror script to use the common functions
for timestamps and vos release.  This function ssh's to the AFS server
and runs vos release directly there, avoiding many issues with
kerberos timeouts.  This has been working successfully for the rsync
mirrors.  This will also send stats back so we can keep an eye on the
timing.

Change-Id: I1be29f2d9ecaad03b22c87819e5ae8d16c4f177e
2020-10-28 16:55:02 +11:00

70 lines
1.5 KiB
YAML

# NOTE(ianw) : this does not feel like a a great way to write out
# binary data. But you can't do what you'd logically think at first
# with like
#
# copy:
# content: {{ string | b64decode }}
#
# because jinja treats the content as utf-8, and ends up mangling
# "real" binary data like a keytab. See issues like:
# https://github.com/ansible/ansible/issues/20150
- name: Install afsadmin keytab
shell: 'echo "{{ mirror_update_keytab_afsadmin }}" | base64 -d > /etc/afsadmin.keytab'
args:
creates: /etc/afsadmin.keytab
no_log: True
- name: Ensure permissions on afsadmin keytab
file:
path: '/etc/afsadmin.keytab'
owner: root
group: root
mode: '0400'
- name: Set PATH for cron
cron:
name: PATH
env: yes
value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- name: Create common function dir
file:
path: /usr/share/mirror-update
state: directory
owner: root
group: root
mode: '0755'
- name: Copy in common functions
copy:
src: 'functions.sh'
dest: '/usr/share/mirror-update'
owner: root
group: root
mode: '0644'
- name: Set cron flag to enable reporting stats
cron:
name: UNDER_CRON
env: yes
job: '1'
- name: Setup log publisher script
include_tasks: log_publish.yaml
- name: Setup rsync mirror scripts
include_tasks: rsync.yaml
- name: Setup reprepro
include_role:
name: reprepro
- name: Setup periodic AFS release script
include_role:
name: afs-release
- name: Setup AFS monitoring script
include_role:
name: afsmon