-
Notifications
You must be signed in to change notification settings - Fork 0
/
example-win7-x86.yml
171 lines (170 loc) · 7.67 KB
/
example-win7-x86.yml
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#NOTE TLS 1.2 https://catalog.update.microsoft.com/search.aspx?q=kb3140245
---
- hosts: 127.0.0.1
connection: local
vars:
pkg_dir: 'toinstall'
# Put drivers in {{config_dive}}/$WinpeDriver$ Windows will autoinstall it
drivers_dir: '$WinpeDriver$'
tasks:
- name: Create temporary work directory
ansible.builtin.tempfile:
state: directory
suffix: iso_build_dir
register: iso_temp_root_build_dir
- name: Create temp iso root directory
ansible.builtin.file:
state: directory
path: '{{ iso_temp_root_build_dir.path }}/iso'
- name: Creating base configuration files for Windows and Ansible
win_setup:
# destination (root dir) for config files, generate ISO file in next tasks
dest: '{{ iso_temp_root_build_dir.path }}/iso'
# Change credentials after ansible installation if needed
admin_password: "Passw0rd!"
user_name: "IEUser"
user_password: "Passw0rd!"
computer_name: "IEWIN"
#first_logon_cmd: ""
# Gets converted to install.json to use in Windows Powershell
# files for installation with `name`s should be placed to
# `{{ config_iso_files_dir }}/{{pkg_dir}}/` directory in the following tasks
# index should be unique sortable value
install:
- index: 1
description: windows 7 sp1 x86 kb2533552
msu:
path: '\{{pkg_dir}}\windows6.1-kb2533552-x86.msu'
args: /quiet /NoRestart
- description: windows 7 sp1 x86
index: 2
restart: true
exe:
path: '\{{pkg_dir}}\windows6.1-kb976932-x86.exe'
args: /quiet
- index: 3
msi:
path: '\{{pkg_dir}}\OpenSSH-Win32-v8.9.1.0.msi'
args: ACTION=INSTALL UILevel=3 REBOOT=ReallySuppress
- index: 4
description: win7 sha256 codesign
restart: true
msu:
path: '\{{pkg_dir}}\windows6.1-kb4474419-v3-x86.msu'
args: /quiet /NoRestart
- index: 5
exe:
path: '\{{pkg_dir}}\ndp48-x86-x64-allos-enu.exe'
args: /q /norestart
- description: create dir temp\Win7-KB3191566-x86
index: 6
file:
state: directory
parents: true
path: C:\Win7-KB3191566-x86
- description: unzip Win7-KB3191566-x86 to Win7-KB3191566-x86
index: 7
zip:
path: '\{{pkg_dir}}\Win7-KB3191566-x86.zip'
dest: C:\Win7-KB3191566-x86
- description: install Win7-KB3191566-x86
index: 8
package:
path: C:\Win7-KB3191566-x86\Win7-KB3191566-x86.msu
args: /quiet /NoRestart
- description: delete Win7-KB3191566-x86
index: 9
restart: true
file:
state: absent
recurse: true
path: C:\Win7-KB3191566-x86
- name: Create pkg directory
ansible.builtin.file:
state: directory
path: '{{ iso_temp_root_build_dir.path }}/iso/{{pkg_dir}}'
- name: Download win7 sp1 x86 windows6.1-kb976932
ansible.builtin.get_url:
url: >-
https://catalog.s.download.windowsupdate.com/msdownload/update/software/svpk/2011/02/windows6.1-kb976932-x86_c3516bc5c9e69fee6d9ac4f981f5b95977a8a2fa.exe
dest: '{{ iso_temp_root_build_dir.path }}/iso/{{pkg_dir}}/windows6.1-kb976932-x86.exe'
force: true
checksum: sha256:e5449839955a22fc4dd596291aff1433b998f9797e1c784232226aba1f8abd97
- name: Download windows6.1-kb2533552-x86
ansible.builtin.get_url:
url: >-
https://catalog.s.download.windowsupdate.com/msdownload/update/software/crup/2011/05/windows6.1-kb2533552-x86_f2061d1c40b34f88efbe55adf6803d278aa67064.msu
dest: '{{ iso_temp_root_build_dir.path }}/iso/{{pkg_dir}}/windows6.1-kb2533552-x86.msu'
force: true
checksum: sha256:8e10ad0aa6096fefd18d385ec7bff399a197ca87257fe5c87c68fd6f80ea1138
- name: Download OpenSSH-Win32-v8.9.1.0.msi
ansible.builtin.get_url:
url: >-
https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.9.1.0p1-Beta/OpenSSH-Win32-v8.9.1.0.msi
dest: '{{ iso_temp_root_build_dir.path }}/iso/{{pkg_dir}}/OpenSSH-Win32-v8.9.1.0.msi'
force: true
checksum: sha256:16a0e2b6f01b86d866e422fb6f27b867ab5ed63cade94171003338395f0f26c6
- name: Download win7 sha256 codesign update
ansible.builtin.get_url:
url: >-
https://catalog.s.download.windowsupdate.com/c/msdownload/update/software/secu/2019/09/windows6.1-kb4474419-v3-x86_0f687d50402790f340087c576886501b3223bec6.msu
dest: '{{ iso_temp_root_build_dir.path }}/iso/{{pkg_dir}}/windows6.1-kb4474419-v3-x86.msu'
force: true
checksum: sha256:8cf49fc7ac61e0b217859313a96337b149ab41b3307eb0d9529615142ea34c6c
- name: Download ndp48-x86-x64-allos-enu.exe
ansible.builtin.get_url:
url: >-
https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe
dest: '{{ iso_temp_root_build_dir.path }}/iso/{{pkg_dir}}/ndp48-x86-x64-allos-enu.exe'
force: true
checksum: sha256:68c9986a8dcc0214d909aa1f31bee9fb5461bb839edca996a75b08ddffc1483f
- name: Download WMF 5.1
ansible.builtin.get_url:
url: >-
https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win7-KB3191566-x86.zip
dest: '{{ iso_temp_root_build_dir.path }}/iso/{{pkg_dir}}/Win7-KB3191566-x86.zip'
force: true
checksum: sha256:eb7e2c4ce2c6cb24206474a6cb8610d9f4bd3a9301f1cd8963b4ff64e529f563
- name: Download Virtio Drivers
ansible.builtin.get_url:
url: >-
https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.173-2/virtio-win.iso
dest: '{{ iso_temp_root_build_dir.path }}/virtio-win.iso'
force: true
checksum: sha256:8da37d153be6c12fdc25205517c3727fec7799d1060ac38111f404b274478344
- name: Create drivers directory
ansible.builtin.file:
state: directory
path: '{{ iso_temp_root_build_dir.path }}/iso/{{drivers_dir}}'
- name: Extract virtio drivers
community.general.iso_extract:
image: '{{ iso_temp_root_build_dir.path }}/virtio-win.iso'
dest: '{{ iso_temp_root_build_dir.path }}/iso/{{drivers_dir}}'
files:
- vioscsi/w7/x86/vioscsi.cat
- vioscsi/w7/x86/vioscsi.inf
- vioscsi/w7/x86/vioscsi.pdb
- vioscsi/w7/x86/vioscsi.sys
- viostor/w7/x86/viostor.cat
- viostor/w7/x86/viostor.inf
- viostor/w7/x86/viostor.sys
- viostor/w7/x86/viostor.pdb
- NetKVM/w7/x86/netkvm.cat
- NetKVM/w7/x86/netkvm.inf
- NetKVM/w7/x86/netkvm.pdb
- NetKVM/w7/x86/netkvm.sys
- NetKVM/w7/x86/netkvmco.dll
- NetKVM/w7/x86/netkvmco.pdb
- name: Create an windows config ISO file with Joliet support
community.general.iso_create:
src_files:
- '{{ iso_temp_root_build_dir.path }}/iso/{{drivers_dir}}'
- '{{ iso_temp_root_build_dir.path }}/iso/{{pkg_dir}}'
- '{{ iso_temp_root_build_dir.path }}/iso/start.ps1'
- '{{ iso_temp_root_build_dir.path }}/iso/main.ps1'
- '{{ iso_temp_root_build_dir.path }}/iso/install.json'
- '{{ iso_temp_root_build_dir.path }}/iso/autounattend.xml'
dest_iso: '{{ iso_output_path }}'
interchange_level: 4
joliet: 3
vol_ident: WIN_AUTOINSTALL