A personal collection of ansible tasks and roles
## Debian/Ubuntu
sudo apt install -y python3 python3-virtualenv python3-virtualenv-clone
## Fedora
sudo dnf install -y python3 python3-virtualenv python3-virtualenv-clone
Create virtual environment for unix OS
./init.sh
Run molecule test for a role
./test role-default.yml
Create requirement file
touch requirements.yml
---
collections:
- name: git@github.com:gpproton/ansible-collections.git
type: git
version: main
install with:
ansible-galaxy install --force -r requirements.yml
## Bash tweaks
Fix bash completion
```shell
case "$SHELL" in
*bash*)
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
;;
esac