changing hostname and search updates
This commit is contained in:
parent
aa51fb36bf
commit
64a25c272e
4 changed files with 22 additions and 2 deletions
|
@ -20,5 +20,3 @@
|
||||||
- 'Ansibles'
|
- 'Ansibles'
|
||||||
- 'Administratoren'
|
- 'Administratoren'
|
||||||
- 'Benutzer'
|
- 'Benutzer'
|
||||||
|
|
||||||
|
|
||||||
|
|
9
tasks/hostname.yml
Normal file
9
tasks/hostname.yml
Normal 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
|
|
@ -2,4 +2,8 @@
|
||||||
- name: create Ansible Windows Group and User
|
- name: create Ansible Windows Group and User
|
||||||
ansible.builtin.include_tasks: ansible_user.yml
|
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
9
tasks/updates.yml
Normal 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
|
Loading…
Reference in a new issue