update role user_management #26
Workflow file for this run
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: ansible-tests | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
ansible-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Python3 | |
uses: actions/setup-python@v3 | |
- name: Test roles | |
shell: bash | |
run: | | |
roles=(user-management) | |
if ! command -v ansible &>/dev/null; then | |
echo "Ansible seems not to be installed or in '$PATH'" | |
exit 1 | |
fi | |
if ! cp ansible.cfg.example ansible.cfg; then | |
exit 1 | |
fi | |
ansible-galaxy collection install -r requirements.yml | |
ansible-galaxy role install -r requirements.yml | |
for role in ${roles[@]}; do | |
if ! ansible-playbook roles/${role}/tests/test.yml; then | |
exit 2 | |
fi | |
done |