Ansible role to install and manage packages with APT on debian-based systems. https://ednz.fr
Go to file
Bertrand Lanson cb2dc501b0
All checks were successful
test / Linting (push) Successful in 7s
test / Molecule tests (default, debian12) (push) Successful in 40s
test / Molecule tests (default, debian11) (push) Successful in 42s
test / Molecule tests (default, ubuntu2004) (push) Successful in 45s
test / Molecule tests (default, ubuntu2204) (push) Successful in 40s
test / Molecule tests (with_custom_packages, debian11) (push) Successful in 1m13s
test / Molecule tests (with_custom_packages, debian12) (push) Successful in 1m20s
test / Molecule tests (with_custom_packages, ubuntu2004) (push) Successful in 2m8s
test / Molecule tests (with_custom_packages, ubuntu2204) (push) Successful in 1m22s
feat(core): change namespace
2024-02-05 22:23:53 +01:00
.gitea/workflows added gitea actions, debian12 support, moved to ansible for testing 2023-06-30 23:02:13 +02:00
.github/workflows feat(core): change namespace 2024-02-05 22:23:53 +01:00
defaults housekeeping, and typos 2023-04-04 21:23:32 +02:00
handlers feat: remove become from role 2023-12-03 17:45:22 +01:00
meta feat(core): change namespace 2024-02-05 22:22:09 +01:00
molecule feat(core): change namespace 2024-02-05 22:22:09 +01:00
tasks feat: remove become from role 2023-12-03 17:45:22 +01:00
vars add option to change cache time for reusing this role 2023-09-14 22:53:14 +02:00
.ansible-lint publish of the first working version 2023-03-10 19:54:35 +01:00
.gitignore ignore .vscode 2023-05-21 20:17:30 +02:00
.yamllint publish of the first working version 2023-03-10 19:54:35 +01:00
LICENSE added gitea actions, debian12 support, moved to ansible for testing 2023-06-30 23:02:13 +02:00
README.md feat(core): change namespace 2024-02-05 22:22:09 +01:00

manage_apt_packages

This repository is only a mirror. Development and testing is done on a private gitea server.

This role enables you to manage packages on debian-based distributions. It can be used on its own , or be called by other roles the install/remove packages on demand.

Requirements

None.

Role Variables

Available variables are listed below, along with default values. A sample file for the default values is available in default/manage_apt_packages.yml.sample in case you need it for any group_vars or host_vars configuration.

manage_apt_packages_list: # by default, not defined
  - name: nginx
    version: latest # Leaving empty or setting '' will be considered as latest
    state: absent
  - name: ...

This variable is a list of packages, with their name, desired version and state. Note that the role allows version rollbacks, so unless you absolutely need a specific version, it is usualy advised to keep the version on latest or empty (which is considered the same).

Dependencies

None.

Example Playbook

# calling the role inside a playbook with either the default or group_vars/host_vars
- hosts: servers
  roles:
    - ednz_cloud.manage_apt_packages
# calling the role inside a playbook and injecting variables (in another role for example)
- hosts: servers
  tasks:
    - name: "Install consul package"
      ansible.builtin.include_role:
        name: ednz_cloud.manage_apt_packages
      vars:
        manage_apt_packages_list:
          - name: consul
            version: 1.13.1-1
            state: present

License

MIT / BSD

Author Information

This role was created by Bertrand Lanson in 2023.