-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpacker-setup.yml
More file actions
40 lines (32 loc) · 1017 Bytes
/
packer-setup.yml
File metadata and controls
40 lines (32 loc) · 1017 Bytes
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
---
- name: set up local dir with packer json and build files
hosts: localhost
gather_facts: no
vars:
man_packer_setup_version: 1
ansible_user: white
ansible_password: "password"
opt_packer_setup_headless: false
packer_builder: vsphere
pre_tasks:
- name: check that the Ansible version is at least 2.7
assert:
that:
- ansible_version.major >= 2
- ansible_version.minor >= 7
msg: packer-windoze requires Ansible 2.7 or newer to run
- name: check that the provider is valid
assert:
that:
- packer_builder in ['vsphere']
msg: packer-windoze does not support this builder
- name: Process VMware vSphere based VM tasks
include_tasks: config/read_vmware_config.yaml
when: packer_builder == "vsphere"
roles:
- packer-setup
post_tasks:
- name: Export variables for provisioning phase
copy:
dest: "{{man_host_type}}/pri_packer_setup_config.yaml"
content: "{{ pri_packer_setup_config | to_nice_yaml }}"