2022-11-06 18:14:27 +00:00
|
|
|
---
|
|
|
|
- hosts: all
|
|
|
|
roles:
|
|
|
|
- role: ansible-role-sssd
|
2022-11-29 20:23:44 +00:00
|
|
|
become: true
|
2022-11-06 18:14:27 +00:00
|
|
|
tasks:
|
|
|
|
- name: simulate login
|
|
|
|
stat:
|
|
|
|
path: "/home/{{user.name}}"
|
|
|
|
become: true
|
|
|
|
become_user: "{{user.name}}"
|
|
|
|
when: sssd_configure == true
|
|
|
|
- name: create profil
|
|
|
|
user:
|
2022-11-29 20:23:44 +00:00
|
|
|
name: "{{user.name}}"
|
|
|
|
create_home: yes
|
|
|
|
password: "{{userPassword}}"
|
|
|
|
system: no
|
|
|
|
state: present
|
|
|
|
ssh_key_file: .ssh/id_rsa
|
2022-11-06 18:14:27 +00:00
|
|
|
uid: "{{ user.uid }}"
|
|
|
|
shell: /bin/bash
|
|
|
|
when: sssd_configure is not defined or sssd_configure == false
|
2022-11-11 16:47:00 +00:00
|
|
|
become: true
|