-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
9e78c95
commit 4cc7fcb
Showing
12 changed files
with
225 additions
and
217 deletions.
There are no files selected for viewing
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 was deleted.
Oops, something went wrong.
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,64 @@ | ||
name: Tofu Init | ||
description: Run `tofu init` with optional caching | ||
|
||
inputs: | ||
args: | ||
description: Arguments for `tofu init` | ||
tofu-version: | ||
description: Desired semver compatible Tofu version | ||
required: true | ||
cache: | ||
description: Enable caching tofu project files | ||
default: 'true' | ||
|
||
outputs: | ||
tofu-version: | ||
description: The Tofu version setup | ||
value: ${{ steps.version-tofu.outputs.tofu-version }} | ||
cache-hit: | ||
description: Whether an exact cache hit occurred | ||
value: ${{ steps.cache.outputs.cache-hit }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup Tofu | ||
id: setup-tofu | ||
uses: opentofu/setup-opentofu@v1 | ||
with: | ||
tofu_version: ${{ inputs.tofu-version }} | ||
|
||
- name: Get Version | ||
id: version-tofu | ||
run: printf 'tofu-version=%s\n' "$(tofu version -json | jq -r '.opentofu_version')" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- run: printf 'date=%s\n' "$(date -I)" >> $GITHUB_OUTPUT | ||
id: get-date | ||
if: inputs.cache == 'true' | ||
shell: bash | ||
|
||
- name: Configure Plugin Cache Directory | ||
id: cache-config | ||
if: inputs.cache == 'true' | ||
run: | | ||
echo 'plugin_cache_dir="~/.terraform.d/plugin-cache"' > ~/.terraformrc | ||
mkdir -p ~/.terraform.d/plugin-cache | ||
shell: bash | ||
|
||
- uses: actions/cache@v4 | ||
name: Cache Tofu Plugins | ||
id: cache-tofu | ||
if: inputs.cache == 'true' | ||
with: | ||
path: | | ||
~/.terraform.d/plugin-cache | ||
key: tofu-${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ hashFiles('.terraform.lock.hcl') }} | ||
restore-keys: | | ||
tofu-${{ steps.get-date.outputs.date }}-${{ runner.os }}- | ||
tofu-${{ steps.get-date.outputs.date }}- | ||
- name: Init Tofu | ||
id: init-tofu | ||
run: tofu init ${{ inputs.args }} | ||
shell: bash |
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
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 |
---|---|---|
@@ -1 +1,40 @@ | ||
# tofu-module-minikube | ||
# Demo: tofu-module-minikube | ||
|
||
A [`tofu`](https://github.com/opentofu/opentofu) module for [`minikube`](https://github.com/kubernetes/minikube). | ||
|
||
## Install | ||
|
||
| Name | | ||
|----------------------------------------------------| | ||
| [minikube](https://github.com/kubernetes/minikube) | | ||
| [tofu](https://github.com/opentofu/opentofu) | | ||
|
||
## Usage | ||
|
||
Configure: | ||
```shell | ||
cat <<EOF > terraform.tfvars | ||
minikube_clusters = { | ||
"minikube": { | ||
"driver": "docker", | ||
} | ||
} | ||
EOF | ||
``` | ||
|
||
Run: | ||
```shell | ||
tofu init | ||
tofu plan | ||
tofu apply | ||
``` | ||
|
||
Test: | ||
```shell | ||
tofu test | ||
``` | ||
|
||
Check: | ||
```shell | ||
pre-commit run | ||
``` |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,27 +1,27 @@ | ||
output "client_certificate" { | ||
value = minikube_cluster.default.client_certificate | ||
description = "Cluster client certificate" | ||
description = "Client certificate used in cluster" | ||
sensitive = true | ||
} | ||
|
||
output "client_key" { | ||
value = minikube_cluster.default.client_key | ||
description = "Cluster client key" | ||
description = "Client key for cluster" | ||
sensitive = true | ||
} | ||
|
||
output "cluster_ca_certificate" { | ||
value = minikube_cluster.default.cluster_ca_certificate | ||
description = "Cluster certificate authority certificate" | ||
description = "Certificate authority for cluster" | ||
sensitive = true | ||
} | ||
|
||
output "host" { | ||
value = minikube_cluster.default.host | ||
description = "Cluster host" | ||
description = "The host name for the cluster" | ||
} | ||
|
||
output "id" { | ||
value = minikube_cluster.default.id | ||
description = "Cluster resource ID" | ||
description = "The ID of this resource" | ||
} |
Oops, something went wrong.