enable optional autologon

This commit is contained in:
L3D 2022-01-01 21:53:30 +01:00
parent c7de037377
commit 5a3635de89
Signed by: l3d
GPG key ID: CD08445BFF4313D1
5 changed files with 21 additions and 1 deletions

View file

@ -11,3 +11,4 @@ Ansible role to deploy a obs setup on windows
-------------- --------------
+ Create User OBS + Create User OBS
+ install OBS, VLC and MPV + install OBS, VLC and MPV
+ optionally configure autologon *(see ``win_obs_init__autologon_*`` variables)*

View file

@ -1,5 +1,10 @@
--- ---
win_obs_init__pass_prefix: 'ansible/windows' win_obs_init__pass_prefix: 'ansible/windows'
win_obs_init__user: 'obs'
win_obs_init__autologon: false
win_obs_init__autologon_state: present
win_obs_init__autologon_user: "{{ win_obs_init__user }}"
win_obs_init__autologon_password: 'pleaseDefine'
win_obs_init__packages: win_obs_init__packages:
- mpvio - mpvio
- vlc - vlc

11
tasks/autologon.yml Normal file
View file

@ -0,0 +1,11 @@
---
- name: fail if win_obs_init__autologon_password unset
ansible.builtin.fail:
msg: "Please define a password for 'win_obs_init__autologon_password'!"
when: win_obs_init__autologon_password == 'pleaseDefine'
- name: "Set autologon for {{ win_obs_init__autologon_user }}"
community.windows.win_auto_logon:
username: "{{ win_obs_init__autologon_user }}"
password: "{{ win_obs_init__autologon_password }}"
state: "{{ win_obs_init__autologon_state }}"

View file

@ -5,3 +5,6 @@
- name: install some obs specific packages - name: install some obs specific packages
ansible.builtin.include_tasks: packages.yml ansible.builtin.include_tasks: packages.yml
- name: optionally autologon to obs user
ansible.builtin.include_tasks: autologon.yml
when: win_obs_init__autologon | bool

View file

@ -11,4 +11,4 @@
password_never_expires: true password_never_expires: true
user_cannot_change_password: true user_cannot_change_password: true
groups: groups:
- 'Benutzer' - 'S-1-5-32-545' # Users