You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/upgrades.md
+45-1Lines changed: 45 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,8 @@ All other commands should be run on the Ansible deploy host.
62
62
63
63
1. If required, build an "extra" image with local modifications, see [docs/image-build.md](./image-build.md).
64
64
65
-
1. Modify your site-specific environment to use this image, e.g. via `cluster_image_id` in `environments/$SITE_ENV/tofu/variables.tf`.
65
+
1. Modify your site-specific environment to use this image, e.g. via `cluster_image_id` in `environments/site/tofu/site.auto.tfvars` if all environments use the same image
66
+
or `environments/$SUB_ENV/tofu/{$SUB_ENV}.tfvars` if the image is environment-specific.
66
67
67
68
1. Test this in your staging cluster.
68
69
@@ -101,3 +102,46 @@ playbook to reconfigure the cluster, e.g. as described in the main [README.md](.
101
102
102
103
1. Tell users the cluster is available again.
103
104
105
+
## Upgrading OpenTofu
106
+
107
+
As of v2.3, environments now import the appliance's latest Tofu as a module, ensuring that your Tofu infrastructure is up to date
108
+
with the configuration expected upstream. Environment defined before v2.3 must therefore be manually migrated to the new model.
109
+
110
+
### Upgrading Site Environments
111
+
112
+
1. Identify any custom defaults you have set in your `variables.tf` file with `diff environments/site/tofu/variables.tf tofu/variables.tf`
113
+
114
+
1. Create a new `environments/site/tofu/site.auto.tfvars` file and assign any variables you previously set custom defaults for in `variables.tf` with their default value. For
115
+
example,
116
+
```sh
117
+
variable "key_pair" {
118
+
type = string
119
+
description = "Name of an existing keypair in OpenStack"
120
+
default = "my-key"
121
+
}
122
+
```
123
+
in `variables.tf` becomes
124
+
```sh
125
+
key_pair = "my-key"
126
+
```
127
+
in `site.auto.tfvars`
128
+
129
+
1. Delete the contents of the `environments/site/tofu` except for the `site.auto.tfvars` file
130
+
131
+
### Upgrading Production/Staging Environments
132
+
133
+
1. In the `environments/$ENV_NAME/tofu/main.tf` file of your environment, identify any variables (other than `environment_root`) you have hardcoded as arguments to your site module
134
+
135
+
1. Move these variable assignments to a new `environments/$ENV_NAME/tofu/$ENV_NAME.tfvars` file
136
+
137
+
1. Delete the contents of the `environments/$ENV_NAME/tofu` directory, except for `.terraform`, `terraform.tfstate`, `.terraform.lock.hcl` and the new tfvars file
138
+
139
+
1. Create a symlink from `tofu/layouts/main.tf` to `environments/$ENV_NAME/tofu/main.tf`
140
+
141
+
1. Create a symlink from `tofu/variables.tf` to `environments/$ENV_NAME/tofu/main.tf`
142
+
143
+
1. Create a symlink from `environments/site/tofu/site.auto.tfvars` to `environments/$ENV_NAME/tofu/site.auto.tfvars`
144
+
145
+
1. Import the new module with `tofu init`
146
+
147
+
1. Verify no destructive changes were made to your existing infrastructure with `tofu plan -var-file=$YOUR-TFVARS-FILE`
0 commit comments