-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Peter Pouliot
committed
Sep 25, 2024
1 parent
61d316a
commit 0022f50
Showing
6 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#cloud-config | ||
|
||
apt: | ||
sources: | ||
docker.list: | ||
source: deb [arch=arm64] https://download.docker.com/linux/ubuntu $RELEASE stable | ||
keyid: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 | ||
|
||
package_update: true | ||
package_upgrade: true | ||
|
||
packages: | ||
- screen | ||
- rsync | ||
- git | ||
- curl | ||
- docker-ce | ||
- docker-ce-cli | ||
- python3-pip | ||
- python3-dev | ||
- python3-selinux | ||
- python3-setuptools | ||
- python3-venv | ||
- libffi-dev | ||
- gcc | ||
- libssl-dev | ||
|
||
groups: | ||
- docker | ||
system_info: | ||
default_user: | ||
groups: [docker] | ||
|
||
runcmd: | ||
- docker run -d --name registry --restart=always -p 4000:5000 -v registry:/var/lib/registry registry:2 | ||
- pip3 install -U pip | ||
- pip3 install -U wheel | ||
- echo 'OCI Ampere A1 Ubuntu 24.04 Example' >> /etc/motd |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Example of Ampere A1 running Ubuntu 24.04 on OCI using this module | ||
variable "tenancy_ocid" {} | ||
variable "user_ocid" {} | ||
variable "fingerprint" {} | ||
variable "private_key_path" {} | ||
locals { | ||
cloud_init_template_path = "${path.cwd}/cloud-init.yaml.tpl" | ||
} | ||
module "oci-ampere-a1" { | ||
source = "github.com/amperecomputing/terraform-oci-ampere-a1" | ||
tenancy_ocid = var.tenancy_ocid | ||
user_ocid = var.user_ocid | ||
fingerprint = var.fingerprint | ||
private_key_path = var.private_key_path | ||
# Optional | ||
# oci_vcn_cidr_block = "10.2.0.0/16" | ||
# oci_vcn_cidr_subnet = "10.2.1.0/24" | ||
oci_os_image = "ubuntu2404" | ||
instance_prefix = "ampere-a1-ubuntu-2404" | ||
oci_vm_count = "1" | ||
ampere_a1_vm_memory = "24" | ||
ampere_a1_cpu_core_count = "4" | ||
cloud_init_template_file = local.cloud_init_template_path | ||
} | ||
output "oci_ampere_a1_private_ips" { | ||
value = module.oci-ampere-a1.ampere_a1_private_ips | ||
} | ||
output "oci_ampere_a1_public_ips" { | ||
value = module.oci-ampere-a1.ampere_a1_public_ips | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# gets the Ubuntu 24.04 images, the first result in the images list (index 0) is the latest patched version | ||
# filter to specific display name pattern to include the aarch64 images | ||
|
||
data "oci_core_images" "ubuntu-24_04-aarch64" { | ||
compartment_id = var.tenancy_ocid | ||
|
||
operating_system = "Canonical Ubuntu" | ||
operating_system_version = "24.04" | ||
|
||
# include Aarch64 specific images | ||
filter { | ||
name = "display_name" | ||
values = ["^.*-aarch64-.*$"] | ||
regex = true | ||
} | ||
} | ||
|
||
# Output OCI Ubuntu 24.04 Image Name | ||
output "Ubuntu-24_04-aarch64-latest_name" { | ||
value = data.oci_core_images.ubuntu-24_04-aarch64.images.0.display_name | ||
sensitive = false | ||
} | ||
|
||
# Output OCI Ubuntu 24.04 Image ID | ||
output "Ubuntu-24_04-aarch64-latest_ocid" { | ||
value = data.oci_core_images.ubuntu-24_04-aarch64.images.0.id | ||
sensitive = false | ||
} |