systemli.apt_repositories

apt_repositories

Build Status

This tool allows you to add third-party software repositories to Debian and its derivatives. It also lets you manage the installation of software packages from these repositories. For detailed instructions, refer to the Debian wiki.

By default, it uses the deb822 format, but you can also use a simple line style (manpage).

Requirements

You need Debian 9+ or Ubuntu 18.04+. Other versions might work, but they haven’t been tested.

Role Variables

You can specify repositories like this:

apt_repositories:
  - url: https://...
    key: |
      -----BEGIN PGP PUBLIC KEY BLOCK-----
      MY_ARMORED_KEY
      ...

You can also use these additional variables (with default values):

apt_repositories:
  - url: https://...
    filename: "{{ item.url|urlsplit('hostname') }}"
    types: deb
    suites: "{{ ansible_distribution_release }}"
    components: main
    packages: []
    key_path: # a path to a file in the role `files` directory instead of using `key`

Additionally, you can use preset values. For examples, check vars/gitlab.yml. You can change presets partially.

Available presets:

  • caddy
  • gitlab
  • grafana
  • jitsi
  • prosody
  • sury
  • torproject

Contributions are welcomed!

Example Playbook

Here is how to use it in a playbook:

- hosts: server
  roles:
    - systemli.apt_repositories
  vars:
    apt_repositories:
      - filename: packages.gitlab.com
        url: https://packages.gitlab.com/gitlab/gitlab-ce/debian/
        key: "{{ gitlab_ce_key }}"
        packages:
          - gitlab-ce

Alternatively, you can use a preset:

- hosts: server
  roles:
    - systemli.apt_repositories
  vars:
    apt_repositories:
      - preset: gitlab

Or you can just add it as a dependency in ansible-galaxy:

# meta/main.yml
...
dependencies:
  - role: systemli.apt_repositories
    vars:
      apt_repositories:
        - filename: download.jitsi.org
          url: https://download.jitsi.org/
          key_path: jitsi-archive-keyring.gpg
          suites: stable/
          components: ''
          packages: "{{ jitsi_meet_packages }}"

License

GPLv3

Author Information

systemli.org

Informazioni sul progetto

Add third-party repositories on Debian in a secure way

Installa
ansible-galaxy install systemli.apt_repositories
Licenza
gpl-3.0
Download
36.7k
Proprietario
Your friendly tech collective