scaleup.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ---
  2. - name: Update master count
  3. hosts: oo_masters:!oo_masters_to_config
  4. serial: 1
  5. roles:
  6. - openshift_facts
  7. post_tasks:
  8. - openshift_facts:
  9. role: master
  10. local_facts:
  11. master_count: "{{ openshift_master_count | default(groups.oo_masters | length) }}"
  12. - name: Update master count
  13. modify_yaml:
  14. dest: "{{ openshift.common.config_base}}/master/master-config.yaml"
  15. yaml_key: 'kubernetesMasterConfig.masterCount'
  16. yaml_value: "{{ openshift.master.master_count }}"
  17. notify:
  18. - restart master api
  19. - restart master controllers
  20. handlers:
  21. - name: restart master api
  22. service: name={{ openshift_service_type }}-master-controllers state=restarted
  23. notify: verify api server
  24. # We retry the controllers because the API may not be 100% initialized yet.
  25. - name: restart master controllers
  26. command: "systemctl restart {{ openshift_service_type }}-master-controllers"
  27. retries: 3
  28. delay: 5
  29. register: result
  30. until: result.rc == 0
  31. - name: verify api server
  32. command: >
  33. curl --silent --tlsv1.2
  34. --cacert {{ openshift.common.config_base }}/master/ca-bundle.crt
  35. {{ openshift.master.api_url }}/healthz/ready
  36. args:
  37. # Disables the following warning:
  38. # Consider using get_url or uri module rather than running curl
  39. warn: no
  40. register: api_available_output
  41. until: api_available_output.stdout == 'ok'
  42. retries: 120
  43. delay: 1
  44. changed_when: false
  45. - import_playbook: set_network_facts.yml
  46. - import_playbook: ../../openshift-etcd/private/certificates.yml
  47. - import_playbook: config.yml
  48. - import_playbook: ../../openshift-loadbalancer/private/config.yml
  49. - import_playbook: ../../openshift-node/private/certificates.yml
  50. - import_playbook: ../../openshift-node/private/config.yml