-
Notifications
You must be signed in to change notification settings - Fork 114
/
my_centos-7.json
129 lines (129 loc) · 5.19 KB
/
my_centos-7.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{
"_comment1": "NAME=my_centos-7-x86_64 CENTOS_VERSION=7 CENTOS_TYPE=NetInstall CENTOS_TAG=2009 PACKER_IMAGES_OUTPUT_DIR=/var/tmp/ LOGDIR=/tmp/ packer build -only=qemu my_centos-7.json",
"builders": [
{
"accelerator": "{{ user `accelerator` }}",
"boot_command": [
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos{{ user `centos_version` }}/my-ks.cfg<enter>"
],
"boot_wait": "10s",
"cpus": "{{ user `cpus` }}",
"disk_size": "{{ user `disk_size` }}",
"headless": "{{ user `headless` }}",
"http_directory": "http",
"iso_checksum": "file:{{ user `centos_mirror` }}{{ user `centos_version` }}/isos/x86_64/sha256sum.txt",
"iso_urls": [
"{{ user `centos_mirror` }}{{ user `centos_version` }}/isos/x86_64/CentOS-{{ user `centos_version` }}-x86_64-{{ user `centos_type` }}-{{ user `centos_tag` }}.iso"
],
"memory": "{{ user `memory` }}",
"output_directory": "{{ user `name` }}-qemu",
"shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
"ssh_password": "{{ user `ssh_password` }}",
"ssh_username": "{{ user `ssh_username` }}",
"ssh_timeout": "1h",
"type": "qemu",
"vm_name": "{{ user `name` }}"
},
{
"boot_command": [
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos{{ user `centos_version` }}/my-ks.cfg<enter>"
],
"boot_wait": "10s",
"cpus": "{{ user `cpus` }}",
"disk_size": "{{ user `disk_size` }}",
"guest_additions_mode": "disable",
"guest_os_type": "RedHat_64",
"hard_drive_interface": "sata",
"headless": "{{ user `headless` }}",
"http_directory": "http",
"iso_checksum": "file:{{ user `centos_mirror` }}{{ user `centos_version` }}/isos/x86_64/sha256sum.txt",
"iso_urls": [
"{{ user `centos_mirror` }}{{ user `centos_version` }}/isos/x86_64/CentOS-{{ user `centos_version` }}-x86_64-{{ user `centos_type` }}-{{ user `centos_tag` }}.iso"
],
"memory": "{{ user `memory` }}",
"output_directory": "{{ user `name` }}-virtualbox-iso",
"shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
"ssh_password": "{{ user `ssh_password` }}",
"ssh_username": "{{ user `ssh_username` }}",
"ssh_timeout": "1h",
"type": "virtualbox-iso",
"vboxmanage": [
["modifyvm", "{{ .Name }}", "--graphicscontroller", "vmsvga"],
["modifyvm", "{{ .Name }}", "--audiocontroller", "ac97"],
[
"modifyvm",
"{{ .Name }}",
"--recordingfile",
"{{ user `packer_templates_logs` }}/{{ user `name` }}-virtualbox.webm"
],
["modifyvm", "{{ .Name }}", "--recordingscreens", "0"],
["modifyvm", "{{ .Name }}", "--recording", "on"]
],
"vm_name": "{{ user `name` }}"
}
],
"post-processors": [
[
{
"compression_level": 9,
"output": "{{ user `packer_images_output_dir` }}/{{ user `name` }}-{{ .Provider }}.box",
"type": "vagrant",
"vagrantfile_template": "Vagrantfile-linux.template"
}
]
],
"provisioners": [
{
"execute_command": "echo 'vagrant' | sudo -S -E bash '{{ .Path }}'",
"scripts": ["scripts/linux-common/vagrant.sh"],
"type": "shell"
},
{
"ansible_env_vars": ["ANSIBLE_CONFIG=ansible/ansible.cfg"],
"extra_arguments": [
"--become",
"--extra-vars",
"packer_build_name={{ user `name` }}"
],
"playbook_file": "ansible/site.yml",
"sftp_command": "/usr/libexec/openssh/sftp-server -e",
"type": "ansible",
"user": "vagrant"
},
{
"execute_command": "sudo -E bash '{{ .Path }}'",
"scripts": [
"scripts/linux-common/packer-virt-sysprep/sysprep-op-dhcp-client-state.sh",
"scripts/linux-common/packer-virt-sysprep/sysprep-op-firewall-rules.sh",
"scripts/linux-common/packer-virt-sysprep/sysprep-op-logfiles.sh",
"scripts/linux-common/packer-virt-sysprep/sysprep-op-machine-id.sh",
"scripts/linux-common/packer-virt-sysprep/sysprep-op-mail-spool.sh",
"scripts/linux-common/packer-virt-sysprep/sysprep-op-network.sh",
"scripts/linux-common/packer-virt-sysprep/sysprep-op-package-manager-cache.sh",
"scripts/linux-common/packer-virt-sysprep/sysprep-op-rpm-db.sh",
"scripts/linux-common/packer-virt-sysprep/sysprep-op-ssh-hostkeys.sh",
"scripts/linux-common/packer-virt-sysprep/sysprep-op-tmp-files.sh",
"scripts/linux-common/packer-virt-sysprep/sysprep-op-yum-uuid.sh",
"scripts/linux-common/packer-virt-sysprep/sysprep-op-disk-space.sh"
],
"type": "shell"
}
],
"variables": {
"accelerator": "kvm",
"centos_mirror": "http://ftp.cvut.cz/centos/",
"centos_tag": "{{ env `CENTOS_TAG` }}",
"centos_type": "{{ env `CENTOS_TYPE` }}",
"centos_version": "{{ env `CENTOS_VERSION` }}",
"cpus": "4",
"disk_size": "51200",
"headless": "false",
"memory": "8192",
"name": "{{ env `NAME` }}",
"packer_images_output_dir": "{{ env `PACKER_IMAGES_OUTPUT_DIR` }}",
"packer_templates_logs": "{{ env `LOGDIR` }}",
"preseed_file_name": "my-ks.cfg",
"ssh_password": "vagrant",
"ssh_username": "vagrant"
}
}