Fixed the tox errors for ansible-lint, shellcheck, yamllint
Change-Id: Ibf024b44b2a82c7248877fbc2f022b7fd15e882a
diff --git a/playbooks/roles/prepare-testframework-offline/tasks/prepare-xtesting-healthcheck.yaml b/playbooks/roles/prepare-testframework-offline/tasks/prepare-xtesting-healthcheck.yaml
index 60cb734..f62662b 100644
--- a/playbooks/roles/prepare-testframework-offline/tasks/prepare-xtesting-healthcheck.yaml
+++ b/playbooks/roles/prepare-testframework-offline/tasks/prepare-xtesting-healthcheck.yaml
@@ -54,20 +54,26 @@
become: true
- name: Get the list of ONAP componants installed and enabled in the setup
- shell: "helm ls --deployed --namespace onap -c --output yaml | grep Name: | sed 's/.* //g' | awk -F '-' '{print $2}' | egrep -v '{{ healthcheck_test_ignore_list }}' | awk /./ | sed -e 's/^/- health-/'" # noqa 204
+ shell: |
+ set -o pipefail && \
+ helm ls --deployed --namespace onap -c --output yaml | grep Name: | sed 's/.* //g' | awk -F '-' '{print $2}' | egrep -v '{{ healthcheck_test_ignore_list }}' | awk /./ | sed -e 's/^/- health-/' # noqa 204
+ args:
+ executable: "/bin/bash"
+ changed_when: false
register: onap_enabled_services
+
- name: Generate testcases.yaml file
template:
src: healthcheck-testcases.yaml.j2
dest: "{{ testfw_configdir }}/testcases.yaml"
-- name: Create cmd.sh file
+- name: Create cmd.sh file
copy:
dest: "{{ testfw_configdir }}/cmd.sh"
content: |
#!/bin/sh
- run_tests -t ${TAG} || true
+ run_tests -t ${TAG} || true
- name: Delete existing {{ healthcheck_cm_testcases }}
k8s:
@@ -84,19 +90,31 @@
api_version: v1
state: absent
namespace: onap
-
+
- name: Create ConfigMap - {{ healthcheck_cm_testcases }}
- shell: kubectl -n {{ onap_namespace }} create configmap {{ healthcheck_cm_testcases }} --from-file "{{ testfw_configdir }}/testcases.yaml"
+ shell: |
+ kubectl -n {{ onap_namespace }} create configmap {{ healthcheck_cm_testcases }} --from-file "{{ testfw_configdir }}/testcases.yaml"
+ args:
+ executable: "/bin/bash"
+ changed_when: false
- name: Create ConfigMap - {{ healthcheck_cm_run }}
- shell: kubectl -n {{ onap_namespace }} create configmap {{ healthcheck_cm_run }} --from-file "{{ testfw_configdir }}/cmd.sh"
+ shell: |
+ kubectl -n {{ onap_namespace }} create configmap {{ healthcheck_cm_run }} --from-file "{{ testfw_configdir }}/cmd.sh"
+ args:
+ executable: "/bin/bash"
+ changed_when: false
# eprasad: there is bug in ansible k8s module, removing a job doest not remove pods assisated with it hence using shell here.
- name: Delete healthcheck job
- shell: "kubectl -n {{ onap_namespace }} delete job xtesting-onap-{{ healthcheck_test_tier }}"
- ignore_errors: yes
+ shell: |
+ "kubectl -n {{ onap_namespace }} delete job xtesting-onap-{{ healthcheck_test_tier }}"
+ args:
+ executable: "/bin/bash"
+ changed_when: false
+ ignore_errors: yes # yamllint disable-line rule:truthy
- name: Construct and save healthcheck testsuite deployment to file
template: