GithubHelp home page GithubHelp logo

ansible-users's Introduction

users

Manage users by group

Role Variables

See defaults/main.yml for a list and description of variables used in this role.

Example Playbooks

Example "master list" of users:

# group_vars, etc
user_list:
  - name: bclark
    comment: Brian Clark
    groups:
      - admins
    authorized_keys:
      - ssh-rsa AAAA...
  - name: user1
    comment: Joe User
    group: custom_primary_group
    groups:
      - users
  - name: dev1
    groups:
      - webadmins
    authorized_keys:
      - ssh-rsa AAAA...

Example list of groups to add:

- user_groups:
    - name: groupname # required
      search_name: groupname # optional name of group to search for, defaults to `name`
      gid: 999 #optional group id
      state: synced # remove absent users, add present users
      sudo: no # optional (default false) - boolean, mapping (see below), or `nopasswd`
    - name: deleted_users
      state: absent # will only remove members marked as absent in user_list!
    - name: god_group
      sudo: nopasswd # password-less sudo
    - name: limited_sudo_group
      sudo:
        commands: /bin/ls # optional string of sudo commands
        nopasswd: yes # optional boolean to allow nopasswd
        users: # optional string of sudo users
        hosts: # optional string of sudo hosts

Add all developers from user_list to developers group:

- hosts: webservers
  roles:
     - role: users
       user_groups:
         - name: developers

Search for all members of the webadmins group and add them to the sysadmin linux group using group id 2300, and give them password-less sudo:

- hosts: webservers
  roles:
    - role: users
      user_groups:
        - name: sysadmin
          search_name: webadmins
          gid: 2300
          sudo: nopasswd

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.