Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ednz-cloud/manage_repositories
Ansible role to manage APT repositories debian-based systems. Mirror from https://git.ednz.fr/ansible-roles/manage_repositories.
https://github.com/ednz-cloud/manage_repositories
ansible ansible-role apt-repository linux
Last synced: 5 days ago
JSON representation
Ansible role to manage APT repositories debian-based systems. Mirror from https://git.ednz.fr/ansible-roles/manage_repositories.
- Host: GitHub
- URL: https://github.com/ednz-cloud/manage_repositories
- Owner: ednz-cloud
- License: mit
- Created: 2023-03-02T22:18:28.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-17T22:13:02.000Z (17 days ago)
- Last Synced: 2024-12-17T23:20:35.278Z (17 days ago)
- Topics: ansible, ansible-role, apt-repository, linux
- Language: Jinja
- Homepage: https://ednz.fr
- Size: 50.8 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# **Manage repositories**
This role enables you to manage repositories on **debian-based** distributions. It can be used on its own , or be called by other roles the configure repositories on demand.
## **Requirements**
None.
## **Role Variables**
### Default repositories
```yaml
manage_repositories_enable_default_repo: true
```This variable enables or disables the configuration of the main distribution repositories. Setting this to `false` will not configure the default apt repositories for the host.
```yaml
manage_repositories_main_repo_uri:
ubuntu: "http://fr.archive.ubuntu.com/ubuntu"
debian: "http://deb.debian.org/debian"
```This variable sets the mirror URLs for the main repositories.
### Custom repositories
```yaml
manage_repositories_enable_custom_repo: false
```This variable enables the configuration of custom repositories.
```yaml
manage_repositories_custom_repo:
- name: docker
uri: "https://download.docker.com/linux/{{ ansible_distribution|lower }}"
comments: "{{ ansible_distribution|lower }} docker repository"
types:
- deb
suites:
- "{{ ansible_distribution_release }}"
components:
- stable
signed_by: "https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg"
- name: ...
```This variable contains a list (1 to N) of custom repositories to install. IT HAS TO BE SET if `manage_repositories_enable_custom_repo == true`, or else the role might fail. The above example highlights the different options you can set per repository. See the [deb822 module documentation](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/deb822_repository_module.html) for more details. Note that not all options in the module are currently supported.
## **Dependencies**
None.
## **Example Playbook**
```yaml
# calling the role inside a playbook with either the default or group_vars/host_vars
- hosts: servers
roles:
- ednz_cloud.manage_repositories
``````yaml
# calling the role inside a playbook and injecting variables (in another role for example)
- hosts: servers
tasks:
- name: "Configure hashicorp repository"
ansible.builtin.include_role:
name: ednz_cloud.manage_repositories
vars:
manage_repositories_enable_default_repo: false
manage_repositories_enable_custom_repo: true
manage_repositories_custom_repo:
- name: docker
uri: "https://download.docker.com/linux/{{ ansible_distribution|lower }}"
comments: "{{ ansible_distribution|lower }} docker repository"
types:
- deb
suites:
- "{{ ansible_distribution_release }}"
components:
- stable
signed_by: "https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg"
```## **License**
MIT / BSD
## **Author Information**
This role was created by Bertrand Lanson in 2023.