copr: aws: add terminator playbook
.. and put region to vars file so we have it defined at one place.
This commit is contained in:
parent
fc48a634a1
commit
f7211c7013
3 changed files with 29 additions and 2 deletions
|
@ -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:
|
||||
|
|
26
roles/copr/backend/files/provision/terminatepb-aws.yml
Normal file
26
roles/copr/backend/files/provision/terminatepb-aws.yml
Normal 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 }}"
|
|
@ -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 }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue