Update for Ansible 2.17 (3) #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test with Docker | |
on: push | |
jobs: | |
test: | |
name: "Test provisioning" | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# - distro_name: noble # no noble support yet | |
- distro_name: jammy | |
- distro_name: focal | |
runs-on: ubuntu-latest | |
env: | |
COMPOSE_FILE: "-f docker-compose.yml -f tests/docker-compose.${{ matrix.distro_name }}.yml" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Generate SSH key | |
run: sudo tests/make_sshkey.sh | |
- name: Run Ansible | |
run: sudo docker compose ${{ env.COMPOSE_FILE }} run --quiet-pull --rm --env ANSIBLE_FORCE_COLOR=True ansible | |
- name: Check Idempotence | |
shell: bash | |
run: >- | |
sudo docker compose ${{ env.COMPOSE_FILE }} run --rm --env ANSIBLE_FORCE_COLOR=True ansible | tee >(sed "s/\\x1B\\[\\([0-9]\\{1,2\}\\(;[0-9]\\{1,2\\}\\)\\?\\)\\?[mGK]//g" | cat >/tmp/output); | |
cat /tmp/output | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1) |