-
Notifications
You must be signed in to change notification settings - Fork 0
/
breed-spec-centos-lk44.json
92 lines (89 loc) · 3.32 KB
/
breed-spec-centos-lk44.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
{
"builders": [
{
"type":"vmware-vmx",
"headless": "{{ user `headless` }}",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "100s",
"shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p",
"source_path": "{{user `vmware_source_dir`}}/centos-base.vmx",
"output_directory": "builds/packer-{{build_type}}-{{user `boxtype`}}-{{user `flavor`}}",
"vm_name": "{{user `boxtype`}}-{{ user `flavor` }}"
},
{
"type": "qemu",
"boot_wait": "10s",
"disk_size": "{{user `disk_size`}}",
"headless": "{{ user `headless` }}",
"http_directory": "http",
"ssh_port": 22,
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "100s",
"shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p",
"disk_image": true,
"iso_checksum_type": "md5",
"iso_checksum_url": "http://ninja/export/images/centos-base.md5",
"iso_url": "http://ninja/export/images/centos-base",
"output_directory": "builds/packer-{{build_type}}-{{user `boxtype`}}-{{user `flavor`}}",
"vm_name": "{{user `boxtype`}}-{{ user `flavor` }}"
}
],
"provisioners": [
{
"type":"shell",
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E sh -eux '{{.Path}}'",
"inline": [
"yum --enablerepo=elrepo-kernel all metadata",
"rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org",
"rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm",
"yum-config-manager --enable elrepo-kernel",
"yum clean all",
"yum -y remove clang* kernel-headers*",
"yum -y --enablerepo=elrepo-kernel install kernel-lt kernel-lt-headers kernel-lt-devel kernel-lt-tools kernel-lt-tools-libs-devel perf python-perf",
"grub2-editenv /boot/grub2/grubenv unset saved_entry",
"sed -i -e 's/GRUB_DEFAULT=.*/GRUB_DEFAULT=0/' /etc/default/grub && grub2-mkconfig -o /boot/grub2/grub.cfg"
]
}
],
"post-processors": [
{
"type": "vagrant",
"output": "{{user `box_dest`}}/packer_{{.Provider}}-{{user `boxtype`}}-{{user `flavor`}}.box",
"vagrantfile_template":"vagrantfile_templates/centos-7.3.rb",
"keep_input_artifact": true
},
{
"only":["qemu"],
"type":"shell-local",
"inline": [
"cp -vf builds/packer-{{build_type}}-{{user `boxtype`}}-{{user `flavor`}}/{{user `boxtype`}}-{{user `flavor`}} {{user `image_dest`}}",
"bin/hash_img.sh {{user `image_dest`}}/{{user `boxtype`}}-{{user `flavor`}}",
"bin/hash_img.sh {{user `box_dest`}}/packer_libvirt-{{user `boxtype`}}-{{user `flavor`}}.box"
]
},
{
"only":["vmware-vmx"],
"type":"shell-local",
"inline": [
"bin/hash_img.sh {{user `box_dest`}}/packer_vmware-{{user `boxtype`}}-{{user `flavor`}}.box"
]
}
],
"variables": {
"build_timestamp": "{{isotime \"20060102150405\"}}",
"box_dest": "/data/export/boxes",
"image_dest": "/data/export/images",
"boxtype": "lk",
"flavor": "44",
"cpus": "2",
"disk_size": "10240",
"headless": "true",
"memory": "1024",
"vmware_source_dir":"builds/packer-vmware-iso-centos-base",
"metadata": "floppy/dummy_metadata.json",
"no_proxy": "{{env `no_proxy`}}",
"version": "0.2.0"
}
}