summaryrefslogtreecommitdiffstats
path: root/ansible/test/roles/prepare-kubectl/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/test/roles/prepare-kubectl/tasks/main.yml')
-rw-r--r--ansible/test/roles/prepare-kubectl/tasks/main.yml14
1 files changed, 14 insertions, 0 deletions
diff --git a/ansible/test/roles/prepare-kubectl/tasks/main.yml b/ansible/test/roles/prepare-kubectl/tasks/main.yml
new file mode 100644
index 00000000..b5631850
--- /dev/null
+++ b/ansible/test/roles/prepare-kubectl/tasks/main.yml
@@ -0,0 +1,14 @@
+---
+- name: "Ensure {{ app_data_path }} exists"
+ file:
+ path: "{{ app_data_path }}/downloads"
+ state: directory
+ when: not kubectl_install
+
+- name: "Install kubectl-{{ kubectl_version }}"
+ get_url:
+ url: "https://storage.googleapis.com/kubernetes-release/release/v{{ kubectl_version }}/bin/linux/amd64/kubectl"
+ dest: "{{ '/usr/local/bin/kubectl' if kubectl_install else app_data_path+'/downloads/kubectl' }}"
+ # This mode conditional allows checking if kubectl role, when installing kubectl, correctly
+ # adds executable bit (bonus).
+ mode: "{{ 0755 if kubectl_install else omit }}"