summaryrefslogtreecommitdiffstats
path: root/ansible/roles/rke/tasks/rke_deploy.yml
blob: 7b36f55d7def70ceb09a609c1bb3599df08360e9 (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
---
- name: "Check if rke is deployed"
  command: "rke version"
  args:
    chdir: "{{ cluster_config_dir }}"
  failed_when: false
  changed_when: false
  register: rke_deployed

- name: Run rke up
  command: "{{ rke_bin_dir }}/rke up --config cluster.yml"
  args:
    chdir: "{{ cluster_config_dir }}"
  when: rke_deployed.rc != 0 or cluster_yml.changed  # noqa 503

- name: Ensure .kube directory is present
  file:
    path: "{{ kube_config_dir }}"
    state: directory

- name: Setup kubeconfig
  copy:
    src: "{{ cluster_config_dir }}/kube_config_cluster.yml"
    dest: "{{ kube_config_dir }}/config"
    remote_src: true
    mode: 0755