README Source History Refs Compare Notes Search adds hooks and project layout 2b74eb6b2e68ff98b341b5ecc553dafa5a4ae8d9
Oliver Jan Krylow <oliver@bugabinga.net > · 2026-01-28 15:37 UTC
unsigned 1 parent
adds git commit hooks using lefthook.
adds projecty structure with *.tf files for various purposes.
adds a justfile to track useful commands for this project.
---
okr
Changed files (9) .gitignore ready @@ -32,6 +32,7 @@
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
+tfplan
# Ignore CLI configuration files
.terraformrc
README.md ready @@ -3,8 +3,17 @@
# isp-insoft Infrastructure Private Cloud
This repo hosts Infrastructure as Code (IaC) for the internal, private cloud services of isp-insoft GmbH.
This infrastructure is hosted on hetzner.com and provisioned via opentofu.
+## Dependencies
+
+Besides the obvious dependency on git, these Tools are needed to work with this repo:
+
+- [opentofu][]: IaC language
+- [just][]: command runner
+- [lefthook][]: git commit hooks
+- your favorite code editor
+
## Secrets management
Since the services to manage secrets (e.g. Hashicorp's Vault) are created within this project, these cannot be used here to manage secrets.
@@ -14,3 +23,7 @@
After checking out this repository, you _must_ create the file `secrets.auto.tfvars` manually and provide all values referenced in `secrets.tf`.
If any referenced values are missing, opentofu will prompt for their values during the plan phase.
That means you have to add those values to `secrets.auto.tfvars`.
+
+[opentofu]: https://opentofu.org
+[just]: https://just.systems
+[lefthook]: https://lefthook.dev
hetzner.tf ready @@ -1,12 +1,0 @@
-terraform {
- required_providers {
- hcloud = {
- source = "opentofu/hcloud"
- version = "~> 1.59"
- }
- }
-}
-
-provider "hcloud" {
- token = var.hcloud_token
-}
justfile ready @@ -1,0 +1,4 @@
+# https://just.systems
+
+default:
+ echo 'Hello, world!'
lefthook.yml ready @@ -1,0 +1,11 @@
+# This file defines git hooks for this repo.
+# These hooks need to be initially applied using `lefthook install` in the root directory of this repo.
+
+pre-commit:
+ jobs:
+ - name: format
+ run: tofu fmt
+ stage_fixed: true
+
+ - name: check
+ run: tofu validate
main.tf ready @@ -1,4 +1,0 @@
-output "token_check" {
- value = var.hcloud_token
- sensitive = true
-}
outputs.tf ready @@ -1,0 +1,4 @@
+output "token_check" {
+ value = var.hcloud_token
+ sensitive = true
+}
providers.tf ready @@ -1,0 +1,12 @@
+terraform {
+ required_providers {
+ hcloud = {
+ source = "opentofu/hcloud"
+ version = "~> 1.59"
+ }
+ }
+}
+
+provider "hcloud" {
+ token = var.hcloud_token
+}