Add the scripts to purge the amis regularly

Signed-off-by: Sayan Chowdhury <sayan.chowdhury2012@gmail.com>
This commit is contained in:
Sayan Chowdhury 2017-10-17 04:13:56 +05:30 committed by Patrick Uiterwijk
parent 5acb12063d
commit 04638babae
2 changed files with 11 additions and 0 deletions

View file

@ -0,0 +1,5 @@
# Remove launch permissions from the AMIs after every 5 days
0 0 */5 * * 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 }} ./clean-amis.py --change-perms && popd && rm -rf $TMPDIR
# Delete the AMIs after every 10 days.
0 0 */10 * * 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 }} ./clean-amis.py --delete && popd && rm -rf $TMPDIR

View file

@ -171,6 +171,12 @@
copy: src="atomic-cd" dest=/etc/cron.d/atomic-cd
when: inventory_hostname.startswith('compose-x86-01')
# put cron job in for purging nightly amis
- name: purge nightly amis cron
copy: src="purge-amis" dest=/etc/cron.d/purge-amis
when: inventory_hostname.startswith('compose-x86-01')
- name: install compose /etc/httpd/conf.d/compose.conf file
copy: >
src="compose.conf"