forked from rmoesbergen/packer-linuxmint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore_template.json
More file actions
81 lines (81 loc) · 2.8 KB
/
core_template.json
File metadata and controls
81 lines (81 loc) · 2.8 KB
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
{
"variables": {
"headless": "false",
"ssh_password": "vagrant",
"ssh_username": "vagrant",
"ansible_dir": "ansible",
"scripts_dir": "script",
"memsize": "1024",
"numcpus": "2",
"disk_size": "20000",
"iso_checksum": "sha256:7a04b54830004e945c1eda6ed6ec8c57ff4b249de4b331bd021a849694f29b8f",
"iso_url": "https://www.mirrorservice.org/sites/www.linuxmint.com/pub/linuxmint.com/stable/22/linuxmint-22-cinnamon-64bit.iso",
"version": "1.1.2",
"vm_name": "mint-cinnamon-22"
},
"builders": [
{
"vm_name": "{{user `vm_name`}}",
"cpus": "2",
"memory": "4096",
"type": "virtualbox-iso",
"guest_os_type": "Ubuntu22_LTS_64",
"http_directory": "http",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum": "{{ user `iso_checksum` }}",
"ssh_password": "{{ user `ssh_password` }}",
"ssh_username": "{{ user `ssh_username` }}",
"ssh_wait_timeout": "10000s",
"headless": "{{ user `headless` }}",
"boot_command": [
"<esc><wait>",
"/casper/vmlinuz ",
"url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"boot=casper ",
"initrd=/casper/initrd.lz ",
"debug-ubiquity ",
"automatic-ubiquity ",
"noprompt ",
"-- <enter>"
],
"shutdown_command": "echo '{{ user `ssh_password` }}'|sudo -S shutdown -P now",
"post_shutdown_delay": "30s",
"disk_size": "{{ user `disk_size` }}",
"guest_additions_mode": "disable",
"hard_drive_interface": "sata",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"],
["modifyvm", "{{ .Name }}", "--memory", "{{user `memsize`}}"],
["modifyvm", "{{ .Name }}", "--cpus", "{{user `numcpus`}}"],
["modifyvm", "{{ .Name }}", "--rtcuseutc", "on"],
["modifyvm", "{{ .Name }}", "--vram", "24"],
["modifyvm", "{{ .Name }}", "--clipboard", "bidirectional"],
["modifyvm", "{{ .Name }}", "--draganddrop", "bidirectional"]
]
}
],
"provisioners": [
{
"execute_command": "echo '{{ user `ssh_password` }}' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
"scripts": [
"script/rc_local.sh",
"script/sshd.sh"
],
"type": "shell"
},
{
"type": "shell",
"execute_command": "echo '{{ user `ssh_password` }}' | sudo -S sh -c '{{ .Vars }} {{ .Path }}'",
"inline": [
"apt-get install -y ansible",
"echo '{{user `ssh_username`}} ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers"
]
},
{
"type": "ansible-local",
"command": "ANSIBLE_NOCOWS=1 ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook",
"playbook_file": "{{user `ansible_dir`}}/playbooks/linux-mint-dev.yml",
"playbook_dir": "{{user `ansible_dir`}}/playbooks"
}
]
}