|
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 Jammy 22.04 to Noble 24.04 |
| 4 | +- name: Prepare upgrade 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 | + tags: pre |
9 | 10 | tasks:
|
10 | 11 | - name: Assert that hosts are running Ubuntu Jammy
|
11 | 12 | ansible.builtin.assert:
|
|
67 | 68 | ansible.builtin.command: sudo mount -o remount,exec /tmp
|
68 | 69 | become: true
|
69 | 70 |
|
| 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: |
70 | 87 | - name: Do release upgrade
|
71 | 88 | ansible.builtin.command: do-release-upgrade -f DistUpgradeViewNonInteractive
|
72 | 89 | become: true
|
73 | 90 |
|
| 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: |
74 | 98 | - name: Ensure old venvs do not exist
|
75 | 99 | ansible.builtin.file:
|
76 | 100 | path: /opt/kayobe/venvs/{{ item }}
|
|
87 | 111 |
|
88 | 112 | - name: Run the Kayobe kayobe-target-venv playbook to ensure kayobe venv exists on remote host
|
89 | 113 | 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 }}" |
90 | 134 |
|
91 | 135 | - name: Run the Kayobe network configuration playbook, to ensure definitions are not lost on reboot
|
92 | 136 | import_playbook: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}/share/kayobe/ansible/network.yml"
|
| 137 | + tags: post |
93 | 138 |
|
94 | 139 | - name: Reboot and confirm the host is upgraded to Noble 24.04
|
95 | 140 | hosts: overcloud:infra-vms:seed:seed-hypervisor
|
96 | 141 | vars:
|
97 | 142 | ansible_python_interpreter: /usr/bin/python3
|
98 | 143 | reboot_timeout_s: "{{ 20 * 60 }}"
|
| 144 | + tags: post |
99 | 145 | tasks:
|
100 | 146 | - name: Ensure Noble repo definitions do not exist in sources.list
|
101 | 147 | ansible.builtin.blockinfile:
|
|
0 commit comments