From 55c3698ae324c590d81a295c07886456bf2b2bf1 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 18 Sep 2022 14:26:08 +0200 Subject: [PATCH] feat: add users option password_expire_min --- tasks/users_default.yml | 1 + tasks/users_univention.yml | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tasks/users_default.yml b/tasks/users_default.yml index c4a83e4..fcb4442 100644 --- a/tasks/users_default.yml +++ b/tasks/users_default.yml @@ -12,6 +12,7 @@ groups: "{{ item.groups | default([]) | join(',') or omit }}" append: "{{ True if (item.groups | default([]) | length > 0) else False }}" password: "{{ item.password | password_hash('sha512',65534 | random(seed=inventory_hostname) | string) if item.password is defined else omit }}" + password_expire_min: "{{ item.password_expire_min | default(omit) }}" shell: "{{ item.shell | default('/bin/bash') }}" loop: "{{ users_default_users }}" loop_control: diff --git a/tasks/users_univention.yml b/tasks/users_univention.yml index 84627c6..3f1950d 100644 --- a/tasks/users_univention.yml +++ b/tasks/users_univention.yml @@ -2,21 +2,22 @@ - block: # use system users and groups to prevent duplicate ids # this is a workaround because udm_user not working - - name: Create common groups + - name: Create groups group: name: "{{ item }}" - system: 'yes' + system: "yes" state: present loop: "{{ users_default_groups }}" - - name: Create common users + - name: Create users user: name: "{{ item.name }}" groups: "{{ item.groups | default([]) | join(',') or omit }}" append: "{{ True if (item.groups | default([]) | length > 0) else False }}" password: "{{ item.password | default(omit) | password_hash('sha512',65534 | random(seed=inventory_hostname) | string) }}" + password_expire_min: "{{ item.password_expire_min | default(omit) }}" shell: "{{ item.shell | default('/bin/bash') }}" - system: 'yes' + system: "yes" loop: "{{ users_default_users }}" loop_control: label: "{{ item.name }}"