Skip to content

Commit 4ab0fdb

Browse files
Release 1.6.1 upgrade changes
1 parent 3888010 commit 4ab0fdb

File tree

13 files changed

+334
-62
lines changed

13 files changed

+334
-62
lines changed

.metadata/omnia_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
omnia_version: 1.6
1+
omnia_version: 1.6.1

local_repo/roles/parse_and_download/tasks/apt_conf_config.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,6 @@
1818
changed_when: false
1919
register: hostname_result
2020

21-
- name: Download libssl package
22-
when: cluster_os_version == "22.04"
23-
block:
24-
- name: Get libssl package
25-
ansible.builtin.get_url:
26-
url: "{{ libssl_package_url }}"
27-
dest: "{{ libssl_package_dest }}"
28-
mode: "{{ apt_file_mode }}"
29-
register: download_libssl
30-
until: download_libssl is not failed
31-
retries: "{{ max_retries }}"
32-
3321
# creating apt.conf
3422
- name: Execute apt update on /etc/apt/custom_sources/sources.list.d
3523
block:

local_repo/roles/parse_and_download/vars/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ apt_conf_dest: "/etc/apt/apt.conf"
3434
apt_conf_partial_dest: "/etc/apt/user_apt.conf"
3535
custom_repo_path: "/etc/apt/custom_sources"
3636
custom_repo_path_partial: "/etc/apt/custom_sources_partial"
37-
libssl_package_url: http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb
38-
libssl_package_dest: "{{ repo_store_path }}/cluster/ubuntu/22.04/deb/"
3937
directory_permissions: "0755"
4038
apt_file_mode: "0644"
4139
max_retries: 10

upgrade/ansible.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ roles_path = ./roles:../prepare_cp/roles:../discovery/roles
44
host_key_checking = false
55
forks = 5
66
timeout = 180
7+
display_skipped_hosts = false
78

89
[persistent_connection]
910
command_timeout = 180

upgrade/prepare_config.yml

Lines changed: 60 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,81 @@
1313
# limitations under the License.
1414
---
1515

16-
# This playbook should be invoked with -i option pointing to omnia 1.5 inventory file
17-
- name: Set ansible and python versions for omnia 1.6
16+
- name: Validate parameters
17+
hosts: localhost
18+
connection: local
19+
roles:
20+
- validate_upgrade_config
21+
22+
- name: Set upgrade status
1823
hosts: localhost
1924
connection: local
2025
tasks:
26+
- name: Validate omnia version
27+
ansible.builtin.include_role:
28+
name: "{{ playbook_dir }}/roles/validate_omnia_version" # noqa:role-name[path]
29+
2130
- name: Invoke omnia 1.6 pre-req
2231
ansible.builtin.command: sh "{{ playbook_dir }}/../prereq.sh"
2332
changed_when: true
33+
when: upgrade_status
2434

25-
- name: Import parameters from Omnia 1.5 to Omnia 1.6
35+
- name: Import parameters from Omnia
2636
hosts: localhost
2737
connection: local
28-
roles:
29-
- validate_upgrade_config
30-
- import_input_parameters
31-
- encrypt_inputs
32-
- backup_omniadb
33-
- upgrade_inventory
34-
- backup_telemetry
38+
tasks:
39+
- name: Import parameters and backup Omniadb
40+
when: upgrade_status
41+
block:
42+
- name: Import input parameters
43+
ansible.builtin.include_role:
44+
name: import_input_parameters
45+
46+
- name: Encrypt inputs
47+
ansible.builtin.include_role:
48+
name: encrypt_inputs
49+
50+
- name: Backup omniadb
51+
ansible.builtin.include_role:
52+
name: backup_omniadb
53+
54+
- name: Upgrade inventory
55+
ansible.builtin.include_role:
56+
name: upgrade_inventory
57+
58+
- name: Backup telemetry
59+
ansible.builtin.include_role:
60+
name: backup_telemetry
61+
62+
- name: Invoke specific tasks from update_metadata role
63+
hosts: localhost
64+
connection: local
65+
tasks:
66+
- name: Include only update tasks from upgrade
67+
ansible.builtin.include_role:
68+
name: update_metadata
69+
tasks_from: update.yml
70+
when: not upgrade_status
71+
72+
- name: Include only update_metadata tasks
73+
ansible.builtin.include_role:
74+
name: update_metadata
75+
tasks_from: update_metadata.yml
3576

