changing hostname and search updates

This commit is contained in:
L3D 2021-12-20 19:10:07 +01:00
parent aa51fb36bf
commit 64a25c272e
Signed by: l3d
GPG key ID: CD08445BFF4313D1
4 changed files with 22 additions and 2 deletions

View file

@ -20,5 +20,3 @@
- 'Ansibles'
- 'Administratoren'
- 'Benutzer'

9
tasks/hostname.yml Normal file
View file

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

View file

@ -2,4 +2,8 @@
- name: create Ansible Windows Group and User
ansible.builtin.include_tasks: ansible_user.yml
- name: configure hostname
ansible.builtin.include_tasks: hostname.yml
- name: scan for updates
ansible.builtin.include_tasks: updates.yml

9
tasks/updates.yml Normal file
View file

@ -0,0 +1,9 @@
---
- name: Search-only, return list of found updates (if any), log to C:\ansible_updates.txt
ansible.windows.win_updates:
category_names:
- SecurityUpdates
- CriticalUpdates
- UpdateRollups
state: searched
log_path: C:\ansible_updates.txt