-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplay-vm-migration-03-rename-instances.yml
44 lines (42 loc) · 1.2 KB
/
play-vm-migration-03-rename-instances.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
---
- name: "Pick appropriate groups for localhost"
hosts: localhost
gather_facts: false
connection: local
tasks:
- import_tasks: tasks/localhost-group-placement.yml
tags: always
- name: "Rename instances"
hosts: localhost
gather_facts: false
connection: local
tasks:
- name: re-name old instances
amazon.aws.ec2_instance:
profile: fedora-copr
instance_ids: "{{ item.old_instance_id }}"
name: "{{ item.name }}-{{ copr_instance }}-old"
purge_tags: false
tags:
CoprFedoraNextWorkflow: old
termination_protection: false
ignore_errors: true # keep renaming the new instances below
with_items:
- "{{ backend }}"
- "{{ frontend }}"
- "{{ keygen }}"
- "{{ distgit }}"
- name: re-name new instances
amazon.aws.ec2_instance:
profile: fedora-copr
instance_ids: "{{ item.new_instance_id }}"
name: "{{ item.name }}-{{ copr_instance }}"
purge_tags: false
tags:
CoprFedoraNextWorkflow: new
termination_protection: true
with_items:
- "{{ backend }}"
- "{{ frontend }}"
- "{{ keygen }}"
- "{{ distgit }}"