-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpacker.json
More file actions
52 lines (52 loc) · 1.62 KB
/
Copy pathpacker.json
File metadata and controls
52 lines (52 loc) · 1.62 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
46
47
48
49
50
51
52
{
"variables": {
"DOCKERHUB_EMAIL" : "{{ env `DOCKERHUB_EMAIL` }}",
"DOCKERHUB_USERNAME" : "{{ env `DOCKERHUB_USERNAME` }}",
"DOCKERHUB_PASSWORD" : "{{ env `DOCKERHUB_PASSWORD` }}",
"DOCKERHUB_SERVER" : "{{ env `DOCKERHUB_SERVER` }}"
},
"provisioners": [
{
"type" : "shell",
"inline" : [
"sudo apt-get update && sudo apt-get -y upgrade",
"sudo apt-get -y install puppet",
"sudo mkdir -p /tmp/hieradata"
]
},
{
"type" : "file",
"source" : "puppet/ext/hieradata",
"destination" : "/tmp"
},
{
"type" : "puppet-masterless",
"manifest_file" : "./puppet/site.pp",
"module_paths" : "./puppet/modules",
"hiera_config_path" : "./puppet/ext/hiera.yaml",
"execute_command" : "{{.FacterVars}}{{if .Sudo}} sudo -E {{end}}puppet apply --verbose --parser future --modulepath='{{.ModulePath}}' --hiera_config='{{.HieraConfigPath}}' --detailed-exitcodes {{.ManifestFile}}"
}
],
"builders": [
{
"type" : "docker",
"image" : "ubuntu",
"export_path" : "img.tar"
}
],
"post-processors": [
[{
"type" : "docker-import",
"repository" : "maguec/packer-puppet-example",
"tag" : "latest"
},
{
"type" : "docker-push",
"login" : true,
"login_email" : "{{user `DOCKERHUB_EMAIL`}}",
"login_username" : "{{user `DOCKERHUB_USERNAME`}}",
"login_password" : "{{user `DOCKERHUB_PASSWORD`}}",
"login_server" : "{{user `DOCKERHUB_SERVER`}}"
}]
]
}