update voc

This commit is contained in:
L3D 2022-12-30 01:52:49 +01:00
parent c3a8c3ab35
commit 04e6d2d4c8
Signed by: l3d
GPG key ID: CD08445BFF4313D1
2 changed files with 11 additions and 3 deletions

3
defaults/main.yml Normal file
View file

@ -0,0 +1,3 @@
---
win__special_rdp_user: 'voc'
win__allow_special_rdp_user: false

View file

@ -11,9 +11,9 @@
changed_when: _a.changed
- name: Touch a file (creates if not present, updates modification time if present)
ansible.windows.win_file:
path: .ansible\status\rdp.txt
state: touch
ansible.windows.win_copy:
dest: .ansible\status\rdp.txt
content: 'Ansible opened RDP on this host'
register: _a
# https://exchangepedia.com/2016/10/enable-remote-desktop-rdp-connections-for-admins-on-windows-server-2016.html
@ -37,3 +37,8 @@
profiles: private
state: present
enabled: true
- name: "Allow RDP for User {{ win__special_rdp_user }}"
ansible.windows.win_powershell:
script: 'Add-LocalGroupMember -Group "Remote Desktop Users" -Member {{ win__special_rdp_user }}'
when: win__allow_special_rdp_user | bool