3677
- name: Display User Message
3778
hosts: localhost
3879
connection: local
3980
tasks:
4081
- name: Include user message
41-
ansible.builtin.include_role: # noqa:role-name[path]
42-
name: "{{ playbook_dir }}/roles/user_messages"
82+
ansible.builtin.include_role:
83+
name: "{{ playbook_dir }}/roles/user_messages" # noqa:role-name[path]
84+
85+
- name: Print user upgrade message
86+
ansible.builtin.debug:
87+
msg: "{{ user_msg_prepare_config.split('\n') }}"
88+
when: upgrade_status
4389

4490
- name: Print user message
4591
ansible.builtin.debug:
46-
msg: "{{ usr_msg_prepare_config.split('\n') }}"
92+
msg: "{{ user_msg_prepare_config2.split('\n') }}"
93+
when: not upgrade_status

upgrade/prepare_upgrade.yml

Lines changed: 99 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,53 +13,122 @@
1313
# limitations under the License.
1414
---
1515

16+
- name: Set upgrade status
17+
hosts: localhost
18+
connection: local
19+
tasks:
20+
- name: Validate omnia version
21+
ansible.builtin.include_role:
22+
name: "{{ playbook_dir }}/roles/validate_omnia_version" # noqa:role-name[path]
23+
1624
# This playbook should be invoked with -i option pointing to omnia 1.5 inventory file
17-
- name: Validate parameters from Omnia 1.5 to Omnia 1.6
25+
- name: Validate parameters
1826
hosts: localhost
1927
connection: local
20-
roles:
21-
- encrypt_inputs
22-
- validate_input_configs
28+
tasks:
29+
- name: Validate parameters
30+
when: upgrade_status
31+
block:
32+
- name: Encrypt inputs
33+
ansible.builtin.include_role:
34+
name: encrypt_inputs
35+
36+
- name: Validate input configs
37+
ansible.builtin.include_role:
38+
name: validate_input_configs
2339

2440
- name: Cleanup Control plane
2541
hosts: localhost
2642
connection: local
27-
roles:
28-
- docker_registry_uninstall
29-
- telemetry_uninstall
43+
tasks:
44+
- name: Cleanup Control plane
45+
when: upgrade_status
46+
block:
47+
- name: Docker registry uninstall
48+
ansible.builtin.include_role:
49+
name: docker_registry_uninstall
50+
51+
- name: Telemetry uninstall
52+
ansible.builtin.include_role:
53+
name: telemetry_uninstall
3054

3155
# Uninstall k8s on omnia 1.5 cluster
3256
- name: Uninstall kubernetes on k8s worker
3357
hosts: compute
34-
roles:
35-
- uninstall_k8s_cluster
36-
- preinstall_cluster_cleanup
58+
tasks:
59+
- name: Uninstall kubernetes
60+
when: upgrade_status
61+
block:
62+
- name: Uninstall k8s cluster
63+
ansible.builtin.include_role:
64+
name: uninstall_k8s_cluster
65+
66+
- name: Preinstall cluster cleanup
67+
ansible.builtin.include_role:
68+
name: preinstall_cluster_cleanup
3769

3870
- name: Uninstall kubernetes on k8s manager
3971
hosts: manager
40-
roles:
41-
- uninstall_k8s_cluster
42-
- preinstall_cluster_cleanup
72+
tasks:
73+
- name: Uninstall kubernetes
74+
when: upgrade_status
75+
block:
76+
- name: Uninstall k8s cluster
77+
ansible.builtin.include_role:
78+
name: uninstall_k8s_cluster
79+
80+
- name: Preinstall cluster cleanup
81+
ansible.builtin.include_role:
82+
name: preinstall_cluster_cleanup
4383

4484
- name: Uninstall openldap
4585
hosts: manager, compute, login
46-
roles:
47-
- uninstall_open_ldap
86+
tasks:
87+
- name: Uninstall openldap
88+
when: upgrade_status
89+
block:
90+
- name: Uninstall open_ldap
91+
ansible.builtin.include_role:
92+
name: uninstall_open_ldap
4893

4994
- name: Run local_repo.yml on new input directory
5095
ansible.builtin.import_playbook: "{{ playbook_dir}}/../local_repo/local_repo.yml"
96+
when: upgrade_status
5197

