19 lines
574 B
YAML
19 lines
574 B
YAML
---
|
|
- name: Ensure Desired Windows Features Are Installed
|
|
ansible.windows.win_feature:
|
|
name: "{{ desired_features }}"
|
|
state: present
|
|
include_management_tools: true
|
|
register: installed_features
|
|
|
|
- name: Ensure Undesired Windows Features Are Removed
|
|
ansible.windows.win_feature:
|
|
name: "{{ undesired_features }}"
|
|
state: absent
|
|
register: removed_features
|
|
|
|
- name: Restart The System If Reboot Required
|
|
ansible.windows.win_reboot:
|
|
boot_time_command:
|
|
when: installed_features.reboot_required is true or removed_features.reboot_required is true
|