Skip to content

ansible_test

ansible_test #146

Workflow file for this run

name: ansible_test
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * *'
jobs:
test:
strategy:
matrix:
platform: [
ubuntu-latest,
macos-latest
]
runs-on: ${{ matrix.platform }}
env:
ANSIBLE_FORCE_COLOR: 1
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Run make
run: make
- name: Idempotence Test
run: |
ansible-playbook -v -e "ansible_user=$(whoami)" ./dev-provisioning.yaml | tee idempotence-out-${{ matrix.platform }}.txt \
| grep -q 'changed=0.*failed=0' \
&& (echo 'Idempotence test: pass' && exit 0) \
|| (echo 'Idempotence test: fail' && exit 1)
- name: Archive Idempotence Test output
if: always()
uses: actions/upload-artifact@v4
with:
name: idempotence-out-${{ matrix.platform }}
path: idempotence-out-${{ matrix.platform }}.txt
# - name: Check Ansible connection plugins
# if: always()
# run: ansible-doc -t connection -l