]> WPIA git - infra.git/blob - packer/debian-9/packer.json
add: packer template for debian-9 installation
[infra.git] / packer / debian-9 / packer.json
1 {
2   "builders": [
3     {
4       "accelerator": "kvm",
5       "boot_command": [
6         "<down><tab>",
7         "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
8         "language=en locale=en_US.UTF-8 ",
9         "country=DE keymap=us ",
10         "hostname=host01 domain=test ",
11         "<enter><wait>"
12       ],
13       "boot_wait": "1s",
14       "disk_compression": true,
15       "disk_detect_zeroes": "unmap",
16       "disk_discard": "unmap",
17       "disk_size": "2000M",
18       "format": "qcow2",
19       "headless": true,
20       "host_port_max": 2229,
21       "host_port_min": 2222,
22       "http_directory": "http",
23       "http_port_max": 9999,
24       "http_port_min": 9990,
25       "iso_checksum": "file:{{ user `source_checksum_url` }}",
26       "iso_url": "{{ user `source_iso` }}",
27       "output_directory": "{{ user `output_dir` }}",
28       "shutdown_command": "echo '{{ user `ssh_password` }}'  | sudo -S /sbin/shutdown -hP now",
29       "skip_compaction": false,
30       "ssh_password": "{{ user `ssh_password` }}",
31       "ssh_timeout": "1000s",
32       "ssh_username": "{{ user `ssh_username` }}",
33       "type": "qemu",
34       "vm_name": "{{ user `output_name` }}"
35     }
36   ],
37   "description": "This builder builds a QEMU image from a Debian \"netinst\" CD ISO file.\nIt contains a few basic tools and can be use as a \"cloud image\" alternative.\n",
38   "min_packer_version": "1.3.2",
39   "post-processors": [
40     {
41       "keep_input_artifact": true,
42       "type": "manifest"
43     }
44   ],
45   "provisioners": [
46     {
47       "sources": [
48         "scripts/00-install-packages.sh",
49         "scripts/01-configure-cloudinit.sh",
50         "scripts/02-enable-services.sh",
51         "scripts/99-cleanup.sh"
52       ],
53       "destination": "/tmp/",
54       "type": "file"
55     },
56     {
57       "inline": [
58         "/tmp/00-install-packages.sh",
59         "/tmp/01-configure-cloudinit.sh",
60         "/tmp/02-enable-services.sh",
61         "/tmp/99-cleanup.sh"
62       ],
63       "execute_command": "echo 'wpia' | sudo -S sh -c '{{ .Vars }} {{ .Path }}'",
64       "type": "shell"
65     }
66   ],
67   "variables": {
68     "output_dir": "output",
69     "output_name": "debian.qcow2",
70     "source_checksum_url": "https://cdimage.debian.org/cdimage/archive/9.13.0/amd64/iso-cd/SHA256SUMS",
71     "source_iso": "https://cdimage.debian.org/cdimage/archive/9.13.0/amd64/iso-cd/debian-9.13.0-amd64-netinst.iso",
72     "ssh_password": "wpia",
73     "ssh_username": "wpia"
74   }
75 }
76