Ansible-POC/tasks/set-windows-features.yml

19 lines
549 B
YAML
Raw Normal View History

2022-09-17 15:21:39 -05:00
---
2022-09-17 15:43:24 -05:00
- name: Install Desired Windows Features
2022-09-17 15:21:39 -05:00
ansible.windows.win_feature:
name: "{{ desired_features }}"
state: present
include_management_tools: true
register: installed_features
2022-09-17 15:43:24 -05:00
- name: Remove Undesired Windows Features
2022-09-17 15:21:39 -05:00
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