-
Notifications
You must be signed in to change notification settings - Fork 3
/
play-backend-snapshot-recovery-example.yml
60 lines (57 loc) · 1.68 KB
/
play-backend-snapshot-recovery-example.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
- name: "Pick appropriate groups for localhost"
hosts: localhost
connection: local
gather_facts: false
vars:
ssh_key: praiskup
snapshots_for_testing:
- snap-0615c9d324644f531
- snap-05221943e4ed258f2
- snap-084d40475c2c3e239
- snap-04576448d175dcbb7
- snap-08b4341f920fa51d1
- snap-0bf11d4057cb1ae9c
tasks:
- name: "create a testing machine for testing snapshots"
amazon.aws.ec2_instance:
name: "test-snapshot-recovery"
state: running
profile: fedora-copr
region: us-east-1
key_name: "{{ ssh_key }}"
count: 1
image_id: "{{ aws_images['f39'] }}"
instance_type: "t3a.medium"
detailed_monitoring: true
network:
assign_public_ip: true
vpc_subnet_id: "{{ infra_subnet }}"
security_group: "copr-backend-sg"
termination_protection: false
wait: true
tags:
FedoraGroup: copr
CoprPurpose: testing
volumes:
- ebs:
volume_size: 15
encrypted: true
delete_on_termination: true
device_name: /dev/sda1
register: instances_started
- name: create TEMPORARY volumes and attach
amazon.aws.ec2_vol:
instance: "{{ instances_started.instances[0].instance_id }}"
snapshot: "{{ item }}"
volume_type: sc1
device_name: "/dev/sd{{ letters[ansible_loop.index0] }}"
tags:
FedoraGroup: copr
CoprPurpose: testing
delete_on_termination: true
vars:
letters: ijklmnopqrstuvwxyz
loop: "{{ snapshots_for_testing }}"
loop_control:
extended: true