summaryrefslogtreecommitdiffstats
path: root/ansible/rancher_kubernetes.yml
blob: 196f1fc2d939ce008ed714de9ec8e04b6486c9aa (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
---
- name: Install binaries for controlling deployment
  hosts: infrastructure
  roles:
    - kubectl
    - helm

- name: Deploy rancher server and create k8s env
  hosts: infrastructure
  roles:
    - rancher
  vars:
     rancher_role: server

- name: Deploy rancher agents
  hosts: kubernetes
  roles:
    - rancher
  vars:
     rancher_role: agent

- name: Wait for Kubernetes environment to be healthy
  hosts: infrastructure
  tasks:
  - name: Check cluster health
    uri:
      url: "{{ rancher_server_url }}/v2-beta/projects/{{ k8s_env_id }}"
    register: env_info
    retries: 30
    delay: 15
    until: "env_info.json.healthState == 'healthy'"