Ansible role install APT repos
This role need to be include in a playbook.
Call this Galaxy role like this:
ansible-galaxy install -r requirements.yml
Inside requirements.yml
- src: redbeard28.apt_sources
More info => Ansible Docs
- Ansible 2.9+
---
repo_apt_key: ''
remove_other_repo: 'false'
remove_repos:
- /etc/apt/sources.list
sources_filename: 'myrepos'
myURL: "http://internal.mirror.mydomain.intra"
list_repos:
- 'deb [arch=amd64] {{ myURL }}/debian {{ ansible_distribution_release }} main contrib non-free'
none
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: all
roles:
- { role: redbeard28.apt_sources, tags: repo }
You can use molecule to test this role.
image=debian tag="buster" molecule converge
image=debian tag="buster" molecule verify
Jeremie CUADRADO¹ from redbeard-consulting