Coder Social home page Coder Social logo

ansible-role-manage-users's Introduction

Ansible Role: Manage Users

An ansible role to manage users on linux hosts.

Requirements

Requires a custom authorized_keys location (/etc/ssh/authorized_keys/) to be setup.

You can configure this using the thedumbtechguy.server-setup role.

This role has been tested on Ubuntu 16.04 and Ubuntu 16.10 only.

Variables

  • users: list of users to create.
    • Default: []
    • Example
      users:
        - username: username # required
          password: 'encryptedpassword' # optional. omitted if not provided
          use_ssh: false # optional. defaults to false
          public_key: 'key url or contents' # required when 'use_ssh' is true
          use_sudo: false # optional. defaults to false
          sudo:
            hosts: ALL # optional. defaults to 'ALL'
            groups: ALL # optional. defaults to 'ALL'
            users: ALL # optional. defaults to 'ALL'
            commands: ALL # optional. defaults to 'ALL'. for passwordless sudo, use 'NOPASSWD: ALL'

      Note: Password should be an encrypted value compatible with the ansible user module.

      You can create one using: python -c 'import crypt; print crypt.crypt("This is the password", "$1$ThisIsSomeSalt$")'

Usage Example

- hosts: all
  vars:
    users:
      - username: admin
        password: '$1$ThisIsSo$RwIOJHdSWIzAJjbvBdbOZ0'
        use_sudo: true
        use_ssh: false
      - username: ansible
        password: '$1$ThisIsSo$RwIOJHdSWIzAJjbvBdbOZ0'
        use_ssh: true
        public_key: 'ssh-rsa AAAA......'
        use_sudo: true
        sudo:
          hosts: ALL
          groups: ALL
          users: ALL
          commands: ALL
  roles:
    - thedumbtechguy.manage-users

License

MIT / BSD

Author Information

This role was created by TheDumbTechGuy ( twitter | blog | galaxy )

Credits

ansible-role-manage-users's People

Contributors

thedumbtechguy avatar

Watchers

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