-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackerfile.json
More file actions
46 lines (42 loc) · 1.15 KB
/
Packerfile.json
File metadata and controls
46 lines (42 loc) · 1.15 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
{
"variables": {
"jenkins_build_nr": "n/a",
"git_commit_hash": "n/a"
},
"builders": [
{
"communicator": "ssh",
"source_path": "geerlingguy/centos7",
"provider": "virtualbox",
"add_force": true,
"type": "vagrant"
}
],
"provisioners":[
{
"type": "shell",
"execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"inline": [
"sleep 30",
"echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers",
"echo 'VM-Build-{{user `jenkins_build_nr`}}' > /etc/hostname",
"echo 'This is the Dev-VM corresponding to git-hash {{user `git_commit_hash`}}' > /etc/motd"
]
},
{
"type": "shell-local",
"command": "ansible-galaxy install -v --roles-path ./playbooks/roles -r ./playbooks/requirements.yml"
},
{
"type": "ansible",
"playbook_file": "./playbooks/DeveloperVM_Image_Prov.yml"
}
],
"post-processors": [
{
"type": "checksum",
"output": "output-vagrant/checksum.txt",
"checksum_types": ["sha256"]
}
]
}