You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.9 KiB

  1. ---
  2. - name: Check if bootstrap is needed
  3. raw: which python
  4. register: need_bootstrap
  5. failed_when: false
  6. changed_when: false
  7. tags:
  8. - facts
  9. - name: Remove podman network cni
  10. raw: "podman network rm podman"
  11. become: true
  12. ignore_errors: yes
  13. when: need_bootstrap.rc != 0
  14. - name: Clean up possible pending packages on fedora coreos
  15. raw: "export http_proxy={{ http_proxy | default('') }};rpm-ostree cleanup -p }}"
  16. become: true
  17. when: need_bootstrap.rc != 0
  18. # Because the package "python3-libselinux" has a dependency on libselinux,
  19. # which is a base package in Fedora CoreOS and cannot be upgraded.
  20. # Temporary disabling update repo allows to install python3-libselinux
  21. # see https://github.com/coreos/fedora-coreos-tracker/issues/592
  22. - name: Temporary disable fedora updates repo because of base packages conflicts
  23. raw: "sed -i 's|^enabled=1|enabled=0|g' /etc/yum.repos.d/fedora-updates.repo"
  24. become: true
  25. when: need_bootstrap.rc != 0
  26. - name: Install required packages on fedora coreos
  27. raw: "export http_proxy={{ http_proxy | default('') }};rpm-ostree install {{ fedora_coreos_packages|join(' ') }}"
  28. become: true
  29. when: need_bootstrap.rc != 0
  30. # see https://github.com/coreos/fedora-coreos-tracker/issues/592
  31. - name: Enable fedora updates repo
  32. raw: "sed -i 's|^enabled=0|enabled=1|g' /etc/yum.repos.d/fedora-updates.repo"
  33. become: true
  34. when: need_bootstrap.rc != 0
  35. # playbook fails because connection lost
  36. - name: Reboot immediately for updated ostree, please run playbook again if failed first time.
  37. raw: "nohup bash -c 'sleep 5s && shutdown -r now'"
  38. become: true
  39. ignore_errors: yes
  40. when: need_bootstrap.rc != 0
  41. - name: Wait for the reboot to complete
  42. wait_for_connection:
  43. timeout: 240
  44. connect_timeout: 20
  45. delay: 5
  46. sleep: 5
  47. when: need_bootstrap.rc != 0
  48. - name: Store the fact if this is an fedora core os host
  49. set_fact:
  50. is_fedora_coreos: True
  51. tags:
  52. - facts