Skip to content

Installation

The collection is installed from its Git repository. It is not published on Ansible Galaxy.

Create a requirements.yml next to your playbooks:

collections:
- name: https://github.com/NoiXdev/ansible-collection-infra.git
type: git
version: v0.4.0

Install it:

Terminal window
ansible-galaxy collection install -r requirements.yml

ansible-galaxy also installs the collections noixdev.infra depends on (community.docker, ansible.posix and community.general). Afterwards the roles are available under the fully qualified names noixdev.infra.base, noixdev.infra.docker and so on.

The version field takes a Git tag, a branch or a commit. Use a release tag such as v0.4.0 in anything you rely on. A branch name like main moves with every commit, so two runs a week apart can behave differently.

To move to a new release, change the tag, read the changelog, and run the install again with --force:

Terminal window
ansible-galaxy collection install -r requirements.yml --force

Without --force an already installed collection is left as it is.

For a quick try without a requirements file:

Terminal window
ansible-galaxy collection install git+https://github.com/NoiXdev/ansible-collection-infra.git,v0.4.0
Terminal window
ansible-galaxy collection list noixdev.infra

The output shows the installed version. Inspect a role’s variables with ansible-doc:

Terminal window
ansible-doc -t role noixdev.infra.base

Clone the repository, check out the tag, and install from the directory:

Terminal window
git clone --branch v0.4.0 https://github.com/NoiXdev/ansible-collection-infra.git
ansible-galaxy collection install ./ansible-collection-infra

Write your first playbook.