Skip to content

Commit 7f9d1f1

Browse files
committed
Merge pull request #13 from Crewe/add-digitalocean-builder
Add DigitalOcean builder to packer scripts
2 parents dec379b + 9cc5e4d commit 7f9d1f1

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

packer-templates/application-server.json

+12-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"PACKER_OS_FLAVOUR": "ubuntu",
44
"PACKER_BOX_NAME": "ubuntu-14.04.4-server-amd64",
55
"AWS_ACCESS_KEY_ID": "{{env `AWS_ACCESS_KEY_ID`}}",
6-
"AWS_SECRET_ACCESS_KEY": "{{env `AWS_SECRET_ACCESS_KEY`}}"
6+
"AWS_SECRET_ACCESS_KEY": "{{env `AWS_SECRET_ACCESS_KEY`}}",
7+
"DIGITALOCEAN_API_TOKEN": "{{env `DIGITALOCEAN_API_TOKEN`}}"
78
},
89
"builders": [
910
{
@@ -73,6 +74,15 @@
7374
"image_name": "application-ubuntu-1404-{{timestamp}}",
7475
"machine_type": "n1-standard-1",
7576
"ssh_username": "ubuntu"
77+
},
78+
{
79+
"type": "digitalocean",
80+
"api_token": "{{ user `DIGITALOCEAN_API_TOKEN` }}",
81+
"image": "ubuntu-14-04-x64",
82+
"region": "tor1",
83+
"size": "512mb",
84+
"droplet_name": "udacity-devops",
85+
"private_networking": true
7686
}
7787
],
7888

@@ -106,7 +116,7 @@
106116
[
107117
{
108118
"type": "vagrant",
109-
"except": ["googlecompute"],
119+
"except": ["googlecompute", "digitalocean"],
110120
"compression_level": "9",
111121
"output": "{{.Provider}}/{{ user `PACKER_BOX_NAME` }}-appserver_{{.Provider}}.box"
112122
}

packer-templates/control-server.json

+13-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"PACKER_OS_FLAVOUR": "ubuntu",
44
"PACKER_BOX_NAME": "ubuntu-14.04.4-server-amd64",
55
"AWS_ACCESS_KEY_ID": "{{env `AWS_ACCESS_KEY_ID`}}",
6-
"AWS_SECRET_ACCESS_KEY": "{{env `AWS_SECRET_ACCESS_KEY`}}"
6+
"AWS_SECRET_ACCESS_KEY": "{{env `AWS_SECRET_ACCESS_KEY`}}",
7+
"DIGITALOCEAN_API_TOKEN": "{{env `DIGITALOCEAN_API_TOKEN`}}"
78
},
89
"builders": [
910
{
@@ -73,7 +74,16 @@
7374
"image_name": "control-ubuntu-1404-{{timestamp}}",
7475
"machine_type": "n1-standard-1",
7576
"ssh_username": "ubuntu"
76-
}
77+
},
78+
{
79+
"type": "digitalocean",
80+
"api_token": "{{ user `DIGITALOCEAN_API_TOKEN` }}",
81+
"image": "ubuntu-14-04-x64",
82+
"region": "tor1",
83+
"size": "512mb",
84+
"droplet_name": "udacity-devops",
85+
"private_networking": true
86+
}
7787
],
7888
"provisioners": [
7989
{
@@ -112,7 +122,7 @@
112122
[
113123
{
114124
"type": "vagrant",
115-
"except": ["googlecompute"],
125+
"except": ["googlecompute", "digitalocean"],
116126
"compression_level": "9",
117127
"output": "../output/{{.Provider}}/control-{{ user `PACKER_BOX_NAME` }}.box"
118128
}

0 commit comments

Comments
 (0)