diff options
author | Gaƫtan <36162164+gaetanfl@users.noreply.github.com> | 2019-02-21 17:59:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-21 17:59:19 +0100 |
commit | ca163d9cd72f520a6c0a28ae613bdc757cfae1e5 (patch) | |
tree | 482fc8a71eb3557088fcaba84c781d8057d58a93 /tasks | |
parent | abde0015f21b63855fb9945040fd1cb77b726381 (diff) | |
parent | e4a83de00793993e9f270569795069e574ce40b4 (diff) | |
download | ansible-clever-ca163d9cd72f520a6c0a28ae613bdc757cfae1e5.tar.gz ansible-clever-ca163d9cd72f520a6c0a28ae613bdc757cfae1e5.tar.zst ansible-clever-ca163d9cd72f520a6c0a28ae613bdc757cfae1e5.zip |
Merge pull request #35 from gaetanfl/use_path_tool
use full path for clever helper invocation
Diffstat (limited to 'tasks')
-rw-r--r-- | tasks/addon.yml | 5 | ||||
-rw-r--r-- | tasks/deploy.yml | 14 | ||||
-rw-r--r-- | tasks/setup.yml | 5 |
3 files changed, 17 insertions, 7 deletions
diff --git a/tasks/addon.yml b/tasks/addon.yml index 91ea4a5..cba5972 100644 --- a/tasks/addon.yml +++ b/tasks/addon.yml | |||
@@ -1,5 +1,8 @@ | |||
1 | - name: Gather addon information for {{ addon.name }} | 1 | - name: Gather addon information for {{ addon.name }} |
2 | shell: "clever env | grep {{ addon.env_prefix }} | sed -e 's/{{ addon.env_prefix }}_//' -e 's/=/: \"/' -e 's/$/\"/' > {{ clever_app_confdir }}/{{ addon.name }}_env.yml" | 2 | shell: > |
3 | clever env | grep {{ addon.env_prefix }} | ||
4 | | sed -e 's/{{ addon.env_prefix }}_//' -e 's/=/: \"/' -e 's/$/\"/' | ||
5 | > {{ clever_app_confdir }}/{{ addon.name }}_env.yml | ||
3 | args: | 6 | args: |
4 | chdir: "{{ clever_app_root }}" | 7 | chdir: "{{ clever_app_root }}" |
5 | environment: | 8 | environment: |
diff --git a/tasks/deploy.yml b/tasks/deploy.yml index b394e55..a2dea71 100644 --- a/tasks/deploy.yml +++ b/tasks/deploy.yml | |||
@@ -1,6 +1,6 @@ | |||
1 | - name: Configure Drain | 1 | - name: Configure Drain |
2 | when: syslog_server is defined or clever_syslog_server is defined | 2 | when: syslog_server is defined or clever_syslog_server is defined |
3 | command: clever-set-drain.sh | 3 | command: "{{ ansible_env.HOME }}/{{ clever_user_path }}clever-set-drain.sh" |
4 | args: | 4 | args: |
5 | chdir: "{{ clever_app_root }}" | 5 | chdir: "{{ clever_app_root }}" |
6 | environment: | 6 | environment: |
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | - name: Configure Domain | 10 | - name: Configure Domain |
11 | when: domain is defined or clever_domain is defined | 11 | when: domain is defined or clever_domain is defined |
12 | command: clever-set-domain.sh | 12 | command: "{{ ansible_env.HOME }}/{{ clever_user_path }}/clever-set-domain.sh" |
13 | args: | 13 | args: |
14 | chdir: "{{ clever_app_root }}" | 14 | chdir: "{{ clever_app_root }}" |
15 | environment: | 15 | environment: |
@@ -80,7 +80,8 @@ | |||
80 | - clever_deploy is failed | 80 | - clever_deploy is failed |
81 | - clever_deploy.stderr is defined | 81 | - clever_deploy.stderr is defined |
82 | 82 | ||
83 | - shell: clever activity | 83 | - name: Retrieve clever activity |
84 | command: clever activity | ||
84 | args: | 85 | args: |
85 | chdir: "{{ clever_app_root }}" | 86 | chdir: "{{ clever_app_root }}" |
86 | environment: | 87 | environment: |
@@ -88,12 +89,15 @@ | |||
88 | changed_when: false | 89 | changed_when: false |
89 | register: clever_activity_result | 90 | register: clever_activity_result |
90 | 91 | ||
91 | - debug: | 92 | - name: Display clever activity |
93 | debug: | ||
92 | var: clever_activity_result.stdout_lines | 94 | var: clever_activity_result.stdout_lines |
93 | 95 | ||
94 | - shell: git show -q --format=format:%H HEAD | 96 | - name: Get current commit sha |
97 | command: git show -q --format=format:%H HEAD | ||
95 | args: | 98 | args: |
96 | chdir: "{{ clever_app_root }}" | 99 | chdir: "{{ clever_app_root }}" |
100 | warn: False | ||
97 | changed_when: false | 101 | changed_when: false |
98 | register: current_commit_sha | 102 | register: current_commit_sha |
99 | 103 | ||
diff --git a/tasks/setup.yml b/tasks/setup.yml index 33b1ff6..3dad790 100644 --- a/tasks/setup.yml +++ b/tasks/setup.yml | |||
@@ -14,8 +14,11 @@ | |||
14 | remote_src: yes | 14 | remote_src: yes |
15 | extra_opts: | 15 | extra_opts: |
16 | - "--strip-components=1" | 16 | - "--strip-components=1" |
17 | src: https://clever-tools.cellar.services.clever-cloud.com/releases/{{ clever_cli_version }}/clever-tools-{{ clever_cli_version }}_linux.tar.gz | 17 | src: "{{ clever_repo }}/{{ clever_cli_version }}/{{ clever_tools_archive }}" |
18 | dest: "{{ ansible_env.HOME }}/{{ clever_user_path }}" | 18 | dest: "{{ ansible_env.HOME }}/{{ clever_user_path }}" |
19 | vars: | ||
20 | clever_repo: https://clever-tools.cellar.services.clever-cloud.com/releases | ||
21 | clever_tools_archive: "{{ clever_cli_version }}/clever-tools-{{ clever_cli_version }}_linux.tar.gz" | ||
19 | when: clever_returned_version is failed or clever_returned_version.stdout != clever_cli_version | 22 | when: clever_returned_version is failed or clever_returned_version.stdout != clever_cli_version |
20 | 23 | ||
21 | - name: Install helper scripts | 24 | - name: Install helper scripts |