diff options
author | Gaƫtan <36162164+gaetanfl@users.noreply.github.com> | 2018-02-23 18:10:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-23 18:10:48 +0100 |
commit | 4fdd3eb566b8b322789f74990181acc243ffb578 (patch) | |
tree | 4f0e9ffda46afe5e571d7071dd8e08c34a5b8928 /tasks/setup.yml | |
parent | 4882b0d33ce42a3b01ac9689d1809e362f314d3f (diff) | |
parent | 8692bc2704f2a38890c93577e8f6743e611d5308 (diff) | |
download | ansible-clever-4fdd3eb566b8b322789f74990181acc243ffb578.tar.gz ansible-clever-4fdd3eb566b8b322789f74990181acc243ffb578.tar.zst ansible-clever-4fdd3eb566b8b322789f74990181acc243ffb578.zip |
Merge pull request #1 from gaetanfl/first_try
Migrating single tasks file to a galaxy role
Diffstat (limited to 'tasks/setup.yml')
-rw-r--r-- | tasks/setup.yml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tasks/setup.yml b/tasks/setup.yml new file mode 100644 index 0000000..ac9fdcb --- /dev/null +++ b/tasks/setup.yml | |||
@@ -0,0 +1,28 @@ | |||
1 | - name: Check if clever command is available in path and version | ||
2 | command: clever --version | ||
3 | register: clever_returned_version | ||
4 | ignore_errors: true | ||
5 | |||
6 | - name: Ensure user path exists | ||
7 | file: | ||
8 | path: "{{ ansible_env.HOME }}/{{ clever_user_path }}" | ||
9 | state: directory | ||
10 | |||
11 | - name: Download and install clever cli tools if necessary | ||
12 | unarchive: | ||
13 | remote_src: yes | ||
14 | extra_opts: | ||
15 | - "--strip-components=1" | ||
16 | src: https://clever-tools.cellar.services.clever-cloud.com/releases/{{ clever_cli_version }}/clever-tools-{{ clever_cli_version }}_linux.tar.gz | ||
17 | dest: "{{ ansible_env.HOME }}/{{ clever_user_path }}" | ||
18 | when: clever_returned_version|failed or clever_returned_version.stdout != clever_cli_version | ||
19 | |||
20 | - name: Install helper scripts | ||
21 | copy: | ||
22 | src: "{{ item }}" | ||
23 | dest: "{{ ansible_env.HOME }}/{{ clever_user_path }}/{{ item }}" | ||
24 | mode: 0755 | ||
25 | with_items: | ||
26 | - clever-set-domain.sh | ||
27 | - clever-set-drain.sh | ||
28 | - clever-wait-deploy.sh | ||