|
1 | 1 | ---
|
2 | 2 | # To prevent Ansible role dependency errors, this playbook requires that environment variable
|
3 | 3 | # ANSIBLE_ROLES_PATH is defined and includes '$KAYOBE_PATH/ansible/roles' on the Ansible control host.
|
4 |
| -- name: Migrate hosts from Ubuntu Focal 20.04 to Jammy 22.04 |
| 4 | +- name: Migrate hosts from Ubuntu Jammy 22.04 to Noble 24.04 |
5 | 5 | hosts: overcloud:infra-vms:seed:seed-hypervisor
|
6 | 6 | vars:
|
7 | 7 | ansible_python_interpreter: /usr/bin/python3
|
8 | 8 | reboot_timeout_s: "{{ 20 * 60 }}"
|
9 | 9 | tasks:
|
10 |
| - - name: Assert that hosts are running Ubuntu Focal |
| 10 | + - name: Assert that hosts are running Ubuntu Jammy |
11 | 11 | ansible.builtin.assert:
|
12 | 12 | that:
|
13 | 13 | - ansible_facts.distribution == 'Ubuntu'
|
14 |
| - - ansible_facts.distribution_major_version == '20' |
15 |
| - - ansible_facts.distribution_release == 'focal' |
| 14 | + - ansible_facts.distribution_major_version == '22' |
| 15 | + - ansible_facts.distribution_release == 'jammy' |
16 | 16 | - os_distribution == 'ubuntu'
|
17 | 17 | fail_msg: >-
|
18 |
| - This playbook is only designed for Ubuntu Focal 20.04 hosts. Ensure |
19 |
| - that you are limiting it to only run on Focal hosts and |
| 18 | + This playbook is only designed for Ubuntu Jammy 22.04 hosts. Ensure |
| 19 | + that you are limiting it to only run on Jammy hosts and |
20 | 20 | os_distribution is set to ubuntu.
|
21 | 21 |
|
22 | 22 | - name: Ensure apt packages are up to date
|
|
53 | 53 | when: file_status.stat.exists
|
54 | 54 |
|
55 | 55 | # NOTE: We cannot use apt_repository here because definitions must exist within the standard repos.list
|
56 |
| - - name: Ensure Jammy repo definitions exist in sources.list |
| 56 | + - name: Ensure Noble repo definitions exist in sources.list |
57 | 57 | ansible.builtin.blockinfile:
|
58 | 58 | path: /etc/apt/sources.list
|
59 | 59 | block: |
|
60 |
| - deb {{ stackhpc_repo_ubuntu_jammy_url }} jammy main restricted universe multiverse |
61 |
| - deb {{ stackhpc_repo_ubuntu_jammy_url }} jammy-updates main restricted universe multiverse |
62 |
| - deb {{ stackhpc_repo_ubuntu_jammy_url }} jammy-backports main restricted universe multiverse |
63 |
| - deb {{ stackhpc_repo_ubuntu_jammy_security_url }} jammy-security main restricted universe multiverse |
| 60 | + deb {{ stackhpc_repo_ubuntu_noble_url }} noble main restricted universe multiverse |
| 61 | + deb {{ stackhpc_repo_ubuntu_noble_url }} noble-updates main restricted universe multiverse |
| 62 | + deb {{ stackhpc_repo_ubuntu_noble_url }} noble-backports main restricted universe multiverse |
| 63 | + deb {{ stackhpc_repo_ubuntu_noble_security_url }} noble-security main restricted universe multiverse |
64 | 64 | become: true
|
65 | 65 |
|
66 | 66 | - name: Do release upgrade
|
|
87 | 87 | - name: Run the Kayobe network configuration playbook, to ensure definitions are not lost on reboot
|
88 | 88 | import_playbook: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}/share/kayobe/ansible/network.yml"
|
89 | 89 |
|
90 |
| -- name: Reboot and confirm the host is upgraded to Jammy 22.04 |
| 90 | +- name: Reboot and confirm the host is upgraded to Noble 24.04 |
91 | 91 | hosts: overcloud:infra-vms:seed:seed-hypervisor
|
92 | 92 | vars:
|
93 | 93 | ansible_python_interpreter: /usr/bin/python3
|
94 | 94 | reboot_timeout_s: "{{ 20 * 60 }}"
|
95 | 95 | tasks:
|
96 |
| - - name: Ensure Jammy repo definitions do not exist in sources.list |
| 96 | + - name: Ensure Noble repo definitions do not exist in sources.list |
97 | 97 | ansible.builtin.blockinfile:
|
98 | 98 | path: /etc/apt/sources.list
|
99 | 99 | state: absent
|
|
126 | 126 | filter: "{{ kayobe_ansible_setup_filter }}"
|
127 | 127 | gather_subset: "{{ kayobe_ansible_setup_gather_subset }}"
|
128 | 128 |
|
129 |
| - - name: Assert that hosts are now using Ubuntu 22 |
| 129 | + - name: Assert that hosts are now using Ubuntu 24 |
130 | 130 | ansible.builtin.assert:
|
131 | 131 | that:
|
132 |
| - - ansible_facts.distribution_major_version == '22' |
133 |
| - - ansible_facts.distribution_release == 'jammy' |
| 132 | + - ansible_facts.distribution_major_version == '24' |
| 133 | + - ansible_facts.distribution_release == 'noble' |
0 commit comments