-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgrade.yml
112 lines (103 loc) · 3.34 KB
/
upgrade.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
- name: Refresh Inventory
hosts: localhost
tasks:
- meta: refresh_inventory
- name: Collecting Info
hosts: undercloud:overcloud_nodes:!unused
gather_facts: yes
any_errors_fatal: true
vars:
discovery_types:
- rhos_release_file
- nova
tags:
- upgrade_collect_info
roles:
- version-discovery
- name: Undercloud Validation
hosts: undercloud
gather_facts: yes
any_errors_fatal: true
tags:
- upgrade_validation
- upgrade_undercloud_validation
tasks:
- name: Validation
include_tasks: "tasks/upgrade/undercloud_validation.yml"
- name: Overcloud Validation
hosts: overcloud_nodes:!unused
gather_facts: yes
any_errors_fatal: true
tags:
- upgrade_validation
- upgrade_overcloud_validation
tasks:
- name: Validation
include_tasks: "tasks/upgrade/overcloud_validation.yml"
- name: Update Overcloud repos
hosts: overcloud_nodes:!unused
gather_facts: yes
any_errors_fatal: true
tags:
- upgrade
- upgrade_repos
vars:
rhos_release_rpm: "https://url.corp.redhat.com/rhos-release-latest-rpm"
roles:
- role: rhos-release
rr_buildmods: "{{ install.buildmods }}"
release: "{{ (hostvars[groups['undercloud']|first].undercloud_version|int) }}"
build: "{{ install.build|default('None') if install.build != 'None' else 'latest' }}"
director: no
mirror: "{{ install.mirror | default(omit) }}"
enable_testing_repos: "{{ install.get('enable', {}).get('testing', {}).repos|default(omit) }}"
# todo(abregman): remove once rhbz#1434344 is resolved
- name: Apply workaround for rhbz 1434344
hosts: controller:!unused
gather_facts: yes
any_errors_fatal: true
tags:
- upgrade
tasks:
- name: Start openstack-gnocchi-statsd
become: true
service:
name: openstack-gnocchi-statsd
state: started
enabled: yes
ignore_errors: true
- name: Overcloud Upgrade
hosts: undercloud
gather_facts: yes
any_errors_fatal: true
vars:
undercloud_rc: "~/stackrc"
overcloud_rc: "{{ ansible_user_dir }}/{{ install.overcloud.stack }}rc"
temp_dir: "/tmp/overcloud_upgrade"
overcloud_deploy_script: "~/overcloud_deploy.sh"
overcloud_upgrade_script: "~/overcloud_upgrade.sh"
path_venv: "/var/tmp/venv_shade"
loss_threshold: 1
tags:
- upgrade
tasks:
- name: Create overcloud upgrade base script
copy:
src: "{{ overcloud_deploy_script }}"
dest: "{{ overcloud_upgrade_script }}"
mode: 0755
remote_src: true
- name: Scan nodes ssh keys
command: "ssh-keyscan -t rsa {{ hostvars[item].ansible_host|
default(hostvars[item].ansible_ssh_host) }}"
with_items: "{{ groups.overcloud_nodes|default([])|difference(groups.unused|default([])) }}"
register: pubkeys
- name: Add nodes to known_hosts
known_hosts:
name: "{{ hostvars[item.item].ansible_host|
default(hostvars[item.item].ansible_ssh_host) }}"
key: "{{ item.stdout }}"
with_items: "{{ pubkeys.results }}"
- name: Overcloud Upgrade
include_tasks: "tasks/upgrade/{{ undercloud_version }}/main.yml"
when: undercloud_version|openstack_release < 12