summaryrefslogtreecommitdiffstats
path: root/playbooks/common/openshift-master
diff options
context:
space:
mode:
authorAndrew Butcher <abutcher@redhat.com>2016-02-09 15:13:06 -0500
committerAndrew Butcher <abutcher@redhat.com>2016-02-16 14:21:09 -0500
commit16e1f777e1df9371c4570aed149b29bd4cdc1a6f (patch)
tree35206264f5012a027ea7ec2dec59311342eef82e /playbooks/common/openshift-master
parent89afc792b4c49e926d50b1d99c2a79ce13526285 (diff)
downloadopenshift-16e1f777e1df9371c4570aed149b29bd4cdc1a6f.tar.gz
openshift-16e1f777e1df9371c4570aed149b29bd4cdc1a6f.tar.bz2
openshift-16e1f777e1df9371c4570aed149b29bd4cdc1a6f.tar.xz
openshift-16e1f777e1df9371c4570aed149b29bd4cdc1a6f.zip
Re-arrange scaleup playbooks.
Diffstat (limited to 'playbooks/common/openshift-master')
-rw-r--r--playbooks/common/openshift-master/config.yml4
-rw-r--r--playbooks/common/openshift-master/scaleup.yml57
2 files changed, 61 insertions, 0 deletions
diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml
index 3c2935048..b9d595576 100644
--- a/playbooks/common/openshift-master/config.yml
+++ b/playbooks/common/openshift-master/config.yml
@@ -188,6 +188,10 @@
masters_needing_certs: "{{ hostvars
| oo_select_keys(groups['oo_masters_to_config'] | difference(groups['oo_first_master']))
| oo_filter_list(filter_attr='master_certs_missing') }}"
+ master_hostnames: "{{ hostvars
+ | oo_select_keys(groups['oo_masters_to_config'])
+ | oo_collect('openshift.common.all_hostnames')
+ | oo_flatten | unique }}"
sync_tmpdir: "{{ hostvars.localhost.g_master_mktemp.stdout }}"
roles:
- openshift_master_certificates
diff --git a/playbooks/common/openshift-master/scaleup.yml b/playbooks/common/openshift-master/scaleup.yml
new file mode 100644
index 000000000..36b121d1c
--- /dev/null
+++ b/playbooks/common/openshift-master/scaleup.yml
@@ -0,0 +1,57 @@
+---
+- include: ../openshift-cluster/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
+ roles:
+ - openshift_facts
+ post_tasks:
+ - openshift_facts:
+ role: master
+ local_facts:
+ ha: "{{ openshift_master_ha | default(groups.oo_masters | length > 1) }}"
+ master_count: "{{ openshift_master_count | default(groups.oo_masters | length) }}"
+ - name: Update master count
+ lineinfile:
+ dest: "{{ openshift.common.config_base}}/master/master-config.yaml"
+ regexp: '^ masterCount:.*$'
+ line: " masterCount: {{ openshift.master.master_count }}"
+ notify:
+ - restart master api
+ - restart master controllers
+ handlers:
+ - name: restart master api
+ service: name={{ openshift.common.service_type }}-master-controllers state=restarted
+ notify: verify api server
+ - name: restart master controllers
+ service: name={{ openshift.common.service_type }}-master-controllers state=restarted
+ - 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