system-config/playbooks/roles/mirror-update/tasks/main.yaml
Ian Wienand 3eceba5749 reprepro: convert to Ansible
This converts the reprepro configuration from our existing puppet to
Ansible.

This takes a more direct approach; the templating done by the puppet
version started simple but over the years grew several different
options to handle various use-cases.  This means you not only had to
understand the rather obscure reprepro configuration, but then *also*
figure out how to translate that from our puppet template layers.

Here the configuration files are kept directly (they were copied from
the existing mirror-update.openstack.org) and deployed with some light
wrapper tasks in reprepro/tasks/utils which avoids most duplication.

Note the initial cron jobs are left disabled so we can run some manual
testing before letting it go automatically.

Change-Id: I96a9ff1efbf51c4164621028b7a3a1e2e1077d5c
2020-10-19 14:06:57 +11:00

48 lines
1.1 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: 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