Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

jnv/ansible-role-debian-backports

Repository files navigation

Debian/Ubuntu Backports with Ansible

Ansible Role: jnv.debian-backports Build Status

Adds backports repository for Debian and Ubuntu.

Note for Debian users: Debian provides backports only for the latest stable version.

Project Status

Project Status: Unsupported

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
  • 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
  • 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); default false.
  • backports_priority: Set pin priority for the backports repository; default 100. See more at AptConfiguration page.

Similar Roles

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.