-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCentos7min.json
99 lines (99 loc) · 3.23 KB
/
Centos7min.json
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
{
"variables": {
"iso_url": "/tmp/isos/CentOS-7-x86_64-Minimal-1611.iso",
"iso_sha256": "27bd866242ee058b7a5754e83d8ee8403e216b93d130d800852a96f41c34d86a",
"ssh_user": "vagrant",
"ssh_pass": "vagrant",
"esxi_datastore": "datastore2",
"esxi_host": "192.168.30.10",
"esxi_username": "root",
"esxi_password": "vagrant",
"vcenter_host": "192.168.30.5",
"vcenter_username": "administrator@vsphere.local",
"vcenter_password": "vagrant",
"esxi_type": "esx5"
},
"builders": [
{
"type": "vmware-iso",
"vm_name" : "Centos7",
"disk_type_id": "thin",
"disk_size": "51200",
"floppy_files": [
"/tmp/workspace/packer-centos-7-minimal/centos7-ks.cfg"
],
"remote_host": "{{user `esxi_host`}}",
"remote_username": "{{user `esxi_username`}}",
"remote_password": "{{user `esxi_password`}}",
"remote_datastore": "{{user `esxi_datastore`}}",
"remote_type": "esx5",
"guest_os_type": "centos-64",
"headless": false,
"version": 11,
"vmx_data": {
"mem.hotadd": "TRUE",
"memsize": "2048",
"numvcpus": "1",
"scsi0.virtualDev": "lsisas1068",
"vcpu.hotadd": "TRUE",
"ethernet0.present": true,
"ethernet0.connected": true,
"ethernet0.virtualdev": "vmxnet3",
"ethernet0.networkName": "BridgedNetwork",
"ethernet1.present": true,
"ethernet1.connected": true,
"ethernet1.virtualdev": "vmxnet3",
"ethernet1.networkName": "VM Network"
},
"vmx_data_post": {
"ethernet0.virtualdev": "vmxnet3"
},
"iso_checksum_type": "sha256",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_sha256`}}",
"ssh_timeout": "600s",
"ssh_username": "{{user `ssh_user`}}",
"ssh_password": "{{user `ssh_pass`}}",
"shutdown_command": "echo '{{user `ssh_pass`}}'|sudo -S /sbin/halt -h -p",
"boot_wait": "10s",
"boot_command": [
"<up><wait><tab> text inst.ks=hd:fd0:/centos7-ks.cfg <enter>"
]
}
],
"provisioners":[
{
"type": "shell",
"execute_command": "echo '{{user `ssh_pass`}}'| {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"script": "scripts/nopasswd.sh"
},
{
"type": "shell",
"script": "scripts/ansible.sh"
},
{
"type": "ansible-local",
"playbook_file": "ansible/site.yml",
"role_paths": [
"ansible/roles/motd",
"ansible/roles/vmware-tools",
"ansible/roles/yumupdate"
]
},
{
"type": "shell",
"execute_command": "echo '{{user `ssh_pass`}}'| {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"script": "scripts/cleanup.sh"
}
],
"post-processors":[
{
"type": "vsphere-template",
"host": "{{user `vcenter_host`}}",
"username": "{{user `vcenter_username`}}",
"password": "{{user `vcenter_password`}}",
"insecure": "true",
"folder": "/templates/os/centos-7"
}
]
}