diff --git a/inventory/host_vars/f31-test.fedorainfracloud.org b/inventory/host_vars/f31-test.fedorainfracloud.org new file mode 100644 index 0000000000..ec5b30ce02 --- /dev/null +++ b/inventory/host_vars/f31-test.fedorainfracloud.org @@ -0,0 +1,5 @@ +ansible_ssh_user: fedora +ansible_become_user: root +ansible_become: yes +datacenter: aws +inventory_hostname: "f31-test.fedorainfracloud.org" diff --git a/tasks/cloud_setup_basic.yml b/tasks/cloud_setup_basic.yml index 6b1f0be239..95349d638d 100644 --- a/tasks/cloud_setup_basic.yml +++ b/tasks/cloud_setup_basic.yml @@ -69,12 +69,37 @@ tags: - packages +- name: check if file can be created + copy: + content: "" + dest: /etc/sysconfig/global-update-applied + force: no + when: inventory_hostname.startswith(('f31-test')) + tags: + - packages + +- name: remove test file + file: + path: /etc/sysconfig/global-update-applied + state: absent + when: inventory_hostname.startswith(('f31-test')) + tags: + - packages + - name: update all command: dnf -y update creates=/etc/sysconfig/global-update-applied register: updated when: ansible_distribution_major_version|int >= 29 and ansible_distribution == 'Fedora' and ansible_cmdline.ostree is not defined tags: - packages + when: not inventory_hostname.startswith(('f31-test')) + +- name: update all + command: dnf -y + when: inventory_hostname.startswith(('f31-test')) + tags: + - packages + - name: write out global-update-applied file if we updated copy: content="updated" dest=/etc/sysconfig/global-update-applied