Skip to content

🚀 Getting Started

👷 Prerequisites

Before you can use Ansible to manage your hosts, you need to ensure that Python 3 is installed on them. For Debian-based systems, you can install it with the following command:

sudo apt update && sudo apt install -y python3

📦 Install dependencies

This project uses Task to manage dependencies. To install all the necessary dependencies, run the following command:

task deps
sudo apt install -y pipx
pipx install --include-deps ansible
pipx inject ansible ansible-lint
ansible-galaxy role install -r requirements.yaml
ansible-galaxy collection install -r requirements.yaml

This command will:

  • Install pipx and ensure its paths are configured.
  • Upgrade all pipx managed packages.
  • Install Ansible roles from requirements.yaml.
  • Install Ansible collections from requirements.yaml.

🔑 Generate a new password

To create a new vault password file, use the task init command:

task init
openssl rand -hex 64 > .vault_pass
chmod 600 .vault_pass    

This will create a .vault_pass file in the root directory. This file should be kept secret and is used to encrypt/decrypt sensitive variables. The .vault_pass file is encrypted using SOPS.

🔐 Edit secrets

To edit the secrets file, use the following command:

task ve
ansible-vault edit ./inventory/group_vars/all.yaml

This will open the inventory/group_vars/all.yaml file in your default editor. This file is encrypted with Ansible Vault.

For more information on managing secrets, see the Secrets guide.