Skip to content

Commit 63f3451

Browse files
committed
Fix TFLint formatting and update terraform-docs
- Fix whitespace in examples/full-provisioning/main.tf - Generate terraform-docs READMEs for all examples - Disable auto-push in docs workflow (branch protection requires signed PRs)
1 parent ca1fa64 commit 63f3451

File tree

7 files changed

+357
-6
lines changed

7 files changed

+357
-6
lines changed

.github/workflows/docs.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,12 @@ jobs:
3333
working-dir: examples/basic,examples/flash-firmware,examples/full-provisioning,examples/talos-cluster,examples/k3s-cluster
3434
output-file: README.md
3535
output-method: inject
36-
git-push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
37-
git-commit-message: "docs: auto-generate terraform-docs for examples"
36+
git-push: false # Don't auto-push; branch protection requires signed commits via PRs
3837

39-
- name: Check for changes (PR only)
40-
if: github.event_name == 'pull_request'
38+
- name: Check for uncommitted changes
4139
run: |
4240
if [[ -n $(git status --porcelain) ]]; then
43-
echo "::warning::terraform-docs would update documentation. Run 'terraform-docs .' in each example directory to update."
41+
echo "::error::terraform-docs would update documentation. Run 'terraform-docs .' in each example directory and commit the changes."
4442
git diff
4543
exit 1
4644
fi

examples/basic/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,60 @@ terraform apply
2424

