Skip to content

Latest commit

 

History

History
84 lines (65 loc) · 3.49 KB

File metadata and controls

84 lines (65 loc) · 3.49 KB

Ansible Role jm1.cloudy.groups

This role helps with managing UNIX groups from Ansible variables. It allows to add, modify and delete UNIX groups with variable groups_config which is defined as a list where each list item is a dictionary of parameters that will be passed to Ansible's group module. For example, to ensure group libvirt exists, define variable groups_config in group_vars or host_vars as such:

groups_config:
- # Ensure system group libvirt exists
  name: libvirt
  state: present
  system: true

Tested OS images

Available on Ansible Galaxy in Collection jm1.cloudy.

Requirements

None.

Variables

Name Default value Required Description
groups_config [] false List of parameter dictionaries for Ansible's group 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
    groups_config:
    - # Ensure system group libvirt exists
      name: libvirt
      state: present
      system: true
  roles:
  - name: Setup local groups
    role: jm1.cloudy.groups
    tags: ["jm1.cloudy.groups"]

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)