[copr] polishing keygen playbook; install instant-instance-killer script;

This commit is contained in:
Valentin Gologuzov 2014-12-16 15:12:41 +01:00
parent 8d84f9aea7
commit 0a65add509
4 changed files with 15 additions and 5 deletions

View file

@ -13,4 +13,3 @@ tcp_ports: ['22', '80', '443']
# Copr vars
copr_hostbase: copr-be-dev
_copr_be_conf: copr-be.conf-dev
signer_host: 209.132.184.124

View file

@ -29,5 +29,3 @@ copr_hostbase: copr-be
host_backup_targets: ['/var/lib/copr/public_html/results']
_copr_be_conf: copr-be.conf
# IP of copr-keygen.cloud.fedoraproject.org
signer_host: 209.132.184.159

View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
source /home/copr/cloud/ec2rc.sh
/bin/euca-describe-instances | grep INSTANCE | while read line; do
id="$(echo $line | cut -d' ' -f2)"
state="$(echo $line | cut -d' ' -f6)"
if [[ "$state" == "error" ]]; then
/bin/euca-terminate-instances "$id"
fi
done

View file

@ -136,6 +136,8 @@
copy: src="delete-forgotten-instances.cron" dest=/etc/cron.daily/delete-forgotten-instances owner=root group=root mode=755
when: not devel
- name: add sign machine address into the sign.conf
lineinfile: "dest=/etc/sign.conf regexp='^server' line='server: {{ signer_host }}'"
- name: install script to kill VMs in error state
copy: src="instant-instance-killer.sh" dest="/root/"
- cron: name="kill VMs in error state" minute="*/15" job="/root/instant-instance-killer.sh"
when: not devel