manage_repositories/README.md

98 lines
3.4 KiB
Markdown
Raw Normal View History

manage_repositories
2023-03-09 08:29:28 +00:00
=========
> This repository is only a mirror. Development and testing is done on a private gitea server.
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
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.
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
Requirements
------------
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
None.
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
Role Variables
--------------
Available variables are listed below, along with default values. A sample file for the default values is available in `default/manage_repositories.yml.sample` in case you need it for any `group_vars` or `host_vars` configuration.
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
```yaml
manage_repositories_enable_default_repo: true # by default, set to true
```
This variable enable or disable the configuration of the main distribution repositories (useful when calling this role to configure repo for another role like installing docker).
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
```yaml
manage_repositories_enable_custom_repo: false # by default, set to false
```
This variable enable of disable the configuration of custom repositories
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
```yaml
manage_repositories_main_repo_uri: # by default, this variable has the following values
ubuntu: "http://fr.archive.ubuntu.com/ubuntu"
debian: "http://deb.debian.org/debian"
2023-03-09 07:54:52 +00:00
```
2023-03-09 08:29:28 +00:00
This variable sets the mirror URLs for the main repositories. You can optionally remove the distribution you don't want (ex. `remove manage_repositories_main_repo_uri[debian]` if you're only using ubuntu).
```yaml
manage_repositories_custom_repo: # by default, this variable is not defined
- 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
options:
Signed-By: "https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg"
- name: ...
2023-03-09 07:54:52 +00:00
```
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 `options` entries are optional, and you can add pretty much all standard options. The `Signed-By` option expects a URL to download the gpg key. If no options are needed, the `options` key can be removed completely.
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
Dependencies
------------
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
None.
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
Example Playbook
----------------
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
```yaml
# calling the role inside a playbook with either the default or group_vars/host_vars
- hosts: servers
roles:
2023-03-12 00:18:44 +00:00
- ednxzu.manage_repositories
2023-03-09 08:29:28 +00:00
```
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
```yaml
# calling the role inside a playbook and injecting variables (in another role for example)
- hosts: servers
tasks:
- name: "Configure hashicorp repository"
2023-04-04 19:30:28 +00:00
ansible.builtin.include_role:
2023-03-12 00:18:44 +00:00
name: ednxzu.manage_repositories
2023-03-09 08:29:28 +00:00
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
options:
Signed-By: "https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg"
2023-03-09 08:29:28 +00:00
```
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
License
-------
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
MIT / BSD
2023-03-09 07:54:52 +00:00
2023-03-09 08:29:28 +00:00
Author Information
------------------
2023-03-09 07:54:52 +00:00
This role was created by Bertrand Lanson in 2023.