openvswitch_system_container.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. ---
  2. - name: Pre-pull OpenVSwitch system container image
  3. command: >
  4. atomic pull --storage=ostree {{ openshift.common.system_images_registry }}/{{ openshift.node.ovs_system_image }}:{{ openshift_image_tag }}
  5. register: pull_result
  6. changed_when: "'Pulling layer' in pull_result.stdout"
  7. - name: Check OpenvSwitch system container package
  8. command: >
  9. atomic containers list --no-trunc -a -f container=openvswitch
  10. register: result
  11. - name: Update OpenvSwitch system container package
  12. command: >
  13. atomic containers update openvswitch
  14. register: update_result
  15. changed_when: "'Extracting' in update_result.stdout"
  16. when:
  17. - l_is_same_version
  18. - ("openvswitch" in result.stdout) | bool
  19. - name: Uninstall OpenvSwitch system container package
  20. command: >
  21. atomic uninstall openvswitch
  22. failed_when: False
  23. when:
  24. - not l_is_same_version
  25. - ("openvswitch" in result.stdout) | bool
  26. - name: Install OpenvSwitch system container package
  27. command: >
  28. atomic install --system --name=openvswitch {{ openshift.common.system_images_registry }}/{{ openshift.node.ovs_system_image }}:{{ openshift_image_tag }}
  29. when:
  30. - not l_is_same_version or ("openvswitch" not in result.stdout) | bool
  31. notify:
  32. - restart docker