2020-12-10 07:33:09 +00:00
|
|
|
---
|
|
|
|
# This playbook is meant to be used with callable variables, like adhoc or AWX.
|
2020-12-10 07:42:05 +00:00
|
|
|
# What: Creates users in the idm infrastructure based on the variables provided.
|
2020-12-10 07:33:09 +00:00
|
|
|
|
|
|
|
- name: Create a User
|
|
|
|
hosts: ipaserver
|
|
|
|
become: false
|
2020-12-21 05:05:52 +00:00
|
|
|
gather_facts: false
|
2020-12-10 07:33:09 +00:00
|
|
|
vars_files:
|
|
|
|
- vars/encpass.yml
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
- name: "Checking for user variables"
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- ipaadmin_password | mandatory
|
|
|
|
- ipaName | mandatory
|
|
|
|
- ipaFirst | mandatory
|
|
|
|
- ipaLast | mandatory
|
|
|
|
- ipaEmail | mandatory
|
|
|
|
- ipaPassword | mandatory
|
|
|
|
- ipaTitle | mandatory
|
|
|
|
success_msg: "Required variables provided"
|
|
|
|
fail_msg: "We are missing user information or ipa admin password"
|
|
|
|
|
|
|
|
- name: "Creating User Account"
|
2020-12-12 08:16:44 +00:00
|
|
|
freeipa.ansible_freeipa.ipauser:
|
2020-12-10 07:33:09 +00:00
|
|
|
ipaadmin_password: "{{ ipaadmin_password }}"
|
|
|
|
name: "{{ ipaName }}"
|
|
|
|
first: "{{ ipaFirst }}"
|
|
|
|
last: "{{ ipaLast }}"
|
|
|
|
email: "{{ ipaEmail }}"
|
|
|
|
password: "{{ ipaPassword }}"
|
|
|
|
title: "{{ ipaTitle }}"
|
|
|
|
loginshell: "{{ ipaLoginshell|default('/sbin/nologin', True) }}"
|
|
|
|
update_password: on_create
|
|
|
|
tags:
|
|
|
|
- users
|