registry_auth.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ---
  2. # This playbook is intended to be included from playbooks/updates/registry_auth.yml
  3. - name: Update registry authentication credentials
  4. hosts: oo_nodes_to_config
  5. tasks:
  6. - import_role:
  7. name: openshift_node
  8. tasks_from: registry_auth.yml
  9. # If there were previously no authenticated registries, the credential file
  10. # won't be mounted in the system container; Need to rerun this step to ensure
  11. # additional mounts are provided.
  12. - import_role:
  13. name: openshift_node
  14. tasks_from: node_system_container_install.yml
  15. when: openshift_is_atomic
  16. # l_reg_auth_restart_hosts is passed in via imageconfig.yml to prevent
  17. # the nodes from restarting because the sync pod will be restarting them
  18. # anyway.
  19. - name: Restart nodes
  20. hosts: "{{ l_reg_auth_restart_hosts | default('oo_nodes_to_config') }}"
  21. serial: "{{ openshift_restart_nodes_serial | default(1) }}"
  22. roles:
  23. - lib_openshift
  24. - openshift_facts
  25. tasks:
  26. - name: restart node
  27. service:
  28. name: "{{ openshift_service_type }}-node"
  29. state: restarted
  30. daemon-reload: yes
  31. - name: Wait for node to be ready
  32. oc_obj:
  33. state: list
  34. kind: node
  35. name: "{{ openshift.node.nodename | lower }}"
  36. register: node_output
  37. delegate_to: "{{ groups.oo_first_master.0 }}"
  38. when: inventory_hostname in groups.oo_nodes_to_config
  39. until:
  40. - node_output.results is defined
  41. - node_output.results.returncode is defined
  42. - node_output.results.results is defined
  43. - node_output.results.returncode == 0
  44. - node_output.results.results[0].status.conditions | selectattr('type', 'match', '^Ready$') | map(attribute='status') | join | bool == True
  45. # Give the node three minutes to come back online.
  46. retries: 36
  47. delay: 5