From 6efea7a8c1740a1529c8652fbbfe415ed9fa6bf5 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Mon, 4 Mar 2019 00:36:11 -0500 Subject: [PATCH] Use multiple run playbooks for windmill jobs This breaks out the specific things we need to do for testing, into their own playbook runs. Change-Id: I50964b393bc4c5977d7f59e9c4bac48c1ea405ac Signed-off-by: Paul Belanger --- .zuul.d/jobs.yaml | 5 ++++- tests/playbooks/run-post.yaml | 7 +++++++ tests/playbooks/run-pre.yaml | 7 +++++++ tests/playbooks/run.yaml | 10 ---------- 4 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 tests/playbooks/run-post.yaml create mode 100644 tests/playbooks/run-pre.yaml diff --git a/.zuul.d/jobs.yaml b/.zuul.d/jobs.yaml index 339a17a..95113b7 100644 --- a/.zuul.d/jobs.yaml +++ b/.zuul.d/jobs.yaml @@ -3,7 +3,10 @@ name: windmill-base parent: unittests pre-run: tests/playbooks/pre.yaml - run: tests/playbooks/run.yaml + run: + - tests/playbooks/run-pre.yaml + - tests/playbooks/run.yaml + - tests/playbooks/run-post.yaml post-run: tests/playbooks/post.yaml required-projects: - openstack/ansible-role-ansible diff --git a/tests/playbooks/run-post.yaml b/tests/playbooks/run-post.yaml new file mode 100644 index 0000000..922d649 --- /dev/null +++ b/tests/playbooks/run-post.yaml @@ -0,0 +1,7 @@ +--- +- hosts: all + tasks: + - name: Run ansible-playbook for prove.yaml + args: + chdir: "{{ windmill_src_dir }}" + shell: "tox -evenv -- ansible-playbook -i {{ ansible_user_dir }}/{{ windmill_src_dir }}/inventory/testing/hosts playbooks/prove.yaml" diff --git a/tests/playbooks/run-pre.yaml b/tests/playbooks/run-pre.yaml new file mode 100644 index 0000000..af73cd0 --- /dev/null +++ b/tests/playbooks/run-pre.yaml @@ -0,0 +1,7 @@ +--- +- hosts: all + tasks: + - name: Setup SSH host keys for ansible + args: + chdir: "{{ windmill_src_dir }}" + shell: "tox -evenv -- ansible-playbook -i {{ ansible_user_dir }}/{{ windmill_src_dir }}/inventory/testing/hosts tests/playbooks/bastion/site.yaml" diff --git a/tests/playbooks/run.yaml b/tests/playbooks/run.yaml index 0b6ad47..d94f0c1 100644 --- a/tests/playbooks/run.yaml +++ b/tests/playbooks/run.yaml @@ -1,11 +1,6 @@ --- - hosts: all tasks: - - name: Setup SSH host keys for ansible - args: - chdir: "{{ windmill_src_dir }}" - shell: "tox -evenv -- ansible-playbook -i {{ ansible_user_dir }}/{{ windmill_src_dir }}/inventory/testing/hosts tests/playbooks/bastion/site.yaml" - - name: Bootstrap all nodes using windmill-ops args: chdir: "{{ zuul.projects['git.openstack.org/openstack/windmill-ops'].src_dir }}" @@ -15,8 +10,3 @@ args: chdir: "{{ windmill_src_dir }}" shell: "tox -evenv -- ansible-playbook -v -f1 -i {{ ansible_user_dir }}/{{ windmill_src_dir }}/inventory/testing/hosts playbooks/site.yaml -e @{{ windmill_extra_vars_file }}" - - - name: Run ansible-playbook for prove.yaml - args: - chdir: "{{ windmill_src_dir }}" - shell: "tox -evenv -- ansible-playbook -i {{ ansible_user_dir }}/{{ windmill_src_dir }}/inventory/testing/hosts playbooks/prove.yaml"