RHCE 8 - Ansible User Module

preview_player
Показать описание
So lets take a look at creating and managing users in Ansible. In doing so we can investigate variables sourced from directories, group_vars/ and using the Ansible vault to encrypt sensitive data. We may also want to create more than one user account and we can do this using loops within our task. This will allow us to create the 4 users. In the same way we can delete the same users using a loop. We will also ensure to disable the gather_facts task which we don't need, saving valuable CPU time on our system. As this is helping you prepare for your RHCE in RHEL 8 as well as understanding Ansible, I encourage you to practice this on your own system.

---
- name: Create New Users
hosts: all
gather_facts: false
tasks:
- name: Create Users Task
user:
name: "{{ item }}"
state: present
password: "{{ default_user_password | password_hash('sha512', 'A512') }}"
shell: /bin/bash
groups: "{{ admin_group }}"
loop:
- bob
- wendy
- lofty
- dizzy
...

Рекомендации по теме
Комментарии
Автор

Currently studying for my RHCE exam 300. But I still found this video extremely useful as I much prefer using Ansible vs Puppet. Puppet has the Hiera data model which actually used yaml files but it's more confusing in my opinion. You can encrypt credentials in Puppet though.

UrbanGuitarLegend
Автор

Thanks for the video.
Also, don't forget Scoop, Muck Roley .... I am guessing someone has grand children

markhodsdon
Автор

How are you including the file in group_vars directory I am getting error in my ubuntu system :-"fatal: [db-server]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'default_user_password' is undefined\n\"

swapnilshingote
Автор

Urban Penguin!
Can they build it?
Urban Penguin!
Yes they can!

markadams
Автор

i want to output a cvs which shows following server and user password changed.can any ine help

aswinks
Автор

Hello, can you share an example of changing the user password with ansible from the linux controller server of the windows server?

aotech
Автор

The users are a from a cartoon called Bob the Builder.

LordDevi
Автор

Thanks for the video, how have you configured vim the way you have it on the video?

TAICHISCO
Автор

Hi URBAN penguin, can you please demo how to configure passwordless in linux using ansible?

kayoutube
Автор

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

santoshsontakke