copr: aws: add terminator playbook

.. and put region to vars file so we have it defined at one place.
This commit is contained in:
Pavel Raiskup 2019-11-20 09:16:19 +01:00 committed by Pierre-Yves Chibon
parent fc48a634a1
commit f7211c7013
3 changed files with 29 additions and 2 deletions

View file

@ -13,7 +13,6 @@
keypair: copr-builder
instance_type: i3.large
security_group: ssh-only
region: us-east-1
max_spawn_time: 1100
spawning_vm_user: "fedora"
image_name: "{{ builder_images.x86_64 }}"
@ -29,7 +28,7 @@
instance_type: "{{ instance_type }}"
image: "{{ image_name }}"
wait: true
region: "{{ region }}"
region: "{{ aws_region }}"
vpc_subnet_id: subnet-01d4e967ab5e78005
assign_public_ip: yes
instance_tags:

View file

@ -0,0 +1,26 @@
- name: terminate instance
hosts: 127.0.0.1
gather_facts: False
vars_files:
- vars.yml
- nova_cloud_vars.yml
tasks:
- local_action:
module: ec2
instance_tags:
Name: "{{ copr_task.vm_name }}"
region: "{{ aws_region }}"
state: running
aws_access_key: "{{ aws_access_key }}"
aws_secret_key: "{{ aws_secret_key }}"
register: ec2
- local_action:
module: ec2
region: "{{ aws_region }}"
state: absent
instance_ids: "{{ ec2.instance_ids }}"
aws_access_key: "{{ aws_access_key }}"
aws_secret_key: "{{ aws_secret_key }}"

View file

@ -1,5 +1,7 @@
aws_access_key: {{ copr_aws_access_key_id }}
aws_secret_key: {{ copr_aws_secret_access_key }}
aws_region: us-east-1
builder_images:
x86_64: "{{ copr_builder_images.aws.x86_64 }}"