(DEPRECATED) Manage packages and package manager configuration.
- Jinja 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| defaults | ||
| handlers | ||
| meta | ||
| tasks | ||
| templates | ||
| vars | ||
| LICENSE | ||
| README.md | ||
!!! DEPRECATED !!!
This standalone role is deprecated! The role has been recoded for the Ansible collection lingra.system.
Ansible Role: pkgs
This role configures repository mirrors and installs packages.
Features
- Configures package mirrors. Currently only for Arch Linux.
- Installs arbitrary packages defined in a variable.
Requirements
None.
Role Variables
Configure package mirrors:
pkgs_mirrors: List of mappings describing package mirrors. The mappings consist of following keys:domain(string), mandatory. The domain under which the mirror can be reached.secure(boolean), optional. Whether the mirror should be reached over HTTP (false) or HTTPS (true). If unspecified HTTPS is assumed.
The included tasks for mirror configuration are identified by the Ansible fact
ansible_distribution to distinguish between distributions, as they have many
different ecosystems. The distribution specific behavior is described in the
following:
- Archlinux:
pkgs_mirrors: [](empty list): The mirrorlist is populated by reflector(1). This role does ensure thatreflector.timeris started and enabled.- When
pkgs_mirrorshas more than one mirror(s) defined: In this case the mirrors are written to the mirrorlist and the role ensures thatreflector.timeris stopped and disabled.
- rescue: When no tasks file is matched for
ansible_distribution, than a debug information is printed and no mirror configuration is executed.
Configure installed packages:
pkgs_install_include(boolean), defaulttrue. Whether packages should be installed or not.pkgs_install_list(mapping). Mappings named after aansible_distributioncontaining list of strings, which represent package names. The special mappingallcan be used to define a package list for all distributions. Theallmapping can come in handy when having only a few different distributions, but can get cumbersome for heterogeneous landscapes. Whenpkgs_install_includeistrue, it is necessary to define at least one mapping key in this mapping.
Dependencies
None.
Example Playbook
- hosts: all
tasks:
- name: Include role pkgs
ansible.builtin.include_role:
name: pkgs
vars:
pkgs_mirrors:
- domain: internal-arch-mirror.mydomain.tld
secure: false
pkgs_install_list:
all:
- htop
- rsync
Debian:
- tmux