Coder Social home page Coder Social logo

andp97 / ansible-role-github-users Goto Github PK

View Code? Open in Web Editor NEW

This project forked from geerlingguy/ansible-role-github-users

0.0 0.0 0.0 29 KB

Ansible Role - GitHub Users

Home Page: https://galaxy.ansible.com/geerlingguy/github-users/

License: MIT License

ansible-role-github-users's Introduction

Ansible Role: GitHub Users

CI

Create users based on GitHub accounts.

This role will take a GitHub username and create a system account with the same username, and will add all the pubkeys associated with the GitHub account to the user's authorized_keys.

It's kind of a cheap way to do public key management for users on your system... but it works!

Requirements

None.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

github_users: []
  # You can specify an object with 'name' (required) and 'groups' (optional):
  # - name: geerlingguy
  #   groups: www-data,sudo

  # Or you can specify a GitHub username directly:
  # - geerlingguy

A list of users to add to the server; the username will be the name (or the bare list item, if it's a string instead of an object). You can add the user to one or more groups (in addition to the [username] group) by adding them as a comma-separated list in groups.

github_users_absent: []
  # You can specify an object with 'name' (required):
  # - name: geerlingguy

  # Or you can specify a GitHub username directly:
  # - geerlingguy

A list of users who should not be present on the server. The role will ensure these user accounts are removed.

github_users_authorized_keys_exclusive: true

Whether the users' authorized_keys files should exclusively contain keys from their GitHub account. This should normally be set to true if you are only allowing users to log in using keys available in their GitHub accounts.

github_url: https://github.com

By default, use public GitHub (i.e. https://github.com) as the source for users/keys. Override this to use a different GitHub instance/endpoint (e.g. GitHub Enterprise).

If you need to give the user the ability to self-manage their authorized_keys file, then you should set this to no, and it will only append new keys, but never remove any additional keys (e.g. old keys removed from their GitHub profile, or keys the end user added manually) from the file.

Dependencies

None.

Example Playbook

- hosts: servers

  vars:
    github_users:
      # You can specify the `name`:
      - name: geerlingguy
        groups: sudo,www-data
      - name: GrahamCampbell
      # Or if you don't need to override anything, you can specify the
      # GitHub username directly:
      - fabpot

    github_users_absent:
      - johndoe
      - name: josh

  roles:
    - geerlingguy.github-users

If you want to make sure users' public keys are in sync, it is best to run the playbook on a cron, e.g. every 5 min, 10 min, or some other interval. That way you don't have to manually add new keys for users.

License

MIT / BSD

Author Information

This role was created in 2017 by Jeff Geerling, author of Ansible for DevOps.

ansible-role-github-users's People

Contributors

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