Files
toallab-automation/roles/oatakan.windows_template_build/tasks/security-update-win2012.yml

38 lines
1.4 KiB
YAML

---
# this update is needed to enable .NET clients to use https (tslv12) on Windows 8.1 and Windows Server 2012 R2
# see https://www.microsoft.com/en-us/download/confirmation.aspx?id=42883
- name: download hotfix
win_get_url:
url: '{{ dot_net_security_hotfix.url }}'
dest: '{{ dot_net_security_hotfix_download_location }}\{{ dot_net_security_hotfix.file }}'
register: download_hotfix
until: download_hotfix is success
delay: 3
retries: 5
- block:
- name: install hotfix (PS >= 4)
win_hotfix:
source: '{{ dot_net_security_hotfix_download_location }}\{{ dot_net_security_hotfix.file }}'
state: present
register: hotfix_install
when: ansible_powershell_version is version('4', '>=')
rescue:
- name: install hotfix using shell
win_shell: '{{ dot_net_security_hotfix_download_location }}\{{ dot_net_security_hotfix.file }} /quiet /norestart'
register: hotfix_install
- name: install hotfix (PS == 3)
win_shell: '{{ dot_net_security_hotfix_download_location }}\{{ dot_net_security_hotfix.file }} /quiet /norestart'
register: hotfix_install
when: ansible_powershell_version is version('3', '==')
- name: ensure hotfix file is removed
win_file:
path: '{{ dot_net_security_hotfix_download_location }}\{{ dot_net_security_hotfix.file }}'
state: absent
- name: reboot if needed
win_reboot:
when: hotfix_install.reboot_required | default(False)