Git Product home page Git Product logo

change-passwords's Introduction

change-passwords

Playbook to change one or many account passwords. Simply create a file which containins a dictionary called accounts in the following format:

accounts:
  bob: bobspassword
  bill: billspassword
  john: johnspassword

We will assume that the above example file is called usernames.yml

Optionally encrypt the usernames.yml file simply by using ansible-vault.

ansible-vault encrypt usernames.yml and set a password to protect the file.

If you wish to decrypt the file to plain text, simply execute the following:

ansible-vault decrypt usernames.yml and enter the password you used.

Executing the play

ansible-playbook -i INVENTORY change-passwords.yml -e @usernames.yml

Note that we use -e to load in our dictionary, as it is a file it must be prepended with @

If your file is encrypted with ansible-vault then you must additionally pass the parameter --ask-vault-pass

Output logs

Upon exit if any hosts have had a user or users password change you will have a timestamped .log file is the current working directory. The format of the file is like the example below:

filename: 2020-10-02-20-51-29.log

vm1.mydomain.net:bob,bill
vm2.mydomain.net:bill

First field is the FQDN followed by a colon and a comma seperated list of any accounts that have been changed. If no changes to any hosts has been made, no logfile will be generated.

change-passwords's People

Contributors

milesbarry avatar

Forkers

tmichett

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.