Test gitea project creation playbook
Add an option to run a playbook (in the fake bridge context) after running the base playbook. Use this to run a new playbook which exercises gitea project creation after bootstrapping the gitea service. Disable ansible-lint 304 because it erroneously thinks shell and command are the same thing. Change-Id: I0394b614771bc62b9fe23d811defd7767b3d10db
This commit is contained in:
parent
853b7c2d66
commit
9ff29b108d
@ -513,6 +513,8 @@
|
|||||||
label: ubuntu-bionic
|
label: ubuntu-bionic
|
||||||
- name: gitea01.opendev.org
|
- name: gitea01.opendev.org
|
||||||
label: ubuntu-bionic
|
label: ubuntu-bionic
|
||||||
|
vars:
|
||||||
|
run_base_test_playbook: playbooks/zuul/test-gitea.yaml
|
||||||
host-vars:
|
host-vars:
|
||||||
gitea01.opendev.org:
|
gitea01.opendev.org:
|
||||||
host_copy_output:
|
host_copy_output:
|
||||||
|
@ -69,6 +69,9 @@
|
|||||||
command: ansible localhost -m debug -a 'var=groups'
|
command: ansible localhost -m debug -a 'var=groups'
|
||||||
- name: Run base.yaml
|
- name: Run base.yaml
|
||||||
command: ansible-playbook -v /home/zuul/src/git.openstack.org/openstack-infra/system-config/playbooks/base.yaml
|
command: ansible-playbook -v /home/zuul/src/git.openstack.org/openstack-infra/system-config/playbooks/base.yaml
|
||||||
|
- name: Run test playbook
|
||||||
|
when: run_base_test_playbook is defined
|
||||||
|
shell: "ANSIBLE_ROLES_PATH=/home/zuul/src/git.openstack.org/openstack-infra/system-config/playbooks/roles ansible-playbook -v /home/zuul/src/git.openstack.org/openstack-infra/system-config/{{ run_base_test_playbook }}"
|
||||||
- name: Run testinfra to validate configuration
|
- name: Run testinfra to validate configuration
|
||||||
include_role:
|
include_role:
|
||||||
name: tox
|
name: tox
|
||||||
|
30
playbooks/zuul/test-gitea.yaml
Normal file
30
playbooks/zuul/test-gitea.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
- hosts: "localhost"
|
||||||
|
name: "Setup test project data"
|
||||||
|
vars:
|
||||||
|
projects:
|
||||||
|
- project: opendev/base-jobs
|
||||||
|
description: Zuul configuration common to all OpenDev tenants
|
||||||
|
tasks:
|
||||||
|
- name: Create test project-config directory
|
||||||
|
file:
|
||||||
|
path: "/opt/project-config/gerrit/"
|
||||||
|
state: directory
|
||||||
|
- name: Write test project configuration
|
||||||
|
copy:
|
||||||
|
dest: "/opt/project-config/gerrit/projects.yaml"
|
||||||
|
content: "{{ projects }}"
|
||||||
|
|
||||||
|
- hosts: "gitea"
|
||||||
|
name: "Create repos on gitea servers"
|
||||||
|
strategy: free
|
||||||
|
max_fail_percentage: 1
|
||||||
|
roles:
|
||||||
|
- role: gitea-git-repos
|
||||||
|
|
||||||
|
- hosts: "gitea"
|
||||||
|
tasks:
|
||||||
|
- name: Test project was created in gitea
|
||||||
|
uri:
|
||||||
|
url: "https://localhost:3000/opendev/base-jobs"
|
||||||
|
validate_certs: false
|
||||||
|
status_code: 200
|
3
tox.ini
3
tox.ini
@ -24,7 +24,8 @@ commands =
|
|||||||
# We often deploy latest pip packages
|
# We often deploy latest pip packages
|
||||||
bash -c "find roles playbooks -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
|
bash -c "find roles playbooks -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
|
||||||
ansible-lint -x ANSIBLE0004 -x ANSIBLE0006 -x ANSIBLE0007 -x ANSIBLE0010 \
|
ansible-lint -x ANSIBLE0004 -x ANSIBLE0006 -x ANSIBLE0007 -x ANSIBLE0010 \
|
||||||
-x ANSIBLE0011 -x ANSIBLE0012 -x ANSIBLE0013 -x ANSIBLE0015"
|
-x ANSIBLE0011 -x ANSIBLE0012 -x ANSIBLE0013 -x ANSIBLE0015 \
|
||||||
|
-x 304"
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
Loading…
Reference in New Issue
Block a user