Skip to content

Commit

Permalink
trying to get to fedora coreos images
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Pouliot committed May 21, 2024
1 parent 226490b commit 4c5b078
Show file tree
Hide file tree
Showing 14 changed files with 361 additions and 5 deletions.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ This can also be used as a terraform module. The [examples](examples) director
terraform init && terraform plan && terraform apply -auto-approve
```

### Running OpenTofu

```
tofu init && tofu plan && tofu apply -auto-approve
```

### Logging in

Once everthing as executed, properly you'll need to login. Currently I successfully login via my google cloud email account in the following format. <username>_<domain>_<tld> Where the "@" symbal and "." are replaces with underscores.

for example:

```
ssh -i
```

<!-- BEGIN_TF_DOCS -->
## Providers

Expand Down Expand Up @@ -99,4 +116,9 @@ terraform init && terraform plan && terraform apply -auto-approve
| <a name="output_gcp_ssh_pubic_key"></a> [gcp\_ssh\_pubic\_key](#output\_gcp\_ssh\_pubic\_key) | Output GCE SSH public key |
| <a name="output_my-email"></a> [my-email](#output\_my-email) | Output email address |
| <a name="output_random_uuid"></a> [random\_uuid](#output\_random\_uuid) | Output a randomly generated uuid |
<!-- END_TF_DOCS -->
<<<<<<< HEAD
<!-- END_TF_DOCS -->
=======
| <a name="output_startup_script"></a> [startup\_script](#output\_startup\_script) | Output rendered startup script |
<!-- END_TF_DOCS -->
>>>>>>> eec3121 (adding examples)
104 changes: 104 additions & 0 deletions examples/debian12/cloud-init.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#cloud-config

apt:
sources:
docker.list:
source: deb [arch=arm64] https://download.docker.com/linux/debian $RELEASE stable
keyserver: pgp.mit.edu
key: |
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBFit2ioBEADhWpZ8/wvZ6hUTiXOwQHXMAlaFHcPH9hAtr4F1y2+OYdbtMuth
lqqwp028AqyY+PRfVMtSYMbjuQuu5byyKR01BbqYhuS3jtqQmljZ/bJvXqnmiVXh
38UuLa+z077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8HdCtg9RvIt/AIFoHR
H3S+U79NT6i0KPzLImDfs8T7RlpyuMc4Ufs8ggyg9v3Ae6cN3eQyxcK3w0cbBwsh
/nQNfsA6uu+9H7NhbehBMhYnpNZyrHzCmzyXkauwRAqoCbGCNykTRwsur9gS41TQ
M8ssD1jFheOJf3hODnkKU+HKjvMROl1DK7zdmLdNzA1cvtZH/nCC9KPj1z8QC47S
xx+dTZSx4ONAhwbS/LN3PoKtn8LPjY9NP9uDWI+TWYquS2U+KHDrBDlsgozDbs/O
jCxcpDzNmXpWQHEtHU7649OXHP7UeNST1mCUCH5qdank0V1iejF6/CfTFU4MfcrG
YT90qFF93M3v01BbxP+EIY2/9tiIPbrd
=0YYh
-----END PGP PUBLIC KEY BLOCK-----
package_update: true
package_upgrade: true
packages:
- screen
- rsync
- git
- curl
- python3-pip
- python3-dev
- python3-selinux
- python3-setuptools
- python3-venv
- libffi-dev
- gcc
- libssl-dev
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common

groups:
- docker
system_info:
default_user:
groups: [docker]

runcmd:
- curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
- sudo apt-get update -y && apt-get install -y docker-ce docker-ce-cli
- 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 'GCE Tau T2A Instance Powered by Ampere® Altra' >> /etc/motd
30 changes: 30 additions & 0 deletions examples/debian12/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
variable "project_id" {}
variable "location" {}

locals {
cloud_init_template_path = "${path.cwd}/cloud-init.yaml.tpl"
}

module "gcp-ampere-tau-t2a" {
source = "github.com/amperecomputing/terraform-gcp-ampere-tau-t2a"
project_id = var.project_id
# Optional
# virtual_network_name = var.virtual_network_name
# address_space = var.address_space
# subnet_prefix = var.subnet_prefix
location = "US"
region = "us-central1"
zone = "us-central1-a"
gcp_vm_count = 1
gcp_os_image = "debian12"
instance_prefix = "ampere-t2a-debian12"
startup_script_template_file = null
cloud_init_template_file = local.cloud_init_template_path
}

output "gcp_ampere_tau_t2a_private_ips" {
value = module.gcp-ampere-tau-t2a.ampere_taut2a_private_ips
}
output "gcp_ampere_tau_t2a_public_ips" {
value = module.gcp-ampere-tau-t2a.ampere_taut2a_public_ips
}
4 changes: 4 additions & 0 deletions examples/fedoracoreos/cloud-init.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#cloud-config

runcmd:
- echo 'Ampere T2A FedoraCoreOS Example' >> /etc/motd
30 changes: 30 additions & 0 deletions examples/fedoracoreos/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
variable "project_id" {}
variable "location" {}

locals {
cloud_init_template_path = "${path.cwd}/cloud-init.yaml.tpl"
}

module "gcp-ampere-tau-t2a" {
source = "github.com/amperecomputing/terraform-gcp-ampere-tau-t2a"
project_id = var.project_id
# Optional
# virtual_network_name = var.virtual_network_name
# address_space = var.address_space
# subnet_prefix = var.subnet_prefix
location = "US"
region = "us-central1"
zone = "us-central1-a"
gcp_vm_count = 1
gcp_os_image = "fedoracoreos"
instance_prefix = "ampere-t2a-fedoracoreos"
startup_script_template_file = null
cloud_init_template_file = local.cloud_init_template_path
}

output "gcp_ampere_tau_t2a_private_ips" {
value = module.gcp-ampere-tau-t2a.ampere_taut2a_private_ips
}
output "gcp_ampere_tau_t2a_public_ips" {
value = module.gcp-ampere-tau-t2a.ampere_taut2a_public_ips
}
50 changes: 50 additions & 0 deletions examples/rockylinux8/cloud-init.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#cloud-config

package_update: true
package_upgrade: true

packages:
- tmux
- rsync
- git
- curl
- python3
- python39
- python39-devel
- python39-pip
- python39-pip-wheel
- gcc
- gcc
- gcc-c++
- nodejs
- rust
- gettext
- device-mapper-persistent-data
- lvm2
- bzip2

groups:
- docker
system_info:
default_user:
groups: [docker]

runcmd:
- alternatives --set python /usr/bin/python3
- pip3 install -U pip
- pip3 install -U setuptools-rust
- pip3 install -U ansible
- dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
- dnf update -y
- dnf install docker-ce docker-ce-cli containerd.io -y
- curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-linux-aarch64 -o /usr/local/bin/docker-compose-linux-aarch64
- chmod -x /usr/local/bin/docker-compose-linux-aarch64
- ln -s /usr/local/bin/docker-compose-linux-aarch64 /usr/bin/docker-compose
- docker-compose --version
- pip3 install -U docker-compose
- docker info
- systemctl enable docker
- systemctl start docker
- docker run -d --name registry --restart=always -p 4000:5000 -v registry:/var/lib/registry registry:2
- docker info
- echo 'Ampere T2A RockyLinux 8 Example' >> /etc/motd
30 changes: 30 additions & 0 deletions examples/rockylinux8/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
variable "project_id" {}
variable "location" {}

locals {
cloud_init_template_path = "${path.cwd}/cloud-init.yaml.tpl"
}

module "gcp-ampere-tau-t2a" {
source = "github.com/amperecomputing/terraform-gcp-ampere-tau-t2a"
project_id = var.project_id
# Optional
# virtual_network_name = var.virtual_network_name
# address_space = var.address_space
# subnet_prefix = var.subnet_prefix
location = "US"
region = "us-central1"
zone = "us-central1-a"
gcp_vm_count = 1
gcp_os_image = "rockylinux8"
instance_prefix = "ampere-t2a-rockylinux8"
startup_script_template_file = null
cloud_init_template_file = local.cloud_init_template_path
}

output "gcp_ampere_tau_t2a_private_ips" {
value = module.gcp-ampere-tau-t2a.ampere_taut2a_private_ips
}
output "gcp_ampere_tau_t2a_public_ips" {
value = module.gcp-ampere-tau-t2a.ampere_taut2a_public_ips
}
2 changes: 1 addition & 1 deletion examples/rockylinux9/cloud-init.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ runcmd:
- systemctl start docker
- docker run -d --name registry --restart=always -p 4000:5000 -v registry:/var/lib/registry registry:2
- docker info
- echo 'OCI Ampere A1 AlmaLinux 8 Example' >> /etc/motd
- echo 'Ampere T2A RockyLinux 9 Example' >> /etc/motd
2 changes: 1 addition & 1 deletion examples/ubuntu2204/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module "gcp-ampere-tau-t2a" {
zone = "us-central1-a"
gcp_vm_count = 1
gcp_os_image = "ubuntu2204"
instance_prefix = "gcp-ampere-taut2a-ubuntu-2204"
instance_prefix = "ampere-t2a-ubuntu2204"
startup_script_template_file = null
cloud_init_template_file = local.cloud_init_template_path
}
Expand Down
38 changes: 38 additions & 0 deletions examples/ubuntu2404/cloud-init.yaml.tpl
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 'GCE Tau T2A Instance Powered by Ampere® Altra' >> /etc/motd
30 changes: 30 additions & 0 deletions examples/ubuntu2404/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
variable "project_id" {}
variable "location" {}

locals {
cloud_init_template_path = "${path.cwd}/cloud-init.yaml.tpl"
}

module "gcp-ampere-tau-t2a" {
source = "github.com/amperecomputing/terraform-gcp-ampere-tau-t2a"
project_id = var.project_id
# Optional
# virtual_network_name = var.virtual_network_name
# address_space = var.address_space
# subnet_prefix = var.subnet_prefix
location = "US"
region = "us-central1"
zone = "us-central1-a"
gcp_vm_count = 1
gcp_os_image = "ubuntu2404"
instance_prefix = "ampere-t2a-ubuntu2404"
startup_script_template_file = null
cloud_init_template_file = local.cloud_init_template_path
}

output "gcp_ampere_tau_t2a_private_ips" {
value = module.gcp-ampere-tau-t2a.ampere_taut2a_private_ips
}
output "gcp_ampere_tau_t2a_public_ips" {
value = module.gcp-ampere-tau-t2a.ampere_taut2a_public_ips
}
2 changes: 1 addition & 1 deletion images.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ locals {
startup_script = file("${local.startup_script_template_file}")
}
fedoracoreos = {
os_image = "fedora-coreos-stable-arm64"
os_image = "fedora-coreos-cloud"
default_os_user = "fedora"
startup_script = null
}
Expand Down
Loading

0 comments on commit 4c5b078

Please sign in to comment.