diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..5701dfd --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,27 @@ +--- +name: On Pull Request + +on: + workflow_dispatch: + pull_request: + types: [opened, reopened] + +jobs: + run-ansible: + + runs-on: ubuntu-latest + + env: + ANSIBLE_FORCE_COLOR: True + + steps: + - uses: actions/checkout@v4 + + - name: Install pip dependencies + run: | + pip install -r test-requirements.txt + + - name: Run playbook + run: > + ansible-playbook -i ansible/inventory ansible/run.yml + diff --git a/ansible/inventory/hosts b/ansible/inventory/hosts new file mode 100644 index 0000000..2302eda --- /dev/null +++ b/ansible/inventory/hosts @@ -0,0 +1 @@ +localhost ansible_connection=local diff --git a/ansible/run.yml b/ansible/run.yml new file mode 100644 index 0000000..a1ac080 --- /dev/null +++ b/ansible/run.yml @@ -0,0 +1,12 @@ +--- +- name: Ensure Zuul is configured + gather_facts: false + hosts: localhost + + tasks: + - name: Ensure Zuul namespace is created + kubernetes.core.k8s: + name: zuul + api_version: v1 + kind: Namespace + state: present