feat!(tasks): move tasks to include; move dependencies installation to a task;...

This commit is contained in:
NaeiKinDus 2025-01-26 22:52:14 +00:00
parent 846f5e693e
commit 35d72db683
8 changed files with 161 additions and 103 deletions

45
tasks/setup_linux.yml Normal file
View file

@ -0,0 +1,45 @@
version: '3'
tasks:
requirements:
desc: install required packages
cmds:
- |
sudo apt install --no-install-recommends --assume-yes \
coreutils \
curl \
libcurl4-openssl-dev \
python3-virtualenv \
python3-dev
venv:
desc: install a Python3 virtualenv and all the required ansible / molecule dependencies.
cmds:
- |
rm -rf ./.venv || true
python3 -m virtualenv --download ./.venv
./.venv/bin/python3 -m pip install --upgrade -r requirements.txt
status:
- test -d ./.venv
ansible:
desc: create or update an ansible.cfg file
cmds:
- ./scripts/generate_ansible_config.sh -o ansible.cfg
status:
- test -f ansible.cfg
galaxy:
desc: install ansible galaxy collections
cmds:
- "{{.PYTHON_WRAPPER}} ansible-galaxy collection install -r ansible_galaxy-requirements.yml"
dev:
desc: install required packages to run molecule, vagrant and other dev tools
cmds:
- ./scripts/setup_dev_env.sh
preconditions:
- sh: test -f ./.venv/bin/python3
msg: virtualenv must be set up first
- sh: test -x /usr/sbin/nft
msg: "nftables is required (tested bin path: /usr/sbin/nft)"