ansible-role-debian-backports
ansible-role-debian-backports copied to clipboard
Setup backports repository for Debian and Ubuntu
Debian/Ubuntu Backports with Ansible
Adds backports repository for Debian and Ubuntu.
Note for Debian users: Debian provides backports only for the latest stable version.
Project Status
The project has reached a stable, usable state but the author(s) have ceased all work on it. See Similar Roles section for alternatives.
Usage
Install via Galaxy:
ansible-galaxy install jnv.debian-backports
In your playbook:
- hosts: all
roles:
# ...
- jnv.debian-backports
The role uses apt_repository module which has additional requirements.
You can use default_release
option for apt module to install package from backports. For example:
tasks:
- apt: name=mosh state=present default_release={{ansible_distribution_release}}-backports
ansible_distribution_release
variable contains release name, i.e. precise
or wheezy
.
Variables
-
backports_uri
: URI of the backports repository; change this if you want to use a particular mirror.- Debian:
https://deb.debian.org/debian
- Ubuntu:
http://archive.ubuntu.com/ubuntu
- Debian:
-
backports_components
: Release and components for sources.list- Debian:
{{ backports_distribution }}-backports backports main contrib non-free
- Ubuntu:
{{ backports_distribution }}-backports main restricted universe multiverse
- Debian:
-
backports_state
: Whether the backports repository should be used; default'present'
, change to'absent'
to disable the role. -
backports_priority_enabled
: Whether to enable backports priority (APT pinning); defaultfalse
. -
backports_priority
: Set pin priority for the backports repository; default100
. See more atAptConfiguration
page.
Similar Roles
- jgeusebroek.backports
- oefenweb.apt – does much more, but can be also used to enable backports.
Testing
For developing and testing this role Github Actions, Molecule and Vagrant is used. In a local environment environment you can easily test the role with
pip3 install molecule-vagrant ansible-lint yamllint
molecule test
This requires Vagrant to be installed.