Ansible Automation | Performing User Management using Ansible

preview_player
Показать описание
User Management is one of the day 2 day System Administration tasks for the System Administrators. Though this is not a difficult task, but sometimes it becomes time consuming in the following scenarios

1.You don’t have central user management tool in your setup, such as Microsoft AD or LDAP.
2.Have to create local users for System/Application users, which can’t be AD integrated.

I have written a small playbook, which can be used for

1. Create local groups
2. Create local users.
3. Generate ssh keys for a user.
4. Update the public keys in user’s authorized_keys file.
5. Delete local groups.
6. Delete local users.
Рекомендации по теме
Комментарии
Автор

Hi Yogesh,
This is excellent for freshers because everything you share with us is simple and knowledgeable.

VK-xwij
Автор

Can you add the playbook to the description area of the video or make it downloadable via Dropbox etc.

vivahernando
Автор

Hi Yogesh,

All your videos are really nice and way to understand. Thanks for such knowledge sharing sessions.

I just want to understand how we can encrypt and use the password which is to be added on multiple users with same playbook.

namishgarg
Автор

Nice Let's suppose i have a list of users in excel file and i need to add those users how to call/link that excel into the playbook .... i know we can create a yml file and copy all users there and we can add that file into playbook, however i have an excel file .... how would u do it..

tabbytabrez
Автор

Hi, Can you please help me
I am getting below error : or how to solve

ERROR! We were unable to read either as JSON nor YAML, these are the errors we got from each:
JSON: No JSON object could be decoded

Syntax Error while loading YAML.
did not find expected key

The error appears to be in '/etc/ansible/user3.yml': line 33, column 4, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

# this task generate public keys for user
- name: generate ssh keys for a user
^ here

sunglimp
Автор

Hi yogesh,

Your videos on Ansible are very detailed and simple. Thank you so much for taking the time in making the videos. If there is a git repository where I can download the consolidated list of play books u created, it would be of great help to work with them and practice ansible. Thank you so much in advance.

sailwithsailesh
Автор

It took me 2 mins to learn that you are saying secondary group...

swapnilshingote
Автор

Hi Yogesh, i did same as above copied the keys in all the machines, but when try to create user in remote machine, i used become, its giving error "Shared connection to node1 closed.\r\n", "module_stdout": "sudo: a password is required\r\n" " please help me with this
- hosts: client1
remote_user: ansible
become: yes
become_method: sudo
gather_facts: no
vars:
passwd: "{{'password' | password_hash('sha512') }}"
tasks:
- name: creating user
user: name=username password={{ passwd }} state=present

sankarinkollu
Автор

Hell Mr. Yogesh,
It's very nice demo for User Managment. I would appriciate if could share playbook for the same. Thanks.

CloudTechnocrats
Автор

Hi how I can set password without using variables and openssl method .. i want to give direct password to user in task while creating user... it is possible?

santoshsontakke
Автор

Hi Yogesh,

Could you please advise how to do privileged access to any user using ansible.

A brief explanation and also whether should it requires any parameter changes in ansible.cfg file.

I have written a playbook, kindly advise for it.

---
- hosts: 192.168.0.55
remote_user: Atanu
become: true
become_method: su

tasks:
- name: start the nfs service
service:
name: nfs
enabled: yes
state: started

atanudebnath
Автор

Hi Yogesh,

Can please share the playbook ....

Thanx in Advance .

AshokReddy-ergl
Автор

Hi Mr. Mehta,
May i ask if you could please send myself on a copy of your playbook please.

Greenguymrmacker
Автор

Great video Yogesh! Can I get a copy of that playbook, please?

billt
Автор

This is for Linux to Linux machine or this playbook wil work for linux to Windows too?

sushmitasuren
Автор

Hi sir, wat is the use of become_user. If I don't write this what will be the result?

chilaraytimes
Автор

I need this playbook sir. Can you please share the playbook with me.
Thank you.

chandansinghrathore
Автор

Hello sir, in the add_several_users tag, what is the use of that password you have given?
Thank you in advance. All videos are superb sir.

sudhirnikhade
Автор

could you possibly save typing by pasting file?

tuomasiboke
Автор

Hi Yogesh, could you please share this playbook to me, thanks for making awesome video on playbook

HarkishanVagadiya