-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathci.yml
47 lines (44 loc) · 1.67 KB
/
ci.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
---
min_packer_version: 1.7.9
variables:
# All the variables are set by the build_image.sh script based on the path
bait_path: .
image_name: image
parent_name: parent_image
out_full_path: "{{ env `PWD` }}/out"
parent_full_path: "{{ user `out_full_path` }}/parent_image-version"
aquarium_bait_proxy_port: null # Local proxy port to bypass VPN routing
username: packer
password: packer
builders:
- type: vmware-vmx
vm_name: "{{ user `image_name` }}"
display_name: "{{ user `image_name` }}"
source_path: "{{ user `parent_full_path` }}/{{ user `parent_name` }}.vmx"
linked: true # Use base image to simplify the data transfer
attach_snapshot: original
output_directory: "{{ user `out_full_path` }}/{{ user `image_name` }}"
headless: true
boot_wait: 2m
shutdown_command: "echo '{{ user `username` }}' | sudo -S shutdown -h now"
ssh_username: "{{ user `username` }}"
ssh_password: "{{ user `password` }}"
ssh_proxy_host: 127.0.0.1 # Local proxy in order to bypass VPN routing
ssh_proxy_port: "{{ user `aquarium_bait_proxy_port` }}"
ssh_timeout: 10s
ssh_read_write_timeout: 10s
ssh_wait_timeout: 2m
provisioners:
- type: ansible
command: "{{ user `bait_path` }}/scripts/run_ansible.sh"
playbook_file: "{{ user `bait_path` }}/playbooks/ci_image.yml"
user: "{{ user `username` }}"
extra_arguments:
- -e
- ansible_sudo_pass={{ user `password` }}
- -e
- jre_extract_path=/opt/srv/jre
# By default packer uses `/usr/bin/sftp-server -e` which not exist on macos,
# which causes issues while running on OpenSSH client >9
use_sftp: true
sftp_command: /usr/libexec/sftp-server -e