Giter Club home page Giter Club logo

ansible-role-groups's Introduction

Groups Role

The groups role will create and remove groups, and manage their sudo settings if configured to do so via variables.

Ansible Galaxy

Requirements

All included in ansible-base package.

Role Variables

An example list of all variables for this role should go here, including any variables that are in defaults/main.yml and vars/main.yml. Any variables that are read from other roles and/or the global scope (e.g. hostvars, groupvars, etc) should be shown here also.

Variable Required Default Choices Comments
groups_all.create.name yes N/A string the group name
groups_all.create.gid yes N/A integer the group id
groups_all.create.password_login yes N/A yes, no the groups ability to login via ssh with as password
groups_all.create.sudo_content yes N/A list of strings content to add to /etc/sudoers/groupname using a template
groups_all.remove no N/A list of strings the groups to remove
groups_all.sudo.enabled no N/A true, false install and configure sudo for groups
groups_group.create.name yes N/A string the group name
groups_group.create.gid yes N/A integer the group id
groups_group.create.password_login yes N/A yes, no the groups ability to login via ssh with as password
groups_group.create.sudo_content yes N/A list of strings content to add to /etc/sudoers/groupname using a template
groups_group.remove no N/A list of strings the groups to remove
groups_group.sudo.enabled no N/A true, false install and configure sudo for groups
groups_host.create.name yes N/A string the group name
groups_host.create.gid yes N/A integer the group id
groups_host.create.password_login yes N/A yes, no the groups ability to login via ssh with as password
groups_host.create.sudo_content yes N/A list of strings content to add to /etc/sudoers/groupname using a template
groups_host.remove no N/A list of strings the groups to remove
groups_host.sudo.enabled no N/A true, false install and configure sudo for groups

Role Variables Examples

# in group_vars/all.yml
groups_all:
  create:
    - name: admins
      gid: 3001
      password_login: no
      sudo_content:
        - ALL=(ALL) NOPASSWD:ALL
    - name: operators
      gid: 3002
      password_login: no
      sudo_content:
        - ALL = (root) NOPASSWD: /usr/local/bin/custom-tool
        - ALL = (root) NOPASSWD: /usr/sbin/something with-specific-arguments
        - ALL = (root) NOPASSWD: /usr/local/bin/other-thing
  remove:
    - group1
    - group2
    - othergroup
  sudo:
    enabled: true
# in group_vars/group_name.yml
groups_group:
  create:
    - name: group_admins
      gid: 4001
      password_login: no
      sudo_content:
        - ALL=(ALL) NOPASSWD:ALL
    - name: operators
      gid: 3002
      password_login: no
      sudo_content:
        - ALL = (root) NOPASSWD: /usr/local/bin/custom-tool
        - ALL = (root) NOPASSWD: /usr/sbin/something with-specific-arguments
        - ALL = (root) NOPASSWD: /usr/local/bin/other-thing
  remove:
    - group1
    - group2
    - othergroup
  sudo:
    enabled: true
# in host_vars/hostname.yml
groups_host:
  create:
    - name: host_admins
      gid: 2001
      password_login: no
      sudo_content:
        - ALL=(ALL) NOPASSWD:ALL
    - name: operators
      gid: 3002
      password_login: no
      sudo_content:
        - ALL = (root) NOPASSWD: /usr/local/bin/custom-tool
        - ALL = (root) NOPASSWD: /usr/sbin/something with-specific-arguments
        - ALL = (root) NOPASSWD: /usr/local/bin/other-thing
  remove:
    - group1
    - group2
    - othergroup
  sudo:
    enabled: true

Dependencies

None

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: all
  roles:
     - neoloc.groups

License

See license.md

Author Information

Github

ansible-role-groups's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.