summaryrefslogtreecommitdiffstats
path: root/playbooks/common/openshift-cluster/scaleup.yml
blob: e4b4564d8f2fe1719860e00addd12b780b9acb26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
- include: evaluate_groups.yml

- name: Configure docker hosts
  hosts: oo_nodes_to_config
  vars:
    docker_additional_registries: "{{ lookup('oo_option', 'docker_additional_registries') | oo_split }}"
    docker_insecure_registries: "{{ lookup('oo_option',  'docker_insecure_registries') | oo_split }}"
    docker_blocked_registries: "{{ lookup('oo_option', 'docker_blocked_registries') | oo_split }}"
  roles:
  - openshift_facts
  - openshift_docker

- include: ../openshift-node/config.yml

- name: Gather facts
  hosts: oo_etcd_to_config:oo_masters_to_config:oo_nodes_to_config
  roles:
  - openshift_facts

- name: Update master count
  hosts: oo_masters:!oo_masters_to_config
  serial: 1
  vars:
    openshift_master_count: "{{ groups.oo_masters | length }}"
  roles:
  - openshift_facts
  post_tasks:
  - name: Update master count
    lineinfile:
      dest: "{{ openshift.common.config_base}}/master/master-config.yaml"
      regexp: '^  masterCount:.*$'
      line: "  masterCount: {{ openshift_master_count }}"
    register: master_config
  - name: Restart master api
    service: name={{ openshift.common.service_type }}-master-api state=restarted
    when: master_config | changed
    notify: Verify api server
  - name: restart master controllers
    service: name={{ openshift.common.service_type }}-master-controllers state=restarted
    when: master_config | changed
  handlers:
  - name: Verify api server
    command: >
      curl -k --head --silent {{ openshift.master.api_url }}
    register: api_available_output
    until: api_available_output.stdout.find("200 OK") != -1
    retries: 120
    delay: 1
    changed_when: false

- include: ../openshift-master/config.yml

- include: ../openshift-node/config.yml