Michal Zegan | 551e268 | 2019-06-04 16:57:32 +0200 | [diff] [blame] | 1 | --- |
| 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 }}" |