Skip to content

Commit

Permalink
Review batch changes
Browse files Browse the repository at this point in the history
- Restructure folders
- Remove tofu references
  • Loading branch information
VariableDeclared committed Sep 11, 2024
1 parent f11e64b commit ea47d6c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 67 deletions.
47 changes: 0 additions & 47 deletions demos/microcloud-deploy/templates/mc-init.tmpl

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
lxd = {
source = "terraform-lxd/lxd"
version = "2.0.0"
version = "2.3.0"
}
ssh = {
source = "loafoe/ssh"
Expand Down Expand Up @@ -72,7 +72,7 @@ resource "lxd_instance" "microcloud_nodes" {
config = {
"boot.autostart" = true
"cloud-init.user-data" = local.cloud_init
"cloud-init.network-config" =local.cloud_init_network
"cloud-init.network-config" = local.cloud_init_network
}

limits = {
Expand Down
21 changes: 21 additions & 0 deletions demos/terraform/nested-deployment/templates/mc-init.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Taken from Microcloud docs, see: https://canonical-microcloud.readthedocs-hosted.com/en/latest/microcloud/how-to/initialise/#non-interactive-configuration
# for more information
lookup_subnet: ${microcloud_one_address}
systems:
%{ for mc_inst in instances ~}
- name: ${mc_inst}
ovn_uplink_interface: ${bridge_nic}
storage:
ceph:
- path: /dev/sdb
wipe: true
%{ endfor ~}

ceph:
internal_network: ${bridge_nic_cidr}
public_network: ${bridge_nic_cidr}

ovn:
ipv4_gateway: ${ovn_gateway}
ipv4_range: ${ovn_range_start}-${ovn_range_end}
dns_servers: 8.8.8.8
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@

variable "pro_token" {
type = string
}

variable "lxd_project" {
type = string
default = "microcloud2"
Expand Down
18 changes: 5 additions & 13 deletions doc/how-to/microcloud-with-terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Get the terraform from the [demos folder](../../demos/microcloud-deploy)
sudo lxd init --auto
```

## Init tofu
## Init terraform

```
sudo snap install --classic terraform
Expand All @@ -33,7 +33,6 @@ terraform init

| Variable Name | Purpose |
| ------------------------ | ----------------------------------------------------- |
| pro_token | Can be ignored for now |
| lxd_project | LXD Project - will be created |
| bridge_nic | The bridge interface created in the VM |
| lookup_subnet | The CIDR of bridge_nic, e.g. 10.10.32.0/24 |
Expand All @@ -45,18 +44,11 @@ terraform init

## Apply the plan

```
tofu apply
```

## Init Microcloud
### Init Microcloud

The terraform will automatically trigger an initialisation, via the non-interactive method - more information can be found here: https://canonical-microcloud.readthedocs-hosted.com/en/latest/how-to/initialise/#non-interactive-configuration


## TODO:

- Additional networks
~~- Microcloud VM bridging~~
- Multinode
- Non-bridged network on the host
```
terraform apply
```

0 comments on commit ea47d6c

Please sign in to comment.