scaleup.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ---
  2. - include: ../openshift-cluster/evaluate_groups.yml
  3. - name: Gather facts
  4. hosts: oo_etcd_to_config:oo_masters_to_config:oo_nodes_to_config
  5. roles:
  6. - openshift_facts
  7. - name: Update master count
  8. hosts: oo_masters:!oo_masters_to_config
  9. serial: 1
  10. roles:
  11. - openshift_facts
  12. post_tasks:
  13. - openshift_facts:
  14. role: master
  15. local_facts:
  16. ha: "{{ openshift_master_ha | default(groups.oo_masters | length > 1) }}"
  17. master_count: "{{ openshift_master_count | default(groups.oo_masters | length) }}"
  18. - name: Update master count
  19. modify_yaml:
  20. dest: "{{ openshift.common.config_base}}/master/master-config.yaml"
  21. yaml_key: 'kubernetesMasterConfig.masterCount'
  22. yaml_value: "{{ openshift.master.master_count }}"
  23. notify:
  24. - restart master api
  25. - restart master controllers
  26. handlers:
  27. - name: restart master api
  28. service: name={{ openshift.common.service_type }}-master-controllers state=restarted
  29. notify: verify api server
  30. - name: restart master controllers
  31. service: name={{ openshift.common.service_type }}-master-controllers state=restarted
  32. - name: verify api server
  33. command: >
  34. curl --silent
  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. - name: Configure docker hosts
  51. hosts: oo_masters_to-config:oo_nodes_to_config
  52. vars:
  53. docker_additional_registries: "{{ lookup('oo_option', 'docker_additional_registries') | oo_split }}"
  54. docker_insecure_registries: "{{ lookup('oo_option', 'docker_insecure_registries') | oo_split }}"
  55. docker_blocked_registries: "{{ lookup('oo_option', 'docker_blocked_registries') | oo_split }}"
  56. roles:
  57. - openshift_facts
  58. - openshift_docker
  59. - include: ../openshift-master/config.yml
  60. - include: ../openshift-loadbalancer/config.yml
  61. - include: ../openshift-node/config.yml