Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nidr0x/5d7012b4c5dc64bc7f5868e937bdd1a6 to your computer and use it in GitHub Desktop.
Save nidr0x/5d7012b4c5dc64bc7f5868e937bdd1a6 to your computer and use it in GitHub Desktop.
#Needed for installing SQL Server via Chocolatey in Win2012
- name: Download Hotfixes
win_get_url:
url: "{{ item.url }}"
dest: "C:/{{ item.kb }}.msu"
with_items:
- { kb: KB2919442, url: "https://download.microsoft.com/download/D/6/0/D60ED3E0-93A5-4505-8F6A-8D0A5DA16C8A/Windows8.1-KB2919442-x64.msu" }
- { kb: KB2919355, url: "https://download.microsoft.com/download/2/5/6/256CCCFB-5341-4A8D-A277-8A81B21A1E35/Windows8.1-KB2919355-x64.msu" }
#Needed to avoid provision stop in W2016 because is not needed
when: ansible_distribution == "Microsoft Windows Server 2012 R2 Datacenter" or ansible_distribution == "Microsoft Windows Server 2012 R2"
- name: Install KB2919442 Hotfix
win_hotfix:
hotfix_kb: KB2919442
source: "C:/KB2919442.msu"
register: hotfix_KB2919442
when: ansible_distribution == "Microsoft Windows Server 2012 R2 Datacenter" or ansible_distribution == "Microsoft Windows Server 2012 R2"
tags: trigger
- name: Install KB2919355 Hotfix
win_hotfix:
hotfix_kb: KB2919355
source: "C:/KB2919355.msu"
register: hotfix_KB2919355
when: ansible_distribution == "Microsoft Windows Server 2012 R2 Datacenter" or ansible_distribution == "Microsoft Windows Server 2012 R2"
- name: Remove Hotfix downloads
win_file:
path: "C:/{{ item }}.msu"
state: absent
with_items:
- KB2919442
- KB2912355
when: ansible_distribution == "Microsoft Windows Server 2012 R2 Datacenter" or ansible_distribution == "Microsoft Windows Server 2012 R2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment