(DEPRECATED) Manage packages and package manager configuration.
This repository has been archived on 2025-04-06. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-04-06 17:40:17 +02:00
defaults Rename proxy to mirror and simplify role structure 2024-08-12 19:25:47 +02:00
handlers initial commit 2024-06-30 14:13:50 +02:00
meta initial commit 2024-06-30 14:13:50 +02:00
tasks Extra packages per host 2024-09-28 16:02:54 +02:00
templates Rework Arch Linux mirror configuration. 2024-08-12 23:27:04 +02:00
vars initial commit 2024-06-30 14:13:50 +02:00
LICENSE initial commit 2024-06-30 14:13:50 +02:00
README.md Add deprecation notice 2025-04-06 17:40:17 +02:00

!!! 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 that reflector.timer is started and enabled.
    • When pkgs_mirrors has more than one mirror(s) defined: In this case the mirrors are written to the mirrorlist and the role ensures that reflector.timer is 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), default true. Whether packages should be installed or not.
  • pkgs_install_list (mapping). Mappings named after a ansible_distribution containing list of strings, which represent package names. The special mapping all can be used to define a package list for all distributions. The all mapping can come in handy when having only a few different distributions, but can get cumbersome for heterogeneous landscapes. When pkgs_install_include is true, 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

License

The Unlicense

Author Information

lingling (Codeberg, GitHub)