Browse Source

Merge pull request #10329 from vrutkovs/test-ci-update-machines

test/ci: update instances to latest packages / ostree commit
OpenShift Merge Robot 6 năm trước cách đây
mục cha
commit
6ec882d947
1 tập tin đã thay đổi với 28 bổ sung1 xóa
  1. 28 1
      test/ci/launch.yml

+ 28 - 1
test/ci/launch.yml

@@ -75,10 +75,37 @@
   become: true
   tasks:
     - wait_for_connection: {}
-    - setup: {}
     - name: Make sure hostname is set to public ansible host
       hostname:
         name: "{{ ansible_host }}"
+    - name: Detecting Operating System
+      shell: ls /run/ostree-booted
+      ignore_errors: yes
+      failed_when: false
+      register: ostree_output
+    - name: Update all packages
+      package:
+        name: '*'
+        state: latest
+      when: ostree_output.rc != 0
+      register: yum_update
+    - name: Update Atomic system
+      command: atomic host upgrade
+      when: ostree_output.rc == 0
+      register: ostree_update
+    - name: Reboot machines
+      shell: sleep 5 && systemctl reboot
+      async: 1
+      poll: 0
+      ignore_errors: true
+      when: yum_update | changed or ostree_update | changed
+    - name: Wait for connection
+      wait_for_connection:
+        connect_timeout: 20
+        sleep: 5
+        delay: 5
+        timeout: 300
+    - setup: {}
 
 - import_playbook: ../../playbooks/openshift-node/network_manager.yml
 - import_playbook: ../../playbooks/prerequisites.yml