Skip to content

Commit

Permalink
workflows: Install and use ansible in a virtualenv
Browse files Browse the repository at this point in the history
Signed-off-by: David Galloway <[email protected]>
  • Loading branch information
djgalloway committed Feb 28, 2025
1 parent cf9d52c commit 6d5f8cf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ jobs:
run: |
sudo apt-get update
sudo apt-get purge ansible
sudo apt-get install python3-setuptools
pip3 install ansible --user
sudo apt-get install python3-setuptools python3-virtualenv
virtualenv venv
source ./venv/bin/activate
pip3 install ansible==2.10.7
- name: ansible-playbook syntax check
run: |
export PATH=$PATH:$HOME/.local/bin
sed -i /^vault_password_file/d ansible.cfg
ansible-playbook -i localhost, cephlab.yml --syntax-check
ansible-lint:
Expand All @@ -26,13 +27,14 @@ jobs:
run: |
sudo apt-get update
sudo apt-get purge ansible
sudo apt-get install python3-setuptools
sudo apt-get install python3-setuptools python3-virtualenv
virtualenv venv
source ./venv/bin/activate
# This pinned ansible version should match teuthology's
# requirements.txt.
# And we choose an ansible-lint version to be compatible with this
# Ansible version.
pip3 install ansible==2.10.7 ansible-lint[core]==5.4.0 --user
pip3 install ansible==2.10.7 ansible-lint[core]==5.4.0
- name: Run ansible-lint
run: |
export PATH=$PATH:$HOME/.local/bin
ansible-lint -v roles/*

0 comments on commit 6d5f8cf

Please sign in to comment.