mono-infrastructure/ansible/playbooks/import-rockyusers.yml

72 lines
1.9 KiB
YAML
Raw Normal View History

2020-12-10 07:33:09 +00:00
---
2020-12-10 07:42:05 +00:00
# Creates the first set of users for the IdM Infrastructure. This
# should create both regular and admin accounts for separation of
# privilege.
2020-12-10 07:33:09 +00:00
- name: "Creating Initial Accounts"
freeipa.ansible_freeipa.ipauser:
2020-12-10 07:33:09 +00:00
ipaadmin_password: "{{ ipaadmin_password }}"
name: "{{ item.name }}"
first: "{{ item.first }}"
last: "{{ item.last }}"
2021-01-15 04:28:47 +00:00
email: "{{ item.email|default(omit) }}"
2020-12-10 07:33:09 +00:00
password: "{{ item.password }}"
title: "{{ item.title }}"
loginshell: "{{ item.loginshell }}"
update_password: on_create
loop: "{{ users }}"
tags:
- users
2020-12-14 03:06:42 +00:00
- name: "Creating Initial Admin Accounts"
freeipa.ansible_freeipa.ipauser:
ipaadmin_password: "{{ ipaadmin_password }}"
name: "{{ item.name }}"
first: "{{ item.first }}"
last: "{{ item.last }}"
2021-01-15 04:28:47 +00:00
email: "{{ item.email|default(omit) }}"
2020-12-14 03:06:42 +00:00
password: "{{ item.password }}"
title: "{{ item.title }}"
loginshell: "{{ item.loginshell }}"
update_password: on_create
loop: "{{ adminusers }}"
tags:
- users
- name: "Creating Service Accounts"
freeipa.ansible_freeipa.ipauser:
ipaadmin_password: "{{ ipaadmin_password }}"
name: "{{ item.name }}"
first: "{{ item.first }}"
last: "{{ item.last }}"
2021-01-15 04:28:47 +00:00
email: "{{ item.email|default(omit) }}"
password: "{{ item.password }}"
title: "{{ item.title }}"
loginshell: "{{ item.loginshell }}"
update_password: on_create
loop: "{{ svcusers }}"
tags:
- users
2021-01-03 05:18:47 +00:00
- name: "Creating bind account template - binder"
template:
src: "tmp/binder.update"
dest: "/tmp/binder.update"
owner: root
group: root
mode: '0600'
tags:
- users
- name: "Adding in the bind account - binder"
command: "/usr/sbin/ipa-ldap-updater /tmp/binder.update"
register: bind_account
changed_when: "bind_account.rc == 0"
tags:
- users
- name: "Remove template"
file:
path: "/tmp/binder.update"
state: absent
...