registry_auth.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. # l_reg_auth_restart_hosts is passed in via imageconfig.yml to prevent
  10. # the nodes from restarting because the sync pod will be restarting them
  11. # anyway.
  12. - name: Restart nodes
  13. hosts: "{{ l_reg_auth_restart_hosts | default('oo_nodes_to_config') }}"
  14. serial: "{{ openshift_restart_nodes_serial | default(1) }}"
  15. roles:
  16. - lib_openshift
  17. - openshift_facts
  18. tasks:
  19. - name: restart node
  20. service:
  21. name: "{{ openshift_service_type }}-node"
  22. state: restarted
  23. daemon-reload: yes
  24. - name: Wait for node to be ready
  25. oc_obj:
  26. state: list
  27. kind: node
  28. name: "{{ openshift.node.nodename | lower }}"
  29. register: node_output
  30. delegate_to: "{{ groups.oo_first_master.0 }}"
  31. when: inventory_hostname in groups.oo_nodes_to_config
  32. until:
  33. - node_output.results is defined
  34. - node_output.results.returncode is defined
  35. - node_output.results.results is defined
  36. - node_output.results.returncode == 0
  37. - node_output.results.results[0].status.conditions | selectattr('type', 'match', '^Ready$') | map(attribute='status') | join | bool == True
  38. # Give the node three minutes to come back online.
  39. retries: 36
  40. delay: 5