Update some usefull stuff and monitoring

This commit is contained in:
L3D 2024-02-27 16:50:56 +01:00
parent be51bcdcbb
commit 3d03f0b99e
Signed by: l3d
GPG key ID: CD08445BFF4313D1
11 changed files with 59 additions and 0 deletions

15
.gitmodules vendored
View file

@ -25,3 +25,18 @@
[submodule "collections/ansible_collections/ansible/windows"]
path = collections/ansible_collections/ansible/windows
url = https://github.com/ansible-collections/ansible.windows.git
[submodule "roles/l3d.sshd"]
path = roles/l3d.sshd
url = https://git.l3d.ch/voc/win_ansible_role_sshd.git
[submodule "roles/l3d.time"]
path = roles/l3d.time
url = https://git.l3d.ch/win_ansible/ansible_role_win_time.git
[submodule "roles/l3d.rdp"]
path = roles/l3d.rdp
url = https://git.l3d.ch/voc/win_ansible_role_rdp.git
[submodule "roles/l3d.icmp"]
path = roles/l3d.icmp
url = https://git.l3d.ch/voc/win_ansible_role_firewall_icmp.git
[submodule "roles/l3d.win_exporter"]
path = roles/l3d.win_exporter
url = https://git.l3d.ch/win_ansible/ansible_role_win_exporter.git

View file

@ -1 +1,2 @@
ansible_user: 'L3D'
win_hostname: 'twr'

View file

@ -0,0 +1,9 @@
---
- name: Change the hostname to {{ win_hostname | default (ansible_hostname) }}
ansible.windows.win_hostname:
name: "{{ win_hostname | default (ansible_hostname) }}"
register: res
- name: Reboot
ansible.windows.win_reboot:
when: res.reboot_required

1
roles/l3d.icmp Submodule

@ -0,0 +1 @@
Subproject commit b277f41d6266005140ca6cbbe1564f2bb0314873

1
roles/l3d.rdp Submodule

@ -0,0 +1 @@
Subproject commit 90a2558a71fd993b49ea566409ed76475298a6db

1
roles/l3d.sshd Submodule

@ -0,0 +1 @@
Subproject commit ca2bd9cbc7026d8a25c67beb6805f1693b14c0e4

1
roles/l3d.time Submodule

@ -0,0 +1 @@
Subproject commit cf24cdb5c2c8c142428ef9d945a65b4704b3d976

@ -0,0 +1 @@
Subproject commit 2d8c58259394e6f70880c07e6da3ceb217af6110

View file

@ -0,0 +1,2 @@
---
powerplan__mode: 'high performance'

View file

@ -0,0 +1,20 @@
---
- name: Change the power plan to high performance
community.windows.win_power_plan:
name: "{{ powerplan__mode }}"
register: _pwr
- name: "Apply custom powerplan poweshell script"
ansible.windows.win_powershell:
script: |
Write-Host "Disabling Screensaver"
Set-ItemProperty "HKCU:\Control Panel\Desktop" -Name ScreenSaveActive -Value 0 -Type DWord
& powercfg -x -monitor-timeout-ac 0
& powercfg -x -monitor-timeout-dc 0
& powercfg -x standby-timeout-ac 0
& powercfg -x standby-timeout-dc 0
& powercfg -x hibernate-timeout-ac 0
& powercfg -x hibernate-timeout-dc 0
& powercfg -x disk-timeout-ac 0
& powercfg -x disk-timeout-dc 0
changed_when: _pwr.changed

View file

@ -10,6 +10,13 @@
roles:
- {role: l3d.choco, tags: choco}
- {role: win_activating, tags: zeroconf}
- {role: hostname, tags: hostname}
- {role: l3d.icmp, tags: ping}
- {role: win_zeroconf, tags: zeroconf}
- {role: powerplan, tags: powerplan}
- {role: l3d.sshd, tags: ssh}
- {role: l3d.time, tags: time}
- {role: l3d.rdp, tags: rdp}
# - {role: win_gopass, tags: gopass}
- {role: l3d.wireguard, tags: wireguard}
- {role: roles/l3d.win_exporter, tags: monitoring}