Add the cron to run the ami deletion regularly
This commit is contained in:
parent
a3076d40a0
commit
1709ce142d
2 changed files with 19 additions and 1 deletions
|
@ -90,13 +90,21 @@
|
||||||
- python2-koji-cli-plugins
|
- python2-koji-cli-plugins
|
||||||
- python3-koji-cli-plugins
|
- python3-koji-cli-plugins
|
||||||
- python2-koji
|
- python2-koji
|
||||||
- python3-fedfind
|
- python3-fedfind # needed by clean-amis.py script
|
||||||
|
- python3-boto # needed by clean-amis.py script
|
||||||
|
- python3-requests # needed by clean-amis.py script
|
||||||
- make
|
- make
|
||||||
- nosync
|
- nosync
|
||||||
- pygobject3
|
- pygobject3
|
||||||
tags:
|
tags:
|
||||||
- releng
|
- releng
|
||||||
|
|
||||||
|
- name: add pkgs from testing repo
|
||||||
|
dnf: state=present pkg={{ item }} enablerepo=infrastructure-tags-stg
|
||||||
|
with_items:
|
||||||
|
- python3-libpagure
|
||||||
|
when: testing
|
||||||
|
|
||||||
- name: add pkgs
|
- name: add pkgs
|
||||||
dnf: state=present pkg={{ item }}
|
dnf: state=present pkg={{ item }}
|
||||||
with_items:
|
with_items:
|
||||||
|
@ -147,6 +155,11 @@
|
||||||
copy: src="container-updates" dest=/etc/cron.d/container-updates
|
copy: src="container-updates" dest=/etc/cron.d/container-updates
|
||||||
when: inventory_hostname.startswith('compose-x86-01')
|
when: inventory_hostname.startswith('compose-x86-01')
|
||||||
|
|
||||||
|
# put cron job in for regular ami deletion
|
||||||
|
- name: clean-amis cron
|
||||||
|
template: src=clean-amis.j2 dest=/etc/cron.d/clean-amis
|
||||||
|
when: inventory_hostname.startswith('compose-x86-01')
|
||||||
|
|
||||||
- name: install compose /etc/httpd/conf.d/compose.conf file
|
- name: install compose /etc/httpd/conf.d/compose.conf file
|
||||||
copy: >
|
copy: >
|
||||||
src="compose.conf"
|
src="compose.conf"
|
||||||
|
|
5
roles/releng/templates/clean-amis.j2
Normal file
5
roles/releng/templates/clean-amis.j2
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Remove launch permissions from the AMIs after everyday
|
||||||
|
0 22 * * * root TMPDIR=`mktemp -d /tmp/purgeamis.XXXXXX` && pushd $TMPDIR && git clone -n https://pagure.io/releng.git && cd releng/scripts && AWS_ACCESS_KEY={{ ec2_image_delete_access_key_id }} AWS_SECRET_ACCESS_KEY={{ ec2_image_delete_access_key }} PAGURE_ACCESS_TOKEN={{ ami_purge_report_api_key }} ./clean-amis.py --change-perms --days 7 --permswaitperiod 5 && popd && rm -rf $TMPDIR
|
||||||
|
|
||||||
|
# Delete the AMIs after everyday
|
||||||
|
0 23 * * * root TMPDIR=`mktemp -d /tmp/purgeamis.XXXXXX` && pushd $TMPDIR && git clone -n https://pagure.io/releng.git && cd releng/scripts && AWS_ACCESS_KEY={{ ec2_image_delete_access_key_id }} AWS_SECRET_ACCESS_KEY={{ ec2_image_delete_access_key }} PAGURE_ACCESS_TOKEN={{ ami_purge_report_api_key }} ./clean-amis.py --delete --days 17 --deletewaitperiod 10 && popd && rm -rf $TMPDIR
|
Loading…
Add table
Add a link
Reference in a new issue