This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
samvera-base-centos.json
173 lines (173 loc) · 7.54 KB
/
samvera-base-centos.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
{
"variables": {
"build_version": "",
"aws_access_key": "",
"aws_secret_key": "",
"aws_region": "",
"samvera_db_user": "",
"samvera_db_password": "",
"fcdb_user": "",
"fcdb_password": "",
"root_db_password": "",
"timezone": "",
"hostname": "",
"domain": "",
"project_name": "",
"ssh_keys_to_add": "",
"vagrant_cloud_token": "",
"vagrant_cloud_user": "",
"centos_version": "7",
"vagrant_source_iso": "CentOS-7-x86_64-Minimal-1804.iso",
"vagrant_source_iso_sha256_checksum": "714acc0aefb32b7d51b515e25546835e55a90da9fb00417fbee2d03a62801efd",
"vagrant_guest_additions_iso": "http://download.virtualbox.org/virtualbox/5.2.12/VBoxGuestAdditions_5.2.12.iso",
"vagrant_guest_additions_iso_sha256_checksum": "b81d283d9ef88a44e7ac8983422bead0823c825cbfe80417423bd12de91b8046",
"aws_source_ami": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*",
"aws_ami_owner": "099720109477",
"vb_memory": "4096",
"vb_cpu_cores": "",
"runid": "{{env `PACKER_RUN_UUID`}}",
"linux_distro": ""
},
"builders": [{
"type": "amazon-ebs",
"name": "ami",
"access_key": "{{ user `aws_access_key` }}",
"secret_key": "{{ user `aws_secret_key` }}",
"region": "{{ user `aws_region` }}",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "{{ user `aws_source_ami` }}",
"root-device-type": "ebs"
},
"owners": ["{{ user `aws_ami_owner` }}"],
"most_recent": true
},
"force_deregister": true,
"force_delete_snapshot": true,
"instance_type": "t2.medium",
"ssh_username": "ubuntu",
"ami_name": "{{ user `project_name` }}-base-{{ user `linux_distro` }} {{ timestamp }}",
"ami_description": "A base box for {{ user `project_name` }} ({{ user `linux_distro` }})"
},
{
"type": "virtualbox-iso",
"name": "box",
"boot_command": [
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 81920,
"guest_os_type": "RedHat_64",
"headless": true,
"http_directory": "http",
"iso_urls": [
"/ISOs/{{ user `vagrant_source_iso` }}",
"http://mirrors.mit.edu/centos/{{ user `centos_version` }}/isos/x86_64/{{ user `vagrant_source_iso` }}"
],
"iso_checksum_type": "sha256",
"iso_checksum": "{{ user `vagrant_source_iso_sha256_checksum` }}",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p",
"guest_additions_url": "{{ user `vagrant_guest_additions_iso` }}",
"guest_additions_sha256": "{{ user `vagrant_guest_additions_iso_sha256_checksum` }}",
"virtualbox_version_file": ".vbox_version",
"output_directory": "builds/virtualbox/{{ user `runid` }}",
"vm_name": "{{ user `project_name` }}-base-{{ user `linux_distro` }}",
"vboxmanage": [
["modifyvm", "{{ .Name }}", "--memory", "{{ user `vb_memory` }}"],
["modifyvm", "{{ .Name }}", "--cpus", "{{ user `vb_cpu_cores` }}"]
]
}
],
"provisioners": [{
"type": "shell",
"only": ["ami", "box"],
"execute_command": "echo 'vagrant' | {{ .Vars }} /usr/bin/sudo -S -E bash '{{ .Path }}'",
"script": "scripts/setup-base.sh"
},
{
"type": "shell",
"only": ["box"],
"execute_command": "echo 'vagrant' | {{ .Vars }} /usr/bin/sudo -S -E bash '{{ .Path }}'",
"script": "scripts/setup-vagrant.sh"
},
{
"type": "ansible-local",
"only": ["box"],
"playbook_file": "ansible/playbooks/samvera-base-centos.yml",
"galaxy_file": "ansible/requirements/samvera-base-centos.yaml",
"extra_arguments": [
"-e \"samvera_db_user={{ user `samvera_db_user` }}\"",
"-e \"samvera_db_password={{ user `samvera_db_password` }}\"",
"-e \"fcdb_user={{ user `fcdb_user` }}",
"-e \"fcdb_password={{ user `fcdb_password` }}",
"-e \"fc_admin_user={{ user `fc_admin_user` }}",
"-e \"fc_admin_password={{ user `fc_admin_password` }}",
"-e \"os_user=vagrant",
"-e \"os_password=vagrant",
"-e \"postgres_pass={{ user `root_db_password` }}\"",
"-e \"timezone={{ user `timezone` }}\"",
"-e \"hostname={{ user `hostname` }}\"",
"-e \"domain={{ user `domain` }}\"",
"-e \"project_name={{ user `project_name` }}\"",
"-e \"ssh_keys_to_add={{ user `ssh_keys_to_add` }}\"",
"-e \"ansible_sudo_pass=vagrant\""
]
},
{
"type": "ansible-local",
"only": ["ami"],
"playbook_file": "ansible/playbooks/samvera-base-centos.yml",
"galaxy_file": "ansible/requirements/samvera-base-centos.yaml",
"extra_arguments": [
"-e \"samvera_db_user={{ user `samvera_db_user` }}\"",
"-e \"samvera_db_password={{ user `samvera_db_password` }}\"",
"-e \"fcdb_user={{ user `fcdb_user` }}",
"-e \"fcdb_password={{ user `fcdb_password` }}",
"-e \"fc_admin_user={{ user `fc_admin_user` }}",
"-e \"fc_admin_password={{ user `fc_admin_password` }}",
"-e \"postgres_pass={{ user `root_db_password` }}\"",
"-e \"timezone={{ user `timezone` }}\"",
"-e \"hostname={{ user `hostname` }}\"",
"-e \"domain={{ user `domain` }}\"",
"-e \"project_name={{ user `project_name` }}\"",
"-e \"ssh_keys_to_add={{ user `ssh_keys_to_add` }}\""
]
},
{
"type": "shell",
"only": ["ami", "box"],
"execute_command": "echo 'vagrant' | {{ .Vars }} /usr/bin/sudo -S -E bash '{{ .Path }}'",
"script": "scripts/cleanup.sh"
}
],
"post-processors": [
[{
"type": "vagrant",
"only": ["box"],
"output": "builds/vagrant/{{ user `project_name` }}-base-{{ user `linux_distro` }}.box",
"vagrantfile_template": "vagrant/base/Vagrantfile",
"keep_input_artifact": true
},
{
"type": "vagrant-cloud",
"only": ["box"],
"box_tag": "{{ user `vagrant_cloud_user` }}/{{ user `project_name` }}-base-{{ user `linux_distro` }}",
"access_token": "{{ user `vagrant_cloud_token` }}",
"version": "{{ user `build_version` }}-{{ timestamp }}"
},
{
"type": "shell-local",
"only": ["box"],
"inline": [
"mv builds/virtualbox/{{ user `runid` }}/* builds/virtualbox/",
"rmdir builds/virtualbox/{{ user `runid` }}"
]
}
]
]
}