Add zuul-registry crontab entry

This is so we can prune images regularly.

Change-Id: If1d34ac0a6c2eece92b854e6fe0bdf3602fbb02b
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2020-11-30 11:55:16 -05:00
parent d940e20ce1
commit 5be04429a4
3 changed files with 19 additions and 0 deletions

View File

@ -46,6 +46,12 @@ zuul_registry_file_ssl_key_mode: 0600
zuul_registry_file_ssl_key_owner: "{{ zuul_registry_user_name }}"
zuul_registry_file_ssl_key_src: etc/zuul-registry/ssl/cert.key
zuul_registry_file_crontab_dest: /etc/cron.d/zuul-registry
zuul_registry_file_crontab_group: root
zuul_registry_file_crontab_mode: 0644
zuul_registry_file_crontab_owner: root
zuul_registry_file_crontab_src: etc/cron.d/zuul-registry.j2
# tasks/install.yaml
zuul_registry_git_dest: "{{ ansible_user_dir }}/src/opendev.org/zuul/zuul-registry"
zuul_registry_git_uri: https://opendev.org/zuul/zuul-registry

View File

@ -53,3 +53,12 @@
owner: "{{ zuul_registry_file_ssl_key_owner }}"
src: "{{ zuul_registry_file_ssl_key_src }}"
register: zuul_registry_file_ssl_key
- name: Install zuul-registry crontab
become: true
template:
dest: "{{ zuul_registry_file_crontab_dest }}"
group: "{{ zuul_registry_file_crontab_group }}"
mode: "{{ zuul_registry_file_crontab_mode }}"
owner: "{{ zuul_registry_file_crontab_owner }}"
src: "{{ zuul_registry_file_crontab_src }}"

View File

@ -0,0 +1,4 @@
# This file is generated by Ansible
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
#
0 3 * * * {{ zuul_registry_user_name }} {{ zuul_registry_pip_virtualenv | default('/usr/local') }}/bin/zuul-regsitry -c {{ zuul_registry_file_registry_yaml_dest }} prune