Skip to content
Snippets Groups Projects
Commit 685f271b authored by eturkmen's avatar eturkmen
Browse files

Update file Playbook-Test2.yaml

parent f7d4c16f
No related branches found
No related tags found
No related merge requests found
......@@ -2,21 +2,9 @@
- name: Windows Updates
hosts: win
tasks:
- name: Installiere kritische und Sicherheitsupdates
- name: Install critical and security updates
ansible.windows.win_updates:
category_names: '*'
state: installed
reboot: false
log_path: C:\ansible.txt
- name: Überprüfe den Neustartstatus
win_shell: Get-WindowsUpdate -ComputerName localhost | Select-String -Pattern "reboot"
register: reboot_required
changed_when: false
ignore_errors: true
- name: Zeige den Neustartstatus an
debug:
msg: "Neustart erforderlich: {{ reboot_required }}"
when: reboot_required is defined and reboot_required.stdout is search("reboot")
log_path: C:\ansible.txt
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment