Skip to content

Commit 485763d

Browse files
committed
Add CI/CD automation, linting, and developer tooling
CI/CD & Automation: - GitHub Actions workflow for Terraform validation (fmt, init, validate) on PRs - TFLint integration with recommended ruleset - Trivy security scanning for misconfigurations - terraform-docs integration for auto-generated documentation - Dependabot for Terraform provider and GitHub Actions updates - Pre-commit hooks for local validation - CODEOWNERS file for automatic PR review requests Repository Configuration: - Branch protection with required status checks and code owner reviews - Issue templates (bug report, feature request) - Pull request template with validation checklist - CONTRIBUTING guide with development setup instructions Cleanup: - Remove unused variables from k3s-cluster and talos-cluster modules
1 parent a133c6a commit 485763d

File tree

25 files changed

+960
-202
lines changed

25 files changed

+960
-202
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default code owners for all files
2+
* @jfreed-dev
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug or unexpected behavior
4+
title: "[Bug]: "
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
11+
A clear description of the bug.
12+
13+
## Module
14+
15+
- [ ] flash-nodes
16+
- [ ] talos-cluster
17+
- [ ] k3s-cluster
18+
- [ ] metallb
19+
- [ ] ingress-nginx
20+
- [ ] longhorn
21+
- [ ] monitoring
22+
- [ ] portainer
23+
24+
## Environment
25+
26+
- Module version:
27+
- Terraform version:
28+
- Provider versions:
29+
30+
## Steps to Reproduce
31+
32+
1.
33+
2.
34+
3.
35+
36+
## Expected Behavior
37+
38+
What you expected to happen.
39+
40+
## Actual Behavior
41+
42+
What actually happened.
43+
44+
## Terraform Configuration
45+
46+
```hcl
47+
# Relevant module configuration
48+
```
49+
50+
## Error Output
51+
52+
```
53+
# Terraform error output
54+
```
55+
56+
## Additional Context
57+
58+
Any other relevant information.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Documentation
4+
url: https://registry.terraform.io/modules/jfreed-dev/modules/turingpi
5+
about: Check the Terraform Registry for module documentation
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature or enhancement
4+
title: "[Feature]: "
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Description
10+
11+
A clear description of the feature you'd like.
12+
13+
## Module
14+
15+
- [ ] flash-nodes
16+
- [ ] talos-cluster
17+
- [ ] k3s-cluster
18+
- [ ] metallb
19+
- [ ] ingress-nginx
20+
- [ ] longhorn
21+
- [ ] monitoring
22+
- [ ] portainer
23+
- [ ] New module
24+
25+
## Use Case
26+
27+
Describe the problem this feature would solve.
28+
29+
## Proposed Solution
30+
31+
How you think this could be implemented.
32+
33+
## Alternatives Considered
34+
35+
Any alternative solutions you've considered.
36+
37+
## Additional Context
38+
39+
Any other relevant information, examples, or references.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Summary
2+
3+
Brief description of the changes.
4+
5+
## Type of Change
6+
7+
- [ ] Bug fix
8+
- [ ] New feature
9+
- [ ] Enhancement
10+
- [ ] Documentation
11+
- [ ] Refactoring
12+
- [ ] Dependency update
13+
14+
## Modules Affected
15+
16+
- [ ] flash-nodes
17+
- [ ] talos-cluster
18+
- [ ] k3s-cluster
19+
- [ ] metallb
20+
- [ ] ingress-nginx
21+
- [ ] longhorn
22+
- [ ] monitoring
23+
- [ ] portainer
24+
25+
## Checklist
26+
27+
- [ ] `terraform fmt` passes
28+
- [ ] `terraform validate` passes
29+
- [ ] `tflint` passes
30+
- [ ] `trivy` security scan passes
31+
- [ ] Documentation updated (if adding/changing variables or outputs)
32+
- [ ] CHANGELOG.md updated (for user-facing changes)
33+
34+
## Testing
35+
36+
Describe how you tested these changes.
37+
38+
## Breaking Changes
39+
40+
List any breaking changes and migration steps (if applicable).
41+
42+
## Related Issues
43+
44+
Closes #

.github/dependabot.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: terraform
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
day: monday
8+
open-pull-requests-limit: 5
9+
labels:
10+
- dependencies
11+
- terraform
12+
13+
- package-ecosystem: terraform
14+
directory: /modules/flash-nodes
15+
schedule:
16+
interval: weekly
17+
day: monday
18+
open-pull-requests-limit: 5
19+
labels:
20+
- dependencies
21+
- terraform
22+
23+
- package-ecosystem: terraform
24+
directory: /modules/k3s-cluster
25+
schedule:
26+
interval: weekly
27+
day: monday
28+
open-pull-requests-limit: 5
29+
labels:
30+
- dependencies
31+
- terraform
32+
33+
- package-ecosystem: terraform
34+
directory: /modules/talos-cluster
35+
schedule:
36+
interval: weekly
37+
day: monday
38+
open-pull-requests-limit: 5
39+
labels:
40+
- dependencies
41+
- terraform
42+
43+
- package-ecosystem: terraform
44+
directory: /modules/addons/metallb
45+
schedule:
46+
interval: weekly
47+
day: monday
48+
open-pull-requests-limit: 5
49+
labels:
50+
- dependencies
51+
- terraform
52+
53+
- package-ecosystem: terraform
54+
directory: /modules/addons/ingress-nginx
55+
schedule:
56+
interval: weekly
57+
day: monday
58+
open-pull-requests-limit: 5
59+
labels:
60+
- dependencies
61+
- terraform
62+
63+
- package-ecosystem: terraform
64+
directory: /modules/addons/longhorn
65+
schedule:
66+
interval: weekly
67+
day: monday
68+
open-pull-requests-limit: 5
69+
labels:
70+
- dependencies
71+
- terraform
72+
73+
- package-ecosystem: terraform
74+
directory: /modules/addons/monitoring
75+
schedule:
76+
interval: weekly
77+
day: monday
78+
open-pull-requests-limit: 5
79+
labels:
80+
- dependencies
81+
- terraform
82+
83+
- package-ecosystem: terraform
84+
directory: /modules/addons/portainer
85+
schedule:
86+
interval: weekly
87+
day: monday
88+
open-pull-requests-limit: 5
89+
labels:
90+
- dependencies
91+
- terraform
92+
93+
- package-ecosystem: github-actions
94+
directory: /
95+
schedule:
96+
interval: weekly
97+
day: monday
98+
open-pull-requests-limit: 5
99+
labels:
100+
- dependencies
101+
- github-actions

.github/workflows/docs.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Terraform Docs
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
paths:
7+
- '**.tf'
8+
- '.terraform-docs.yml'
9+
10+
jobs:
11+
docs:
12+
name: Generate Docs
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.pull_request.head.ref }}
20+
21+
- name: Generate docs for modules/flash-nodes
22+
uses: terraform-docs/gh-actions@v1
23+
with:
24+
working-dir: modules/flash-nodes
25+
config-file: .terraform-docs.yml
26+
output-file: README.md
27+
output-method: inject
28+
git-push: false
29+
30+
- name: Generate docs for modules/k3s-cluster
31+
uses: terraform-docs/gh-actions@v1
32+
with:
33+
working-dir: modules/k3s-cluster
34+
config-file: .terraform-docs.yml
35+
output-file: README.md
36+
output-method: inject
37+
git-push: false
38+
39+
- name: Generate docs for modules/talos-cluster
40+
uses: terraform-docs/gh-actions@v1
41+
with:
42+
working-dir: modules/talos-cluster
43+
config-file: .terraform-docs.yml
44+
output-file: README.md
45+
output-method: inject
46+
git-push: false
47+
48+
- name: Generate docs for modules/addons/metallb
49+
uses: terraform-docs/gh-actions@v1
50+
with:
51+
working-dir: modules/addons/metallb
52+
config-file: .terraform-docs.yml
53+
output-file: README.md
54+
output-method: inject
55+
git-push: false
56+
57+
- name: Generate docs for modules/addons/ingress-nginx
58+
uses: terraform-docs/gh-actions@v1
59+
with:
60+
working-dir: modules/addons/ingress-nginx
61+
config-file: .terraform-docs.yml
62+
output-file: README.md
63+
output-method: inject
64+
git-push: false
65+
66+
- name: Generate docs for modules/addons/longhorn
67+
uses: terraform-docs/gh-actions@v1
68+
with:
69+
working-dir: modules/addons/longhorn
70+
config-file: .terraform-docs.yml
71+
output-file: README.md
72+
output-method: inject
73+
git-push: false
74+
75+
- name: Generate docs for modules/addons/monitoring
76+
uses: terraform-docs/gh-actions@v1
77+
with:
78+
working-dir: modules/addons/monitoring
79+
config-file: .terraform-docs.yml
80+
output-file: README.md
81+
output-method: inject
82+
git-push: false
83+
84+
- name: Generate docs for modules/addons/portainer
85+
uses: terraform-docs/gh-actions@v1
86+
with:
87+
working-dir: modules/addons/portainer
88+
config-file: .terraform-docs.yml
89+
output-file: README.md
90+
output-method: inject
91+
git-push: false
92+
93+
- name: Check for changes
94+
id: changes
95+
run: |
96+
if git diff --quiet; then
97+
echo "changed=false" >> $GITHUB_OUTPUT
98+
else
99+
echo "changed=true" >> $GITHUB_OUTPUT
100+
fi
101+
102+
- name: Commit and push
103+
if: steps.changes.outputs.changed == 'true'
104+
run: |
105+
git config user.name "github-actions[bot]"
106+
git config user.email "github-actions[bot]@users.noreply.github.com"
107+
git add -A
108+
git commit -m "docs: auto-generate module documentation"
109+
git push

0 commit comments

Comments
 (0)