On 12/16/20 8:56 PM, Rene Paquin wrote:
> Hi.  New ansible user here so just starting out.  My first experiment is to 
> create a user with sudo privileges on an
> Oracle Linux 8 server in my test environment.  Here are the contents of the 
> files in the /home/”user”/ansible/playbooks
> folder.  I think I am missing something as when I run the playbook it runs 
> successfully.  I confirm that the account is
> created however when I attempt to ssh or login the attempt gets denied 
> access. 
> 
>  
> 
> Any help is appreciated.
> 
>  
> 
> Thank you,
> 
>  
> 
> *user_pass.ym*l  - encrypted using   “ansible-vault create user_pass.yml”  in 
> group_vars folder
> 
> admin_group: wheel
> 
> password: #G00d4now
> 
>  
> 
> *ansible.cfg*
> 
> [defaults]
> 
> inventory = ./inventory
> 
> remote_user =  (local user with authorized keys)
> 
> [privilege_escalation]
> 
> become = true
> 
> become_method = sudo
> 
> become_user = root
> 
>  
> 
> *inventory*
> 
> [ol8]
> 
> qansibletest
> 
>  
> 
> *create_users.yml*
> 
> -  name: Create New Users
> 
>   hosts: all
> 
>   gather_facts: false
> 
>   tasks:
> 
> - name: Create User Task
> 
>       user:
> 
>         name: devops
> 
>         state: present
> 
>         password: "{{ 'password' | password_hash('sha512','A512') }}"
> 
>         shell: /bin/bash
> 
>         groups: "{{ admin_group }}"
> 
>         append: true
> 
> ...
> 
> 

You are literally passing the string "passsword" instead of the value of the 
password
variable. Remove the quotes from 'password',

Regards
         Racke
 
> 
>  
> 
>  
> 
> ********************************
> Rene Paquin - Systems Administrator
> Wilfrid Laurier University
> Waterloo, Ontario
> (519)884-0710 x3795
> [email protected] <mailto:[email protected]>
> 
>  
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to
> [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/YTXPR0101MB1295AA2DBF8B42EDB8DCD249D8C50%40YTXPR0101MB1295.CANPRD01.PROD.OUTLOOK.COM
> <https://groups.google.com/d/msgid/ansible-project/YTXPR0101MB1295AA2DBF8B42EDB8DCD249D8C50%40YTXPR0101MB1295.CANPRD01.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>.


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c25e9a65-bab9-74f1-1914-a595ed877e20%40linuxia.de.

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to