win_ansible_role_obs_setup/tasks/obs_user.yml

21 lines
637 B
YAML
Raw Normal View History

2021-12-20 19:25:17 +01:00
---
2022-12-28 17:29:41 +01:00
- name: Fail if win_obs_init__password is unset
2022-01-01 22:09:18 +01:00
ansible.builtin.fail:
msg: "Please define a password for 'win_obs_init__password'!"
when: win_obs_init__password == 'changeME'
2022-12-29 04:32:04 +01:00
- name: "Create User {{ win_obs_init__user }}"
2021-12-20 19:25:17 +01:00
ansible.windows.win_user:
2022-12-29 04:32:04 +01:00
name: "{{ win_obs_init__user }}"
2021-12-20 19:25:17 +01:00
state: present
2022-02-16 20:49:46 +01:00
password: "{{ win_obs_init__password }}"
2021-12-20 19:25:17 +01:00
account_disabled: false
description: 'Account to run OBS at this WINDOWS host'
groups_action: 'add'
password_expired: false
password_never_expires: true
user_cannot_change_password: true
groups:
2022-12-28 17:29:41 +01:00
- 'S-1-5-32-545' # Users
2022-12-29 18:38:07 +01:00
register: _user