2525
- `turingpi_power.node1` - Powers on node 1
2626
- `turingpi_power.node2` - Powers on node 2
27+
28+
<!-- BEGIN_TF_DOCS -->
29+
30+
31+
## Usage
32+
33+
## Requirements
34+
35+
| Name | Version |
36+
|------|---------|
37+
| <a name="requirement_turingpi"></a> [turingpi](#requirement\_turingpi) | >= 1.2.0 |
38+
39+
## Providers
40+
41+
| Name | Version |
42+
|------|---------|
43+
| <a name="provider_turingpi"></a> [turingpi](#provider\_turingpi) | >= 1.2.0 |
44+
45+
## Modules
46+
47+
No modules.
48+
49+
## Resources
50+
51+
| Name | Type |
52+
|------|------|
53+
| [turingpi_power.node1](https://registry.terraform.io/providers/jfreed-dev/turingpi/latest/docs/resources/power) | resource |
54+
| [turingpi_power.node2](https://registry.terraform.io/providers/jfreed-dev/turingpi/latest/docs/resources/power) | resource |
55+
56+
## Inputs
57+
58+
No inputs.
59+
60+
## Outputs
61+
62+
No outputs.
63+
64+
## Inputs
65+
66+
No inputs.
67+
68+
## Outputs
69+
70+
No outputs.
71+
72+
## Providers
73+
74+
| Name | Version |
75+
|------|---------|
76+
| <a name="provider_turingpi"></a> [turingpi](#provider\_turingpi) | >= 1.2.0 |
77+
78+
## Requirements
79+
80+
| Name | Version |
81+
|------|---------|
82+
| <a name="requirement_turingpi"></a> [turingpi](#requirement\_turingpi) | >= 1.2.0 |
83+
<!-- END_TF_DOCS -->

examples/flash-firmware/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,64 @@ terraform apply -var="firmware_path=/path/to/firmware.img"
2424
- The `turingpi_flash` resource uses `ForceNew` for both `node` and `firmware_file`
2525
- Changing either value will destroy and recreate the resource (re-flash)
2626
- Ensure the firmware file exists and is accessible
27+
28+
<!-- BEGIN_TF_DOCS -->
29+
30+
31+
## Usage
32+
33+
## Requirements
34+
35+
| Name | Version |
36+
|------|---------|
37+
| <a name="requirement_turingpi"></a> [turingpi](#requirement\_turingpi) | >= 1.2.0 |
38+
39+
## Providers
40+
41+
| Name | Version |
42+
|------|---------|
43+
| <a name="provider_turingpi"></a> [turingpi](#provider\_turingpi) | >= 1.2.0 |
44+
45+
## Modules
46+
47+
No modules.
48+
49+
## Resources
50+
51+
| Name | Type |
52+
|------|------|
53+
| [turingpi_flash.node1](https://registry.terraform.io/providers/jfreed-dev/turingpi/latest/docs/resources/flash) | resource |
54+
| [turingpi_flash.node2](https://registry.terraform.io/providers/jfreed-dev/turingpi/latest/docs/resources/flash) | resource |
55+
56+
## Inputs
57+
58+
| Name | Description | Type | Default | Required |
59+
|------|-------------|------|---------|:--------:|
60+
| <a name="input_firmware_path"></a> [firmware\_path](#input\_firmware\_path) | Path to the firmware image file | `string` | n/a | yes |
61+
62+
## Outputs
63+
64+
No outputs.
65+
66+
## Inputs
67+
68+
| Name | Description | Type | Default | Required |
69+
|------|-------------|------|---------|:--------:|
70+
| <a name="input_firmware_path"></a> [firmware\_path](#input\_firmware\_path) | Path to the firmware image file | `string` | n/a | yes |
71+
72+
## Outputs
73+
74+
No outputs.
75+
76+
## Providers
77+
78+
| Name | Version |
79+
|------|---------|
80+
| <a name="provider_turingpi"></a> [turingpi](#provider\_turingpi) | >= 1.2.0 |
81+
82+
## Requirements
83+
84+
| Name | Version |
85+
|------|---------|
86+
| <a name="requirement_turingpi"></a> [turingpi](#requirement\_turingpi) | >= 1.2.0 |
87+
<!-- END_TF_DOCS -->

examples/full-provisioning/README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,74 @@ terraform apply -var="boot_timeout=180"
3838
## Boot Verification
3939

4040
When `boot_check = true`, the provider monitors UART output for a login prompt. This ensures the node has fully booted before Terraform continues. The `login_prompt_timeout` controls how long to wait (default: 60 seconds).
41+
42+
<!-- BEGIN_TF_DOCS -->
43+
44+
45+
## Usage
46+
47+
## Requirements
48+
49+
| Name | Version |
50+
|------|---------|
51+
| <a name="requirement_turingpi"></a> [turingpi](#requirement\_turingpi) | >= 1.2.0 |
52+
53+
## Providers
54+
55+
| Name | Version |
56+
|------|---------|
57+
| <a name="provider_turingpi"></a> [turingpi](#provider\_turingpi) | >= 1.2.0 |
58+
59+
## Modules
60+
61+
No modules.
62+
63+
## Resources
64+
65+
| Name | Type |
66+
|------|------|
67+
| [turingpi_node.node1](https://registry.terraform.io/providers/jfreed-dev/turingpi/latest/docs/resources/node) | resource |
68+
| [turingpi_node.node2](https://registry.terraform.io/providers/jfreed-dev/turingpi/latest/docs/resources/node) | resource |
69+
| [turingpi_node.node3](https://registry.terraform.io/providers/jfreed-dev/turingpi/latest/docs/resources/node) | resource |
70+
| [turingpi_node.node4](https://registry.terraform.io/providers/jfreed-dev/turingpi/latest/docs/resources/node) | resource |
71+
72+
## Inputs
73+
74+
| Name | Description | Type | Default | Required |
75+
|------|-------------|------|---------|:--------:|
76+
| <a name="input_boot_pattern"></a> [boot\_pattern](#input\_boot\_pattern) | Pattern to detect in UART output for boot verification | `string` | `"login:"` | no |
77+
| <a name="input_boot_timeout"></a> [boot\_timeout](#input\_boot\_timeout) | Timeout in seconds to wait for boot completion | `number` | `120` | no |
78+
| <a name="input_firmware_path"></a> [firmware\_path](#input\_firmware\_path) | Path to the firmware image file | `string` | `""` | no |
79+
80+
## Outputs
81+
82+
| Name | Description |
83+
|------|-------------|
84+
| <a name="output_node_status"></a> [node\_status](#output\_node\_status) | n/a |
85+
86+
## Inputs
87+
88+
| Name | Description | Type | Default | Required |
89+
|------|-------------|------|---------|:--------:|
90+
| <a name="input_boot_pattern"></a> [boot\_pattern](#input\_boot\_pattern) | Pattern to detect in UART output for boot verification | `string` | `"login:"` | no |
91+
| <a name="input_boot_timeout"></a> [boot\_timeout](#input\_boot\_timeout) | Timeout in seconds to wait for boot completion | `number` | `120` | no |
92+
| <a name="input_firmware_path"></a> [firmware\_path](#input\_firmware\_path) | Path to the firmware image file | `string` | `""` | no |
93+
94+
## Outputs
95+
96+
| Name | Description |
97+
|------|-------------|
98+
| <a name="output_node_status"></a> [node\_status](#output\_node\_status) | n/a |
99+
100+
## Providers
101+
102+
| Name | Version |
103+
|------|---------|
104+
| <a name="provider_turingpi"></a> [turingpi](#provider\_turingpi) | >= 1.2.0 |
105+
106+
## Requirements
107+
108+
| Name | Version |
109+
|------|---------|
110+
| <a name="requirement_turingpi"></a> [turingpi](#requirement\_turingpi) | >= 1.2.0 |
111+
<!-- END_TF_DOCS -->

examples/full-provisioning/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ variable "boot_timeout" {
2424
variable "boot_pattern" {
2525
description = "Pattern to detect in UART output for boot verification"
2626
type = string
27-
default = "login:" # Use "machine is running and ready" for Talos Linux
27+
default = "login:" # Use "machine is running and ready" for Talos Linux
2828
}
2929

3030
# Fully provision node 1 with firmware and boot verification

examples/k3s-cluster/README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,85 @@ kubectl get nodes
5050
| `api_endpoint` | Kubernetes API server URL |
5151
| `cluster_status` | Current cluster status |
5252
| `kubeconfig_path` | Local path to kubeconfig file |
53+
54+
<!-- BEGIN_TF_DOCS -->
55+
56+
57+
## Usage
58+
59+
## Requirements
60+
61+
| Name | Version |
62+
|------|---------|
63+
| <a name="requirement_turingpi"></a> [turingpi](#requirement\_turingpi) | >= 1.2.0 |
64+
65+
## Providers
66+
67+
| Name | Version |
68+
|------|---------|
69+
| <a name="provider_turingpi"></a> [turingpi](#provider\_turingpi) | >= 1.2.0 |
70+
71+
## Modules
72+
73+
No modules.
74+
75+
## Resources
76+
77+
| Name | Type |
78+
|------|------|
79+
| [turingpi_k3s_cluster.cluster](https://registry.terraform.io/providers/jfreed-dev/turingpi/latest/docs/resources/k3s_cluster) | resource |
80+
81+
## Inputs
82+
83+
| Name | Description | Type | Default | Required |
84+
|------|-------------|------|---------|:--------:|
85+
| <a name="input_control_plane_ip"></a> [control\_plane\_ip](#input\_control\_plane\_ip) | IP address of the control plane node | `string` | `"10.10.88.73"` | no |
86+
| <a name="input_ingress_ip"></a> [ingress\_ip](#input\_ingress\_ip) | IP address for NGINX Ingress controller | `string` | `"10.10.88.80"` | no |
87+
| <a name="input_k3s_version"></a> [k3s\_version](#input\_k3s\_version) | K3s version to install (empty for latest stable) | `string` | `""` | no |
88+
| <a name="input_metallb_ip_range"></a> [metallb\_ip\_range](#input\_metallb\_ip\_range) | IP range for MetalLB load balancer | `string` | `"10.10.88.80-10.10.88.89"` | no |
89+
| <a name="input_ssh_key_path"></a> [ssh\_key\_path](#input\_ssh\_key\_path) | Path to SSH private key file | `string` | `"~/.ssh/id_rsa"` | no |
90+
| <a name="input_ssh_user"></a> [ssh\_user](#input\_ssh\_user) | SSH username for node access | `string` | `"root"` | no |
91+
| <a name="input_worker_ips"></a> [worker\_ips](#input\_worker\_ips) | List of worker node IP addresses | `list(string)` | <pre>[<br/> "10.10.88.74",<br/> "10.10.88.75",<br/> "10.10.88.76"<br/>]</pre> | no |
92+
93+
## Outputs
94+
95+
| Name | Description |
96+
|------|-------------|
97+
| <a name="output_api_endpoint"></a> [api\_endpoint](#output\_api\_endpoint) | Kubernetes API server endpoint |
98+
| <a name="output_cluster_status"></a> [cluster\_status](#output\_cluster\_status) | Current status of the cluster |
99+
| <a name="output_kubeconfig"></a> [kubeconfig](#output\_kubeconfig) | Kubeconfig content for accessing the cluster |
100+
| <a name="output_kubeconfig_path"></a> [kubeconfig\_path](#output\_kubeconfig\_path) | Path to the kubeconfig file |
101+
102+
## Inputs
103+
104+
| Name | Description | Type | Default | Required |
105+
|------|-------------|------|---------|:--------:|
106+
| <a name="input_control_plane_ip"></a> [control\_plane\_ip](#input\_control\_plane\_ip) | IP address of the control plane node | `string` | `"10.10.88.73"` | no |
107+
| <a name="input_ingress_ip"></a> [ingress\_ip](#input\_ingress\_ip) | IP address for NGINX Ingress controller | `string` | `"10.10.88.80"` | no |
108+
| <a name="input_k3s_version"></a> [k3s\_version](#input\_k3s\_version) | K3s version to install (empty for latest stable) | `string` | `""` | no |
109+
| <a name="input_metallb_ip_range"></a> [metallb\_ip\_range](#input\_metallb\_ip\_range) | IP range for MetalLB load balancer | `string` | `"10.10.88.80-10.10.88.89"` | no |
110+
| <a name="input_ssh_key_path"></a> [ssh\_key\_path](#input\_ssh\_key\_path) | Path to SSH private key file | `string` | `"~/.ssh/id_rsa"` | no |
111+
| <a name="input_ssh_user"></a> [ssh\_user](#input\_ssh\_user) | SSH username for node access | `string` | `"root"` | no |
112+
| <a name="input_worker_ips"></a> [worker\_ips](#input\_worker\_ips) | List of worker node IP addresses | `list(string)` | <pre>[<br/> "10.10.88.74",<br/> "10.10.88.75",<br/> "10.10.88.76"<br/>]</pre> | no |
113+
114+
## Outputs
115+
116+
| Name | Description |
117+
|------|-------------|
118+
| <a name="output_api_endpoint"></a> [api\_endpoint](#output\_api\_endpoint) | Kubernetes API server endpoint |
119+
| <a name="output_cluster_status"></a> [cluster\_status](#output\_cluster\_status) | Current status of the cluster |
120+
| <a name="output_kubeconfig"></a> [kubeconfig](#output\_kubeconfig) | Kubeconfig content for accessing the cluster |
121+
| <a name="output_kubeconfig_path"></a> [kubeconfig\_path](#output\_kubeconfig\_path) | Path to the kubeconfig file |
122+
123+
## Providers
124+
125+
| Name | Version |
126+
|------|---------|
127+
| <a name="provider_turingpi"></a> [turingpi](#provider\_turingpi) | >= 1.2.0 |
128+
129+
## Requirements
130+
131+
| Name | Version |
132+
|------|---------|
133+
| <a name="requirement_turingpi"></a> [turingpi](#requirement\_turingpi) | >= 1.2.0 |
134+
<!-- END_TF_DOCS -->

0 commit comments

Comments
 (0)