blob: b56318505f97ce134903a81c4060d06dd730df03 [file] [log] [blame]
Michal Zegan551e2682019-06-04 16:57:32 +02001---
2- name: "Ensure {{ app_data_path }} exists"
3 file:
4 path: "{{ app_data_path }}/downloads"
5 state: directory
6 when: not kubectl_install
7
8- name: "Install kubectl-{{ kubectl_version }}"
9 get_url:
10 url: "https://storage.googleapis.com/kubernetes-release/release/v{{ kubectl_version }}/bin/linux/amd64/kubectl"
11 dest: "{{ '/usr/local/bin/kubectl' if kubectl_install else app_data_path+'/downloads/kubectl' }}"
12 # This mode conditional allows checking if kubectl role, when installing kubectl, correctly
13 # adds executable bit (bonus).
14 mode: "{{ 0755 if kubectl_install else omit }}"