aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/setup.yml
blob: 49e91ca7beb99ac30fe4448ed5737c099dfa18a7 (plain) (blame)
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: Check if clever command is available in path and version
  command: clever --version
  register: clever_returned_version
  ignore_error: true

- name: Ensure user path exists
  file:
    path: "{{ ansible_env.HOME }}/{{ clever_user_path }}"
    state: directory

- name: Download and install clever cli tools if necessary
  unarchive:
    remote_src: yes
    src: https://clever-tools.cellar.services.clever-cloud.com/releases/{{ clever_cli_version }}/clever-tools-{{ clever_cli_version }}_linux.tar.gz
    dest: "{{ ansible_env.HOME }}/{{ clever_user_path }}"
  when: clever_returned_version|failed or clever_returned_version.stdout != clever_cli_version

- name: Install helper scripts
  copy:
    src: "{{ item }}"
    dest: "{{ ansible_env.HOME }}/{{ clever_user_path }}/{{ item }}"
  with_items:
    - clever-set-domain.sh
    - clever-set-drain.sh
    - clever-wait-deploy.sh