Created
May 12, 2019 05:47
-
-
Save dannybritto96/535d7a8a6cacc3a6b0bf3b12c69b9017 to your computer and use it in GitHub Desktop.
Packer to build a Apache 2 Ubuntu Webserver Image in Oracle Cloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"compartment_id": "", | |
"user_id": "", | |
"ssh_user": "ubuntu", | |
"shape": "VM.Standard2.1", | |
"availability_domain": "hwmL:EU-FRANKFURT-1-AD-3", | |
"region": "eu-frankfurt-1", | |
"key_file": "oci_api_key.pem", | |
"image_name": "DemoImage", | |
"subnet_ocid": "", | |
"fingerprint": "", | |
"base_image_ocid": "ocid1.image.oc1.eu-frankfurt-1.aaaaaaaakk4gj6boyejvg6qhwe3rzeoyqcqduik33bgzvzhn6ehyzliqff2a" | |
}, | |
"builders": [ | |
{ | |
"tenancy_ocid": "{{user `compartment_id`}}", | |
"user_ocid": "{{user `user_id`}}", | |
"key_file": "{{ user `key_file`}}", | |
"availability_domain": "{{user `availability_domain` }}", | |
"base_image_ocid": "{{user `base_image_ocid` }}", | |
"compartment_ocid": "{{user `compartment_id` }}", | |
"image_name": "{{user `image_name` }}", | |
"shape": "{{user `shape` }}", | |
"ssh_username": "{{user `ssh_user` }}", | |
"subnet_ocid": "{{user `subnet_ocid` }}", | |
"type": "oracle-oci", | |
"region": "{{user `region` }}", | |
"fingerprint": "{{user `fingerprint` }}" | |
} | |
], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"inline": [ | |
"sudo apt-get update -y", | |
"sudo apt-get upgrade -y", | |
"sudo apt-get install apache2 -y", | |
"sudo service apache2 start" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment