]> git.immae.eu Git - github/fretlink/ansible-clever.git/blame - tasks/setup.yml
use full path for clever helper invocation
[github/fretlink/ansible-clever.git] / tasks / setup.yml
CommitLineData
f7dd5848
GD
1- name: Check if clever command is available in path and version
2 command: clever --version
3 register: clever_returned_version
8692bc27 4 ignore_errors: true
7485b189 5 changed_when: False
f7dd5848
GD
6
7- name: Ensure user path exists
8 file:
9 path: "{{ ansible_env.HOME }}/{{ clever_user_path }}"
10 state: directory
11
12- name: Download and install clever cli tools if necessary
13 unarchive:
14 remote_src: yes
8692bc27
GD
15 extra_opts:
16 - "--strip-components=1"
f7dd5848
GD
17 src: https://clever-tools.cellar.services.clever-cloud.com/releases/{{ clever_cli_version }}/clever-tools-{{ clever_cli_version }}_linux.tar.gz
18 dest: "{{ ansible_env.HOME }}/{{ clever_user_path }}"
1561a170 19 when: clever_returned_version is failed or clever_returned_version.stdout != clever_cli_version
f7dd5848
GD
20
21- name: Install helper scripts
22 copy:
23 src: "{{ item }}"
24 dest: "{{ ansible_env.HOME }}/{{ clever_user_path }}/{{ item }}"
8692bc27 25 mode: 0755
f7dd5848
GD
26 with_items:
27 - clever-set-domain.sh
28 - clever-set-drain.sh