Giter Club home page Giter Club logo

ansible-role-user's Introduction

Ansible Role: User v1.0

Build Status

An Ansible role that creates users, updates passwords, configures authorized_keys file for ssh.

Allows you to specify a different list of users for each host group or within a playbook

It is recommended to ansible-vault encrypt the master_users_list variable

See files/generate_password_hash.py to generate compatible password hashes

For each user in master_users_list.users[], ssh_key list is lineinfiled into /home/{{ user }}/.ssh/authorized_keys

See Also: ansible-role-sudo, ansible-role-bash

Requirements

  • Sudo access

Role Variables

Available variables are listed below, there are no defaults:

master_users_list: 
  root: # root user handled separately as home directory is different than the rest of users
    password: "$6$..." # password hash
  users:
    username_1:
      groups: username_1, additional_group
      state: present
      password: "$6$rounds=p...." # password hash
      ssh_key:
      - "ssh-rsa ..." #allows for multiple keys
      - "ssh-rsa ... #key 2 for username_1"    

Dependencies

None

Example Playbook

- hosts: webservers
  vars:
  - master_users_list:
      users:
        travis:
          groups: travis, additional_group
          state: present
          password: "$6$rounds=100000$76usz5L2Y.bpvtTB$vtivr8XwS0al8MA2q2s/YKEu312l7gHnK3eLkRo9QmKmk5XIIsDDAZmT7Hrc0YaLTQjD7wZ//HbwM49YjsxkJ/" # password hash
          ssh_key:
          - "ssh-rsa 1234"
    
  roles:
  - ansible-role-user

License

BSD-2

Author Information

Matt Margolin

mm0 on github

ansible-role-user's People

Contributors

mm0 avatar

Watchers

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