Installation¶
The installation guide covers getting the collection installed on an Ansible controller.
The Getting Started guide covers using the collection to install Dnsmasq.
Prerequisites¶
A Linux system with Python installed to serve as the Ansible controller. It will run the roles to configure the target system.
Install¶
Virtual enviornment¶
Python includes venv. This guide will use it to create a "virtual environment." The collection and its dependencies will be installed into it, which avoids installing everything in the global/system environment.
python -m venv dnsmasq.venv.d
. dnsmasq.venv.d/bin/activate
Note
This is optional but recommended in most cases. However, you can skip this step if the controller system is dedicated to running Ansible.
Dependencies via pip¶
netaddr¶
Install the netaddr library.
The command below will install it via pip
if it is not already present.
python3 -c "import netaddr" 2>/dev/null || pip install netaddr
ansible¶
Likewise, ansible may already be present. The command below will install ansible when it is not already present.
command -v ansible >/dev/null 2>&1 || pip install ansible-core
Collection via Galaxy¶
Ansible includes the ansible-galaxy
tool.
It manages roles and collections in the Ansible Galaxy.
ansible-galaxy collection install amigus.dnsmasq
All-in-one install¶
python3 -m venv dnsmasq.venv.d
. dnsmasq.venv.d/bin/activate
python3 -c "import netaddr" 2>/dev/null || pip install netaddr
command -v ansible >/dev/null 2>&1 || pip install ansible-core
ansible-galaxy collection install amigus.dnsmasq