GithubHelp home page GithubHelp logo

ansible-users-setup's Introduction

Ansible-Users-Setup

Role Tasks

  • Create users
  • Set users passwords
  • Install ssh keys
  • Add full sudoers
  • Add custom sudo commands
  • Add additional groups for users
  • Delete users
  • Allow custom users list/files

How to use this role:

There are 2 way to provision users through this role:

Passing it a file with users (the .yml extensions is required from ansible 2.2):

  - role: ansible-users-setup
    ansible_users_file: my-team.yml

Specifing the user details directly in the playbook:

  - role: ansible-users-setup
    users:
    - name: vagrant
      description: vagrant
      key:
        - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1DB5VISZ6JokIpyKlCUCONCpaC9697YcJCIJsuMTUQM5IFKeHs
      sudo: yes
      deleted: no

Keep reading to learn about all the configurable fields for users.

Users Fields

Provision a new user adding the entry into the right vars file.

Users fields:

  • name (mandatory)
  • description
  • password #this is a Linux password hash
  • key
  • sudo (mandatory)
  • custom_sudo
  • additional_groups
  • deleted (mandatory)

Full user example:

users:
  - name: username
    description: Full Name
    password: $6$F2gxqZJi$3q9lsRPYgyPZO4J4wJnz6MP37U1Y5Rh1IEips4vKmnR7d9AK3KMnKdA2KG.4TBTun
    key:
      - ssh-rsa key1adijhsadlijkfnlsadijknf
      - ssh-rsa key2asdhjfbsakdjbfksaddsdas
    sudo: no
    custom_sudo:
    - "ALL=(ALL) NOPASSWD: /usr/bin/dpkg *"
    additional_groups:
      - www-data
      - wheel
    deleted: no

To remove an user just change the value of deleted to yes then run the role and remove the entry from the vars.

ansible-users-setup's People

Contributors

lastres 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.