summaryrefslogtreecommitdiffstats
path: root/ansible/roles/application-install/tasks
diff options
context:
space:
mode:
authorMichal Ptacek <m.ptacek@partner.samsung.com>2019-03-21 12:32:20 +0000
committerMichal Ptacek <m.ptacek@partner.samsung.com>2019-03-26 09:03:16 +0000
commit200ae72c05772dab23923bc74c88c8691f7224fc (patch)
tree40ed2cc3e83bd790c0c41c5f02ea28a577e68cae /ansible/roles/application-install/tasks
parentf842b36613c91f86dd371b590e048e5c4e510f34 (diff)
Fixing some yaml-lint warnings
Scope of this commit is to fix warnings reported by offline-installer-master-yaml-lint jenkins job Change-Id: Id858a37ce35d53ad1ffd5e5797607faae484ed15 Issue-ID: OOM-1753 Signed-off-by: Michal Ptacek <m.ptacek@partner.samsung.com>
Diffstat (limited to 'ansible/roles/application-install/tasks')
-rw-r--r--ansible/roles/application-install/tasks/custom_role.yml1
-rw-r--r--ansible/roles/application-install/tasks/install.yml21
2 files changed, 19 insertions, 3 deletions
diff --git a/ansible/roles/application-install/tasks/custom_role.yml b/ansible/roles/application-install/tasks/custom_role.yml
index 3c6237e3..b6f6f351 100644
--- a/ansible/roles/application-install/tasks/custom_role.yml
+++ b/ansible/roles/application-install/tasks/custom_role.yml
@@ -6,4 +6,3 @@
when:
- application_custom_role is defined
- application_custom_role is not none
- - application_custom_role | trim != ''
diff --git a/ansible/roles/application-install/tasks/install.yml b/ansible/roles/application-install/tasks/install.yml
index d2134d30..96f66b90 100644
--- a/ansible/roles/application-install/tasks/install.yml
+++ b/ansible/roles/application-install/tasks/install.yml
@@ -4,6 +4,7 @@
{{ helm_bin_dir }}/helm init
--upgrade
--skip-refresh
+ changed_when: true # init is always changed type of action
#A correct way to implement this would be using --wait option in helm init invocation.
#However, it does not work due to https://github.com/helm/helm/issues/4031 (fixed in newer helm release)
@@ -13,22 +14,37 @@
until: result.rc == 0
delay: 10
retries: 12
+ changed_when: false # for idempotency
- name: Get all helm repos
command: "{{ helm_bin_dir }}/helm repo list"
register: repos
+ changed_when: false # for idempotency
- name: Remove stable repo
command: "{{ helm_bin_dir }}/helm repo remove stable"
+ changed_when: true # when executed its a changed type of action
when: "'stable' in repos.stdout"
- name: Helm Serve
shell: "{{ helm_bin_dir }}/helm serve &"
async: 45
- poll: 0
+ poll: 3 # wait 3sec to get a chance for some stderr
+ register: helm_serve
+ changed_when: "'address already in use' not in helm_serve.stderr"
+
+- name: List helm repos
+ command: "{{ helm_bin_dir }}/helm repo list"
+ register: helm_repo_list
+ changed_when: false # for idempotency
+ failed_when:
+ - helm_repo_list.rc > 0
+ - "'Error: no repositories to show' not in helm_repo_list.stderr"
- name: Helm Add Repo
command: "{{ helm_bin_dir }}/helm repo add {{ helm_repository_name }} {{ helm_repository_url }}"
+ when: "'local' not in helm_repo_list.stdout"
+ changed_when: true # when executed its a changed type of action
- name: Build local helm repository
make:
@@ -47,7 +63,7 @@
# WA: this is required because deploy plugin dont process params properly
- name: Create override file with global.cacert
copy:
- dest: "{{ app_data_path}}/override.yaml"
+ dest: "{{ app_data_path }}/override.yaml"
content: |
global:
cacert: |
@@ -66,3 +82,4 @@
{{ helm_repository_name }}/{{ app_helm_chart_name }}
--namespace {{ app_kubernetes_namespace }}
-f {{ app_data_path }}/override.yaml
+ changed_when: true # when executed its a changed type of action