Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Ansible Role jm1.cloudy.packages

This role helps with managing packages from Ansible variables. It allows to install, upgrade and remove packages with variable packages which is defined in group_vars or host_vars either as

  • a list where each list item is a dictionary of parameters which will be passed to Ansible's package module, e.g.
# packages as a list of dictionaries
packages:
- name:
  - bash
  - vim
  state: 'present'
- name:
  - zsh
  - nano
  state: 'absent'
  • a dictionary of parameters which will be passed to Ansible's package module, e.g.
# packages as a single dictionary
packages:
  name:
  - bash
  - vim
  state: 'present'
  • a list of packages which will be installed with Ansible's package module, e.g.
# packages as a list of strings
packages:
- bash
- vim

Tested OS images

Available on Ansible Galaxy in Collection jm1.cloudy.

Requirements

None.

Variables

Name Default value Required Description
packages [] false List of parameter dictionaries, a single parameter dictionary or a list of strings for Ansible's package module

Dependencies

None.

Example Playbook

- hosts: all
  become: true
  vars:
    # Variables are listed here for convenience and illustration.
    # In a production setup, variables would be defined e.g. in
    # group_vars and/or host_vars of an Ansible inventory.
    # Ref.:
    # https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html
    # https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html
    packages:
    - fzf
  roles:
  - name: Manage packages
    role: jm1.cloudy.packages
    tags: ["jm1.cloudy.packages"]

For instructions on how to run Ansible playbooks have look at Ansible's Getting Started Guide.

License

GNU General Public License v3.0 or later

See LICENSE.md to see the full text.

Author

Jakob Meng @jm1 (github, galaxy, web)