diff options
Diffstat (limited to 'deployment/noheat/cluster-rke/ansible/roles/setup_k8s/tasks')
-rw-r--r-- | deployment/noheat/cluster-rke/ansible/roles/setup_k8s/tasks/main.yml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/deployment/noheat/cluster-rke/ansible/roles/setup_k8s/tasks/main.yml b/deployment/noheat/cluster-rke/ansible/roles/setup_k8s/tasks/main.yml new file mode 100644 index 000000000..53d7b8167 --- /dev/null +++ b/deployment/noheat/cluster-rke/ansible/roles/setup_k8s/tasks/main.yml @@ -0,0 +1,33 @@ +- name: Download RKE + get_url: + url: "https://github.com/rancher/rke/releases/download/v{{ rke_version }}/rke_linux-amd64" + dest: "{{ ansible_user_dir }}/rke" + mode: '0700' + +- name: Prepare RKE configuration + template: + src: "cluster.yml.j2" + dest: "{{ ansible_user_dir }}/cluster.yml" + mode: '0400' + +- name: Run RKE + command: + cmd: "./rke up" + chdir: "{{ ansible_user_dir }}" + creates: "{{ ansible_user_dir }}/kube_config_cluster.yml" + +- name: Create k8s directory + file: + name: "{{ ansible_user_dir }}/.kube" + state: directory + mode: '0700' + +- name: Set k8s config + command: "mv {{ ansible_user_dir }}/kube_config_cluster.yml {{ ansible_user_dir }}/.kube/config" + +- name: Get kubectl + become: yes + get_url: + url: "https://dl.k8s.io/release/{{ k8s_version.split('-')[0] }}/bin/linux/amd64/kubectl" + dest: "/usr/local/bin/" + mode: '0555' |