mullholland.packages

Ansible role packages

Install packages which do not need customization.

GitHub Downloads Version
github downloads Version

Example Playbook

This example is taken from molecule/default/converge.yml and is tested on each push, pull request and release.

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true
  vars:
    packages:
      - "ethtool"
    packages_group:
      - "bc"
    packages_host:
      - "zip"

    packages_debian:
      - "nethogs"

    packages_redhat:
      - "nano"

    packages_absent:
      - "bzip2"
    packages_absent_group:
      - "htop"
    packages_absent_host:
      - "mtr"
  roles:
    - role: "mullholland.packages"

The machine needs to be prepared. In CI this is done using molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  become: true
  gather_facts: true

  tasks:
    - name: Install packages to test absent parts
      ansible.builtin.package:
        name:
          - "bzip2"
          - "unzip"
        state: present

Role Variables

The default values for the variables are set in defaults/main.yml:

---
# global/group/host seperation is meant to allow merging of package groups
# according to groupmemberships

# packages are the same for all servers, regardless of ansible_os_family
# differentiates between global/group/host
packages: []
packages_group: []
packages_host: []

# packages_debian are only for debian/ubuntu ased systems
# differentiates between global/group/host
packages_debian: []
packages_debian_group: []
packages_debian_host: []

# packages_debian are only for redhat/Centos (rocky/almalinux/amazon) based systems
# differentiates between global/group/host
packages_redhat: []
packages_redhat_group: []
packages_redhat_host: []


# packages_absent is the same for all
# differentiates between global/group/host
packages_absent: []
packages_absent_group: []
packages_absent_host: []

# Initialise empty for later merging
packages_debian_merged: []
packages_redhat_merged: []
packages_absent_merged: []

Requirements

Context

This role is a part of many compatible roles. Have a look at the documentation of these roles for further information.

Here is an overview of related roles: dependencies

Compatibility

This role has been tested on these container images:

container tags
EL all
Amazon Candidate
Fedora all
Ubuntu all
Debian all

The minimum version of Ansible required is 2.10, tests have been done to:

  • The previous version.
  • The current version.
  • The development version.

If you find issues, please register them in GitHub.

License

MIT.

Author Information

Mullholland

About

Install packages which do not need customization.

Install
ansible-galaxy install mullholland.packages
GitHub repository
License
apache-2.0
Downloads
1.6k