Update some usefull stuff and monitoring
This commit is contained in:
parent
be51bcdcbb
commit
3d03f0b99e
11 changed files with 59 additions and 0 deletions
15
.gitmodules
vendored
15
.gitmodules
vendored
|
@ -25,3 +25,18 @@
|
||||||
[submodule "collections/ansible_collections/ansible/windows"]
|
[submodule "collections/ansible_collections/ansible/windows"]
|
||||||
path = collections/ansible_collections/ansible/windows
|
path = collections/ansible_collections/ansible/windows
|
||||||
url = https://github.com/ansible-collections/ansible.windows.git
|
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
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
ansible_user: 'L3D'
|
ansible_user: 'L3D'
|
||||||
|
win_hostname: 'twr'
|
||||||
|
|
9
roles/hostname/tasks/main.yml
Normal file
9
roles/hostname/tasks/main.yml
Normal 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
1
roles/l3d.icmp
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit b277f41d6266005140ca6cbbe1564f2bb0314873
|
1
roles/l3d.rdp
Submodule
1
roles/l3d.rdp
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 90a2558a71fd993b49ea566409ed76475298a6db
|
1
roles/l3d.sshd
Submodule
1
roles/l3d.sshd
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit ca2bd9cbc7026d8a25c67beb6805f1693b14c0e4
|
1
roles/l3d.time
Submodule
1
roles/l3d.time
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit cf24cdb5c2c8c142428ef9d945a65b4704b3d976
|
1
roles/l3d.win_exporter
Submodule
1
roles/l3d.win_exporter
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 2d8c58259394e6f70880c07e6da3ceb217af6110
|
2
roles/powerplan/defaults/main.yml
Normal file
2
roles/powerplan/defaults/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
---
|
||||||
|
powerplan__mode: 'high performance'
|
20
roles/powerplan/tasks/main.yml
Normal file
20
roles/powerplan/tasks/main.yml
Normal 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
|
7
site.yml
7
site.yml
|
@ -10,6 +10,13 @@
|
||||||
roles:
|
roles:
|
||||||
- {role: l3d.choco, tags: choco}
|
- {role: l3d.choco, tags: choco}
|
||||||
- {role: win_activating, tags: zeroconf}
|
- {role: win_activating, tags: zeroconf}
|
||||||
|
- {role: hostname, tags: hostname}
|
||||||
|
- {role: l3d.icmp, tags: ping}
|
||||||
- {role: win_zeroconf, tags: zeroconf}
|
- {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: win_gopass, tags: gopass}
|
||||||
- {role: l3d.wireguard, tags: wireguard}
|
- {role: l3d.wireguard, tags: wireguard}
|
||||||
|
- {role: roles/l3d.win_exporter, tags: monitoring}
|
||||||
|
|
Loading…
Reference in a new issue