scaleup.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. ha: "{{ openshift_master_ha | default(groups.oo_masters | length > 1) }}"
  12. master_count: "{{ openshift_master_count | default(groups.oo_masters | length) }}"
  13. - name: Update master count
  14. modify_yaml:
  15. dest: "{{ openshift.common.config_base}}/master/master-config.yaml"
  16. yaml_key: 'kubernetesMasterConfig.masterCount'
  17. yaml_value: "{{ openshift.master.master_count }}"
  18. notify:
  19. - restart master api
  20. - restart master controllers
  21. handlers:
  22. - name: restart master api
  23. service: name={{ openshift.common.service_type }}-master-controllers state=restarted
  24. notify: verify api server
  25. # We retry the controllers because the API may not be 100% initialized yet.
  26. - name: restart master controllers
  27. command: "systemctl restart {{ openshift.common.service_type }}-master-controllers"
  28. retries: 3
  29. delay: 5
  30. register: result
  31. until: result.rc == 0
  32. - name: verify api server
  33. command: >
  34. curl --silent --tlsv1.2
  35. {% if openshift.common.version_gte_3_2_or_1_2 | bool %}
  36. --cacert {{ openshift.common.config_base }}/master/ca-bundle.crt
  37. {% else %}
  38. --cacert {{ openshift.common.config_base }}/master/ca.crt
  39. {% endif %}
  40. {{ openshift.master.api_url }}/healthz/ready
  41. args:
  42. # Disables the following warning:
  43. # Consider using get_url or uri module rather than running curl
  44. warn: no
  45. register: api_available_output
  46. until: api_available_output.stdout == 'ok'
  47. retries: 120
  48. delay: 1
  49. changed_when: false
  50. - include: ../openshift-master/set_network_facts.yml
  51. - include: ../openshift-etcd/certificates.yml
  52. - include: ../openshift-master/config.yml
  53. - include: ../openshift-loadbalancer/config.yml
  54. - include: ../openshift-node/certificates.yml
  55. - include: ../openshift-node/config.yml