Skip to content
Snippets Groups Projects

Main

Merged Michael Thaler requested to merge main into stable
2 files
+ 35
22
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 34
20
@@ -5,26 +5,36 @@
ansible.builtin.package_facts:
manager: auto
- name: Debugging section - MIGHT BE FALSE DISTRO; LOOK BELOW FOR CORRECTED FACTS
ansible.builtin.debug:
msg: " ansible_version.full {{ ansible_version.full }}, ansible_service_mgr: {{ ansible_service_mgr }} ansible_distribution: {{ansible_distribution}} ansible_distribution_version: {{ansible_distribution_version }} "
- name: Workaround for unrecognized CoreOS. Register wheter /usr/bin/rpm-ostree exists. If yes set to coreos
ansible.builtin.stat:
path: /usr/bin/rpm-ostree
register: hasrpmostree
- name: Workaround for unrecognized CoreOS. Correct Coreos ansible_distribution fact
when: hasrpmostree.stat.exists
ansible.builtin.set_fact:
ansible_distribution: "CoreOs"
- name: Register whether we are running in a virtual
when:
- ansible_service_mgr == 'systemd'
ansible.builtin.command: systemd-detect-virt
register: systemddetectvirt
failed_when: "( systemddetectvirt.rc != 0 ) and ( systemddetectvirt.stdout != 'none' )"
- name: Debugging section
ansible.builtin.debug:
msg: " ansible_version.full {{ ansible_version.full }}, ansible_service_mgr: {{ ansible_service_mgr }} ansible_distribution: {{ansible_distribution}} ansible_distribution_version: {{ansible_distribution_version }} "
- block:
- name: Debugging section - MIGHT BE FALSE DISTRO; LOOK BELOW FOR CORRECTED FACTS
ansible.builtin.debug:
msg: " ansible_version.full {{ ansible_version.full }}, ansible_service_mgr: {{ ansible_service_mgr }} ansible_distribution: {{ansible_distribution}} ansible_distribution_version: {{ansible_distribution_version }} "
- name: Workaround for unrecognized CoreOS. Register wheter /usr/bin/rpm-ostree exists. If yes set to coreos
ansible.builtin.stat:
path: /usr/bin/rpm-ostree
register: hasrpmostree
- name: Workaround for unrecognized CoreOS. Correct Coreos ansible_distribution fact
when: hasrpmostree.stat.exists
ansible.builtin.set_fact:
ansible_distribution: "CoreOs"
- name: Debugging section
ansible.builtin.debug:
msg: " ansible_version.full {{ ansible_version.full }}, ansible_service_mgr: {{ ansible_service_mgr }} ansible_distribution: {{ansible_distribution}} ansible_distribution_version: {{ansible_distribution_version }} detect-virt-result: {{ systemddetectvirt.stdout }}"
#### CLEANUP SECTION
- name: ensure rpm-ostree not buisy
when:
- "'podman' is not in systemddetectvirt.stdout"
ansible.builtin.shell:
cmd: rpm-ostree status
register: rpmostreestatus
@@ -39,7 +49,7 @@
block:
- name: clear rpm-ostree cache
ansible.builtin.shell:
cmd: rpm-ostree cleanup -mpb
cmd: rpm-ostree cleanup -mpb; rpm-ostree refresh-md -f
- name: temporarily remove conesphere packages for upgrade
community.general.rpm_ostree_pkg:
@@ -57,7 +67,7 @@
- ( "'hardware' not in group_names" ) and ( "'no_reboot' not in group_names" )
- cleanuppackages.changed
ansible.builtin.reboot:
reboot_timeout: 600
reboot_timeout: 900
- name: clear rpm-ostree cache
ansible.builtin.shell:
@@ -77,7 +87,7 @@
- ( "'hardware' not in group_names" ) and ( "'no_reboot' not in group_names" )
- ostreeupgraderslt.rc != 77
ansible.builtin.reboot:
reboot_timeout: 600
reboot_timeout: 900
#### SOURCES SECTION
@@ -202,6 +212,8 @@
- name: install sources packages block
block:
- name: ensure rpm-ostree not buisy
when:
- "'podman' is not in systemddetectvirt.stdout"
ansible.builtin.shell:
cmd: rpm-ostree status
register: rpmostreestatus
@@ -247,6 +259,8 @@
when: sourcepkgs.changed
- name: ensure rpm-ostree not buisy
when:
- "'podman' is not in systemddetectvirt.stdout"
ansible.builtin.shell:
cmd: rpm-ostree status
register: rpmostreestatus
@@ -254,13 +268,13 @@
delay: 20
retries: 20
- name: conditional reboot during cleanup 2
- name: conditional reboot after sources
when:
- ( inventory_hostname != 'localhost' )
- ( "'hardware' not in group_names" ) and ( "'no_reboot' not in group_names" )
- sourcepkgs.changed
ansible.builtin.reboot:
reboot_timeout: 600
reboot_timeout: 900
#### INSTALL SECTION
Loading