Skip to content

Commit 5e3d851

Browse files
committed
Add tasks for Noble upgrade
1 parent 837e720 commit 5e3d851

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

etc/kayobe/ansible/ubuntu-upgrade.yml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
# To prevent Ansible role dependency errors, this playbook requires that environment variable
33
# ANSIBLE_ROLES_PATH is defined and includes '$KAYOBE_PATH/ansible/roles' on the Ansible control host.
4-
- name: Migrate hosts from Ubuntu Jammy 22.04 to Noble 24.04
4+
- name: Prepare upgrade from Ubuntu Jammy 22.04 to Noble 24.04
55
hosts: overcloud:infra-vms:seed:seed-hypervisor
66
vars:
77
ansible_python_interpreter: /usr/bin/python3
88
reboot_timeout_s: "{{ 20 * 60 }}"
9+
tags: pre
910
tasks:
1011
- name: Assert that hosts are running Ubuntu Jammy
1112
ansible.builtin.assert:
@@ -67,10 +68,33 @@
6768
ansible.builtin.command: sudo mount -o remount,exec /tmp
6869
become: true
6970

71+
- name: Ensure chrony and tzdata are uninstalled
72+
ansible.builtin.apt:
73+
name:
74+
- chrony
75+
- tzdata
76+
state: absent
77+
when: inventory_hostname in groups['ntp']
78+
become: true
79+
80+
- name: Upgrade hosts from Ubuntu Jammy 22.04 to Noble 24.04
81+
hosts: overcloud:infra-vms:seed:seed-hypervisor
82+
vars:
83+
ansible_python_interpreter: /usr/bin/python3
84+
reboot_timeout_s: "{{ 20 * 60 }}"
85+
tags: upgrade
86+
tasks:
7087
- name: Do release upgrade
7188
ansible.builtin.command: do-release-upgrade -f DistUpgradeViewNonInteractive
7289
become: true
7390

91+
- name: Post upgrade of Ubuntu Jammy 22.04 to Noble 24.04
92+
hosts: overcloud:infra-vms:seed:seed-hypervisor
93+
vars:
94+
ansible_python_interpreter: /usr/bin/python3
95+
reboot_timeout_s: "{{ 20 * 60 }}"
96+
tags: post
97+
tasks:
7498
- name: Ensure old venvs do not exist
7599
ansible.builtin.file:
76100
path: /opt/kayobe/venvs/{{ item }}
@@ -87,15 +111,37 @@
87111

88112
- name: Run the Kayobe kayobe-target-venv playbook to ensure kayobe venv exists on remote host
89113
import_playbook: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}/share/kayobe/ansible/kayobe-target-venv.yml"
114+
tags: post
115+
116+
- name: Run the Kayobe apt playbook to ensure Noble repositories are set on remote host
117+
import_playbook: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}/share/kayobe/ansible/apt.yml"
118+
tags: post
119+
120+
- name: Ensure ansible can collect network facts
121+
hosts: overcloud:infra-vms:seed:seed-hypervisor
122+
tags: post
123+
tasks:
124+
- name: Ensure iproute2 is installed
125+
ansible.builtin.apt:
126+
name: iproute2
127+
state: present
128+
become: true
129+
130+
- name: Update Python and current user facts before running Kayobe network playbook
131+
ansible.builtin.setup:
132+
filter: "{{ kayobe_ansible_setup_filter }}"
133+
gather_subset: "{{ kayobe_ansible_setup_gather_subset }}"
90134

91135
- name: Run the Kayobe network configuration playbook, to ensure definitions are not lost on reboot
92136
import_playbook: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}/share/kayobe/ansible/network.yml"
137+
tags: post
93138

94139
- name: Reboot and confirm the host is upgraded to Noble 24.04
95140
hosts: overcloud:infra-vms:seed:seed-hypervisor
96141
vars:
97142
ansible_python_interpreter: /usr/bin/python3
98143
reboot_timeout_s: "{{ 20 * 60 }}"
144+
tags: post
99145
tasks:
100146
- name: Ensure Noble repo definitions do not exist in sources.list
101147
ansible.builtin.blockinfile:

0 commit comments

Comments
 (0)