123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- ---
- - name: Ensure that all non-node hosts are accessible
- hosts: oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config:oo_nfs_to_config
- any_errors_fatal: true
- tasks:
- - name: Initialize basic host facts
- # l_init_fact_hosts is passed in via play during control-plane-only
- # upgrades and scale-up plays; otherwise oo_all_hosts is used.
- hosts: "{{ l_init_fact_hosts | default('oo_all_hosts') }}"
- tasks:
- - name: Detect OS Variant from /etc/os-release
- fail:
- msg: Atomic Host installations are no longer supported
- when: lookup('ini', 'VARIANT_ID type=properties file=/etc/os-release') == 'atomic.host'
- # TODO(michaelgugino) remove this line once CI is updated.
- - name: set openshift_deployment_type if unset
- set_fact:
- openshift_deployment_type: "{{ deployment_type }}"
- openshift_is_atomic: False
- when:
- - openshift_deployment_type is undefined
- - deployment_type is defined
- - name: Read API URL from infra config
- hosts: "{{ l_init_fact_hosts | default('nodes') }}"
- tasks:
- - name: Read cluster config
- k8s_facts:
- kubeconfig: "{{ kubeconfig_path }}"
- kind: Infrastructure
- name: cluster
- register: clustercfg
- when: kubeconfig_path is defined
- until:
- - clustercfg.resources is defined
- - clustercfg.resources | length > 0
- - clustercfg.resources[0].status is defined
- - clustercfg.resources[0].status.apiServerURL is defined
- retries: 36
- delay: 5
- delegate_to: localhost
- - name: Set fact openshift_api_prefix
- set_fact:
- openshift_api_prefix: "{{ clustercfg.resources[0].status.apiServerURL.split(':')[0:-1] | join(':') }}"
- - name: Set worker openshift_bootstrap_endpoint if not already defined
- hosts: "{{ l_init_fact_hosts | default('nodes') }}:!masters:!bootstrap"
- tasks:
- - set_fact:
- openshift_bootstrap_endpoint: "{{ openshift_api_prefix }}:22623/config/worker"
- when:
- - kubeconfig_path is defined
- - openshift_bootstrap_endpoint is not defined
- - name: Set master openshift_bootstrap_endpoint if not already defined
- hosts: "{{ l_init_fact_hosts | default('nodes') }}:&masters"
- tasks:
- - set_fact:
- openshift_bootstrap_endpoint: "{{ openshift_api_prefix }}:22623/config/master"
- when:
- - kubeconfig_path is defined
- - openshift_bootstrap_endpoint is not defined
- - name: Read in openshift-install
- hosts: "{{ l_init_fact_hosts | default('nodes') }}"
- tasks:
- - slurp:
- src: "{{ openshift_install_config_path }}"
- register: openshift_install_config_reg
- delegate_to: localhost
- when: openshift_install_config_path is defined
- - name: 'set openshift_install_config if path is defined'
- set_fact:
- openshift_install_config: "{{ openshift_install_config_reg['content'] | b64decode | from_yaml }}"
- when: openshift_install_config_path is defined
- - name: Set worker openshift_bootstrap_endpoint if not already defined
- hosts: "{{ l_init_fact_hosts | default('nodes') }}:!masters:!bootstrap"
- tasks:
- - set_fact:
- openshift_bootstrap_endpoint: "https://api.{{ openshift_install_config['metadata']['name'] }}.{{ openshift_install_config['baseDomain'] }}:22623/config/worker"
- when:
- - openshift_install_config_path is defined
- - openshift_bootstrap_endpoint is not defined
- - name: Set master openshift_bootstrap_endpoint if not already defined
- hosts: "{{ l_init_fact_hosts | default('nodes') }}:&masters"
- tasks:
- - set_fact:
- openshift_bootstrap_endpoint: "https://api.{{ openshift_install_config['metadata']['name'] }}.{{ openshift_install_config['baseDomain'] }}:22623/config/master"
- when:
- - openshift_install_config_path is defined
- - openshift_bootstrap_endpoint is not defined
|