test-playbooks: avoid warnings with shell/command

Avoids runtime warnings from use of Ansible shell/command module when
executed commands also have ansible modules.

Change-Id: I4e415cbd34f0f4cb15857051bf95458e0316de86
This commit is contained in:
Sorin Sbarnea 2020-05-28 20:46:21 +01:00
parent 1d4ef3e866
commit 5c263fb437
13 changed files with 37 additions and 1 deletions

View File

@ -18,6 +18,7 @@
command: git commit -a -m "test update"
args:
chdir: "{{ zuul.project.src_dir }}"
warn: false
- name: Failed dhall-diff
include_role:

View File

@ -6,8 +6,11 @@
# Simulate workload
- hosts: all
tasks:
# Not using ansible pause module on purpose in order to simulate the load
- name: Simulate workload
shell: "sleep 10"
command: sleep 10
args:
warn: false
- hosts: all
roles:

View File

@ -3,10 +3,14 @@
tasks:
- name: Remove tox package with pip
shell: pip uninstall -y tox
args:
warn: false
become: true
failed_when: false
- name: Remove tox package with pip3
shell: pip3 uninstall -y tox
args:
warn: false
become: true
failed_when: false
- name: Verify tox is not installed

View File

@ -5,3 +5,5 @@
- name: Copy file over zuul-jobs
command: rsync -a new-project/ "{{ zuul.project.src_dir }}/"
args:
warn: false

View File

@ -4,6 +4,8 @@
shell: |
mkdir -p {{ zuul.project.src_dir }}
tar czf {{ zuul.project.src_dir }}/dist.tgz /etc/os-release
args:
warn: false
tasks:
- import_role:
name: fetch-javascript-tarball

View File

@ -8,6 +8,8 @@
shell: |
mkdir -p {{ zuul.project.src_dir }}/doc/build/html
echo "<body>Hello</body>" > {{ zuul.project.src_dir }}/doc/build/html/index.html
args:
warn: false
tasks:
- import_role:

View File

@ -10,6 +10,8 @@
mkdir -p {{ zuul.project.src_dir }}/doc/build/html
echo "%PDF-1.2" > {{ zuul.project.src_dir }}/doc/build/pdf/doc-{{ zuul.project.short_name }}.pdf
echo "<body>Hello</body>" > {{ zuul.project.src_dir }}/doc/build/html/index.html
args:
warn: false
tasks:
- import_role:

View File

@ -22,6 +22,8 @@
command: kubectl wait --for=condition=Ready pod/quaytest --timeout=60s
- name: Check the output of the pod
shell: "kubectl logs pod/quaytest | grep 'Zuul container test'"
args:
warn: false
- name: Run a remote test pod
command: kubectl run --generator=run-pod/v1 --image=docker.io/debian:testing upstream-dockertest --command -- /bin/bash -c 'echo Upstream; sleep infinity'
@ -29,3 +31,5 @@
command: kubectl wait --for=condition=Ready pod/upstream-dockertest --timeout=60s
- name: Check the output of the pod
shell: "kubectl logs pod/upstream-dockertest | grep 'Upstream'"
args:
warn: false

View File

@ -16,6 +16,8 @@
command: kubectl wait --for=condition=Ready pod/dockertest --timeout=60s
- name: Check the output of the pod
shell: "kubectl logs pod/dockertest | grep 'Zuul container test'"
args:
warn: false
- name: Run a remote test pod
command: kubectl run --generator=run-pod/v1 --image=debian:testing upstream-dockertest --command -- /bin/bash -c 'echo Upstream; sleep infinity'

View File

@ -18,6 +18,8 @@
command: oc wait --for=condition=Ready pod/dockertest --timeout=60s
- name: Check the output of the pod
shell: "oc logs pod/dockertest | grep 'Zuul container test'"
args:
warn: false
- name: Run a remote test pod
command: oc run --generator=run-pod/v1 --image=debian:testing upstream-dockertest --command -- /bin/bash -c 'echo Upstream; sleep infinity'
@ -25,3 +27,5 @@
command: oc wait --for=condition=Ready pod/upstream-dockertest --timeout=60s
- name: Check the output of the pod
shell: "oc logs pod/upstream-dockertest | grep 'Upstream'"
args:
warn: false

View File

@ -129,6 +129,8 @@
mkdir -p src/openstack.org/project/fake-sibling &&
touch src/opendev.org/project/fake-sibling/file &&
touch src/openstack.org/project/fake-sibling/file
args:
warn: false
- name: Build docker image
include_role:

View File

@ -3,10 +3,14 @@
tasks:
- name: Remove tox package with pip
shell: pip uninstall -y tox
args:
warn: false
become: true
failed_when: false
- name: Remove tox package with pip3
shell: pip3 uninstall -y tox
args:
warn: false
become: true
failed_when: false
- name: Verify tox is not installed

View File

@ -31,6 +31,8 @@
- name: Get localhost ssh host public key
shell: ssh-keyscan -t rsa localhost
args:
warn: false
register: host_key
tasks:
- name: Get git commit hash for current patch of zuul-jobs
@ -38,6 +40,7 @@
changed_when: false
args:
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
warn: false
register: current_commit
- name: Clone upstream zuul-jobs as a bare repository
@ -71,6 +74,7 @@
changed_when: false
args:
chdir: "{{ test_repo_path }}"
warn: false
register: after_mirror
- name: Assert that the git repositories have the same commit for HEAD