2020-03-17 18:12:21 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Check if bootstrap is needed
|
|
|
|
raw: which python
|
|
|
|
register: need_bootstrap
|
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
|
|
|
tags:
|
|
|
|
- facts
|
|
|
|
|
2020-09-07 17:27:41 +08:00
|
|
|
- name: Remove podman network cni
|
|
|
|
raw: "podman network rm podman"
|
|
|
|
become: true
|
2021-07-12 15:00:47 +08:00
|
|
|
ignore_errors: true # noqa ignore-errors
|
2020-09-07 17:27:41 +08:00
|
|
|
when: need_bootstrap.rc != 0
|
|
|
|
|
2020-06-09 17:49:17 +08:00
|
|
|
- name: Clean up possible pending packages on fedora coreos
|
|
|
|
raw: "export http_proxy={{ http_proxy | default('') }};rpm-ostree cleanup -p }}"
|
|
|
|
become: true
|
|
|
|
when: need_bootstrap.rc != 0
|
|
|
|
|
2020-03-17 18:12:21 +08:00
|
|
|
- name: Install required packages on fedora coreos
|
2023-07-05 11:36:54 +08:00
|
|
|
raw: "export http_proxy={{ http_proxy | default('') }};rpm-ostree install --allow-inactive {{ fedora_coreos_packages | join(' ') }}"
|
2020-03-17 18:12:21 +08:00
|
|
|
become: true
|
|
|
|
when: need_bootstrap.rc != 0
|
|
|
|
|
2021-07-15 15:00:48 +08:00
|
|
|
- name: Reboot immediately for updated ostree
|
2020-03-17 18:12:21 +08:00
|
|
|
raw: "nohup bash -c 'sleep 5s && shutdown -r now'"
|
|
|
|
become: true
|
2021-07-12 15:00:47 +08:00
|
|
|
ignore_errors: true # noqa ignore-errors
|
2024-08-28 13:30:56 +08:00
|
|
|
ignore_unreachable: true
|
2020-03-17 18:12:21 +08:00
|
|
|
when: need_bootstrap.rc != 0
|
|
|
|
|
|
|
|
- name: Wait for the reboot to complete
|
|
|
|
wait_for_connection:
|
|
|
|
timeout: 240
|
|
|
|
connect_timeout: 20
|
|
|
|
delay: 5
|
|
|
|
sleep: 5
|
|
|
|
when: need_bootstrap.rc != 0
|