# This playbook installs onto a provisioned cluster
---
- hosts: localhost
  connection: local
  tasks:
  - name: place all scale groups into Ansible groups
    include_role:
      name: openshift_gcp
      tasks_from: setup_scale_group_facts.yml
    vars:
      all_nodes: true

- name: run the init
  import_playbook: ../../init/main.yml

- import_playbook: ../../openshift-checks/private/install.yml

- name: ensure master nodes are ready for bootstrapping
  import_playbook: ../../openshift-node/private/bootstrap.yml

- name: configure the control plane
  import_playbook: ../../common/private/control_plane.yml

- name: run the GCP specific post steps
  import_playbook: install_gcp.yml

- name: install components
  import_playbook: ../../common/private/components.yml

- name: Copy the kubeconfig, used by CI to determine when the containers are ready
  hosts: oo_first_master
  gather_facts: no
  tasks:
  - name: Retrieve cluster configuration
    fetch:
      src: "{{ openshift.common.config_base }}/master/admin.kubeconfig"
      dest: "/tmp/"
      flat: yes
