-
Notifications
You must be signed in to change notification settings - Fork 37
/
main.yml
69 lines (58 loc) · 1.63 KB
/
main.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
- name: setup build files
hosts: setup
gather_facts: no
vars:
force: False
headless: False
pre_tasks:
- name: check that the Ansible version is at least 2.13
assert:
that:
- ansible_version.major >= 2
- ansible_version.minor >= 13
msg: packer-windoze requires Ansible 2.13 or newer to run, please upgrade or checkout devel before running
- name: check that the platform is valid
assert:
that:
- platform in ['hyperv', 'qemu', 'virtualbox']
msg: packer-windoze only supports the hyperv, qemu, and virtualbox provider
- name: check that pypsrp is installed
command: python -c "import pypsrp"
changed_when: False
roles:
- setup
- name: setup windows host
hosts: windows
gather_facts: no
pre_tasks:
- name: wait for Windows host WinRM to come online
wait_for_connection:
timeout: 14400 # The bootstrapping process can take some time
roles:
- update
- personalise
- role: jborean93.win_openssh
opt_openssh_firewall_profiles: domain,private,public
opt_openssh_skip_start: True
opt_openssh_version: '{{ openssh_version }}'
opt_openssh_powershell_subsystem: '{{ out_personalize_pwsh_path | default(omit) }}'
- cleanup-winsxs
- cleanup-features
- cleanup
- sysprep
post_tasks:
- name: shutdown host for sysprep
raw: schtasks.exe /Run /TN "packer-shutdown"
- name: wait for Windows host to go offline
wait_for:
host: '{{ ansible_host }}'
port: '{{ ansible_port }}'
state: stopped
delegate_to: localhost
- name: package Vagrant box
hosts: setup
gather_facts: no
tags:
- box
roles:
- box