5298
- name: Invoke omnia 1.6 prepare_cp roles # noqa:role-name[path]
5399
hosts: localhost
54100
connection: local
55-
roles:
56-
- "{{ playbook_dir }}/../prepare_cp/roles/configure_proxy" # noqa:role-name[path]
57-
- "{{ playbook_dir }}/../prepare_cp/roles/omnia_telemetry_cp" # noqa:role-name[path]
58-
- "{{ playbook_dir }}/../prepare_cp/roles/omnia_appliance_cp" # noqa:role-name[path]
59-
- upgrade_omniadb
60-
- upgrade_xcat
61-
- prepare_cp_for_upgrade
62-
- metadata_update
101+
tasks:
102+
- name: Invoke omnia 1.6 prepare_cp
103+
when: upgrade_status
104+
block:
105+
- name: Invoke configure proxy
106+
ansible.builtin.include_role:
107+
name: "{{ playbook_dir }}/../prepare_cp/roles/configure_proxy" # noqa:role-name[path]
108+
109+
- name: Invoke telemetry cp
110+
ansible.builtin.include_role:
111+
name: "{{ playbook_dir }}/../prepare_cp/roles/omnia_telemetry_cp" # noqa:role-name[path]
112+
113+
- name: Invoke omnia appliance
114+
ansible.builtin.include_role:
115+
name: "{{ playbook_dir }}/../prepare_cp/roles/omnia_appliance_cp" # noqa:role-name[path]
116+
117+
- name: Upgrade omniadb
118+
ansible.builtin.include_role:
119+
name: upgrade_omniadb
120+
121+
- name: Upgrade xcat
122+
ansible.builtin.include_role:
123+
name: upgrade_xcat
124+
125+
- name: Invoke prepare_cp
126+
ansible.builtin.include_role:
127+
name: prepare_cp_for_upgrade
128+
129+
- name: Import input parameters
130+
ansible.builtin.include_role:
131+
name: metadata_update
63132

64133
- name: Display User Message
65134
hosts: localhost
@@ -69,6 +138,12 @@
69138
ansible.builtin.include_role:
70139
name: "{{ playbook_dir }}/roles/user_messages" # noqa:role-name[path]
71140

72-
- name: Print user message
141+
- name: Print user upgrade message
73142
ansible.builtin.debug:
74143
msg: "{{ user_msg_prepare_upgrade.split('\n') }}"
144+
when: upgrade_status
145+
146+
- name: Print user message
147+
ansible.builtin.debug:
148+
msg: "{{ user_msg_prepare_upgrade2.split('\n') }}"
149+
when: not upgrade_status
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2024 Dell Inc. or its subsidiaries. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
---
15+
16+
- name: Read file path parameters from upgrade_config.yml
17+
ansible.builtin.include_vars:
18+
file: upgrade_config.yml
19+
changed_when: false
20+
21+
- name: Upgrade task files to destination path using shell command
22+
ansible.builtin.shell:
23+
cmd: "cp -r {{ old_input_location }} ../"
24+
changed_when: false
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright 2024 Dell Inc. or its subsidiaries. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
---
15+
16+
- name: Check metadata.yml file existence
17+
ansible.builtin.stat:
18+
path: "{{ metadata_yaml_file_path }}"
19+
register: metadata_status
20+
21+
- name: Create metadata.yml file if it doesn't exists
22+
ansible.builtin.file:
23+
path: "{{ metadata_yaml_file_path }}"
24+
state: touch
25+
mode: "{{ file_permissions }}"
26+
group: root
27+
owner: root
28+
when: not metadata_status.stat.exists
29+
30+
- name: Update or add installed_version in metadata.yml file
31+
block:
32+
- name: Update installed_version
33+
ansible.builtin.lineinfile:
34+
path: "{{ metadata_yaml_file_path }}"
35+
regexp: '^installed_version:(.*)$'
36+
insertafter: "EOF"
37+
state: present
38+
line: 'installed_version: 1.6.1'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2024 Dell Inc. or its subsidiaries. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
---
15+
16+
# Usage: update.yml
17+
dir_mode: "0755"
18+
19+
# Usage: update_metadata.yml
20+
metadata_yaml_file_path: "/opt/omnia/.data/metadata.yml"
21+
file_permissions: "0644"

upgrade/roles/user_messages/tasks/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
- name: Set message facts
1717
ansible.builtin.set_fact:
18-
usr_msg_prepare_config: "{{ user_msg_prepare_config }}"
18+
user_msg_prepare_config: "{{ user_msg_prepare_config }}"
1919
user_msg_prepare_upgrade: "{{ user_msg_prepare_upgrade }}"
20+
user_msg_prepare_config2: "{{ user_msg_prepare_config2 }}"
21+
user_msg_prepare_upgrade2: "{{ user_msg_prepare_upgrade2 }}"
2022
user_msg_upgrade: "{{ user_msg_upgrade }}"

0 commit comments

Comments
 (0)