joelbirchler
2020-02-17 69dbaafbb88bdf8c03eb88d743ebe908e670cc0e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# https://github.com/cedrozor/myrtille
 
- name: Install IIS and .Net 4.5 on Server
  win_feature:
    name:
      - Web-Server
      - NET-Framework-Core
#      - Application-Server
      - Web-Asp-Net45
    include_management_tools: True
    state: present
  when: "'Windows 10' not in ansible_distribution"
 
- name: Install IIS and .Net 4.5 on Non-Server
  win_dsc:
    resource_name: WindowsOptionalFeature
    Name: "{{ item }}"
    Ensure: Enable
  when: "'Windows 10' in ansible_distribution"
  loop:
    - IIS-WebServerRole
    - IIS-WebServer
    - NetFx4Extended-ASPNET45
    - IIS-NetFxExtensibility45
    - IIS-ISAPIExtensions
    - IIS-ISAPIFilter
    - IIS-ASPNET45
 
- name: Create temp directory
  win_file:
    path: C:\Temp\
    state: directory
 
- name: Check if Myrtille is downloaded
  win_stat:
    path: C:\Temp\Myrtille_2.3.1_x86_x64_Setup.exe
  register: myrtille
 
# The following fails because windows defaults to TLS 1.0 and Github now requires 1.2
# - name: Download Myrtille to specified path only if modified
#   win_get_url:
#     url: https://github.com/cedrozor/myrtille/releases/download/v2.3.1/Myrtille_2.3.1_x86_x64_Setup.exe
#     dest: C:\Temp\Myrtille_2.3.1_x86_x64_Setup.exe
#   when: not myrtille.stat.exists
 
- name: Download Myrtille to specified path only if modified
  win_shell: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri 'https://github.com/cedrozor/myrtille/releases/download/v2.3.1/Myrtille_2.3.1_x86_x64_Setup.exe' -OutFile 'C:\\Temp\\Myrtille_2.3.1_x86_x64_Setup.exe'"
  when: not myrtille.stat.exists
 
- name: Extract the binary
  win_command: Myrtille_2.3.1_x86_x64_Setup.exe -o "C:\Temp" -y
  args:
    chdir: C:\Temp\
    creates: C:\Temp\setup.exe
 
- name: Install Myrtille
  win_package:
    path: C:\Temp\setup.exe
    arguments: /q
    creates_path: C:\Program Files (x86)\Myrtille
 
- name: Disable NTLM RDP Authetication requirement
  win_regedit:
    path: HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
    name: "{{ item }}"
    data: 0
    type: dword
  with_items:
    - SecurityLayer
    - UserAuthentication
 
- name: Create RDP Application
  win_iis_webapplication:
    name: rdp
    site: Default Web Site
    application_pool: MyrtilleAppPool
    physical_path: C:\Program Files (x86)\Myrtille\
    state: present