summaryrefslogtreecommitdiffstats
path: root/ansible/test/roles/prepare-rke/tasks/infra.yml
blob: 0a0b9273aa169d938f34853583228fe2fc255667 (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
---
- name: "Ensure {{ app_data_path }} exists"
  file:
    path: "{{ app_data_path }}/downloads"
    state: directory

- name: "Create rke binary wrapper"
  template:
    src: rke.j2
    dest: "{{ app_data_path }}/downloads/rke_linux-amd64"
    mode: 0755

- name: "Install rke-{{ rke_version }}"
  command: "curl --connect-timeout 10 -L https://github.com/rancher/rke/releases/download/v{{ rke_version }}/rke_linux-amd64 -o {{ app_data_path }}/downloads/rke_linux-amd64_real"
  register: result
  retries: 10
  delay: 1
  until: not result.failed
  args:
    warn: false

- name: "Ensure downloaded rke binary has correct file mode"
  file:
    path: "{{ app_data_path }}/downloads/rke_linux-amd64_real"
    mode: 0755