manage_apt_packages/README.md

63 lines
1.9 KiB
Markdown
Raw Normal View History

2023-03-10 18:54:35 +00:00
Manage apt packages
=========
> This repository is only a mirror. Development and testing is done on a private gitlab server.
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
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.
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
Requirements
------------
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
None.
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
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.
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
```yaml
manage_apt_packages_list: # by default, not defined
- name: nginx
version: latest # Leaving empty or setting '' will be considered as latest
state: absent
- name: ...
2023-03-10 16:32:15 +00:00
```
2023-03-10 18:54:35 +00:00
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` on empty (which is considered the same).
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
Dependencies
------------
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
None.
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
Example Playbook
----------------
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
```yaml
# calling the role inside a playbook with either the default or group_vars/host_vars
- hosts: servers
roles:
- ednxzu.manage_apt_packages
```
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
```yaml
# calling the role inside a playbook and injecting variables (in another role for example)
- hosts: servers
tasks:
- name: "Install nginx package"
ansible.builtin.include_role:
name: ednxzu.manage_apt_packages
vars:
manage_apt_packages_list:
- name: consul
version: 1.13.1-1
state: present
```
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
License
-------
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
MIT / BSD
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
Author Information
------------------
2023-03-10 16:32:15 +00:00
2023-03-10 18:54:35 +00:00
This role was created by Bertrand Lanson in 2023.