mirror of
https://github.com/RWejlgaard/pez-infra.git
synced 2026-05-06 04:14:43 +00:00
Compare commits
5 commits
1c6784eade
...
5c404dca87
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c404dca87 | |||
| d76be4828c | |||
| 19928358c5 | |||
| 7c3fec983b | |||
| 98be03c273 |
11 changed files with 58 additions and 52 deletions
6
.github/workflows/deploy-on-merge.yml
vendored
6
.github/workflows/deploy-on-merge.yml
vendored
|
|
@ -5,7 +5,7 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'terraform/**'
|
- "terraform/**"
|
||||||
|
|
||||||
# Requires these repository secrets:
|
# Requires these repository secrets:
|
||||||
# TAILSCALE_CLIENT_ID — Tailscale OAuth client ID (federated identity)
|
# TAILSCALE_CLIENT_ID — Tailscale OAuth client ID (federated identity)
|
||||||
|
|
@ -20,7 +20,7 @@ jobs:
|
||||||
outputs:
|
outputs:
|
||||||
hosts: ${{ steps.discover.outputs.hosts }}
|
hosts: ${{ steps.discover.outputs.hosts }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Read hosts from inventory
|
- name: Read hosts from inventory
|
||||||
id: discover
|
id: discover
|
||||||
|
|
@ -40,7 +40,7 @@ jobs:
|
||||||
host: ${{ fromJson(needs.discover.outputs.hosts) }}
|
host: ${{ fromJson(needs.discover.outputs.hosts) }}
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Set up Tailscale
|
- name: Set up Tailscale
|
||||||
uses: tailscale/github-action@v4
|
uses: tailscale/github-action@v4
|
||||||
|
|
|
||||||
10
.github/workflows/deploy.yml
vendored
10
.github/workflows/deploy.yml
vendored
|
|
@ -4,15 +4,15 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
target:
|
target:
|
||||||
description: 'Target host (e.g. helsinki-a, london-b, all)'
|
description: "Target host (e.g. helsinki-a, london-b, all)"
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
playbook:
|
playbook:
|
||||||
description: 'Ansible playbook to run (e.g. site.yml, update.yml)'
|
description: "Ansible playbook to run (e.g. site.yml, update.yml)"
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
dry_run:
|
dry_run:
|
||||||
description: 'Dry run (--check mode)'
|
description: "Dry run (--check mode)"
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: true
|
default: true
|
||||||
|
|
@ -30,7 +30,7 @@ jobs:
|
||||||
outputs:
|
outputs:
|
||||||
hosts: ${{ steps.prepare.outputs.hosts }}
|
hosts: ${{ steps.prepare.outputs.hosts }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Build host matrix
|
- name: Build host matrix
|
||||||
id: prepare
|
id: prepare
|
||||||
|
|
@ -56,7 +56,7 @@ jobs:
|
||||||
host: ${{ fromJson(needs.prepare.outputs.hosts) }}
|
host: ${{ fromJson(needs.prepare.outputs.hosts) }}
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Set up Tailscale
|
- name: Set up Tailscale
|
||||||
uses: tailscale/github-action@v4
|
uses: tailscale/github-action@v4
|
||||||
|
|
|
||||||
2
.github/workflows/lint-ansible.yml
vendored
2
.github/workflows/lint-ansible.yml
vendored
|
|
@ -8,7 +8,7 @@ jobs:
|
||||||
name: ansible-lint
|
name: ansible-lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Check for Ansible files
|
- name: Check for Ansible files
|
||||||
id: check
|
id: check
|
||||||
|
|
|
||||||
2
.github/workflows/lint-docker-compose.yml
vendored
2
.github/workflows/lint-docker-compose.yml
vendored
|
|
@ -8,7 +8,7 @@ jobs:
|
||||||
name: docker compose config
|
name: docker compose config
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Stub missing env files referenced by Compose
|
- name: Stub missing env files referenced by Compose
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
16
.github/workflows/terraform.yml
vendored
16
.github/workflows/terraform.yml
vendored
|
|
@ -4,8 +4,8 @@ on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
paths:
|
paths:
|
||||||
- 'terraform/**'
|
- "terraform/**"
|
||||||
- '.github/workflows/terraform.yml'
|
- ".github/workflows/terraform.yml"
|
||||||
|
|
||||||
# Requires these repository secrets:
|
# Requires these repository secrets:
|
||||||
# AGE_SECRET_KEY — age private key for SOPS decryption
|
# AGE_SECRET_KEY — age private key for SOPS decryption
|
||||||
|
|
@ -15,10 +15,10 @@ jobs:
|
||||||
name: Plan
|
name: Plan
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install OpenTofu
|
- name: Install OpenTofu
|
||||||
uses: opentofu/setup-opentofu@v1
|
uses: opentofu/setup-opentofu@v2
|
||||||
with:
|
with:
|
||||||
tofu_version: latest
|
tofu_version: latest
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ jobs:
|
||||||
|
|
||||||
- name: Upload plan
|
- name: Upload plan
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: tfplan
|
name: tfplan
|
||||||
path: terraform/tfplan
|
path: terraform/tfplan
|
||||||
|
|
@ -66,10 +66,10 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: production
|
environment: production
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install OpenTofu
|
- name: Install OpenTofu
|
||||||
uses: opentofu/setup-opentofu@v1
|
uses: opentofu/setup-opentofu@v2
|
||||||
with:
|
with:
|
||||||
tofu_version: latest
|
tofu_version: latest
|
||||||
|
|
||||||
|
|
@ -99,7 +99,7 @@ jobs:
|
||||||
run: tofu init
|
run: tofu init
|
||||||
|
|
||||||
- name: Download plan
|
- name: Download plan
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: tfplan
|
name: tfplan
|
||||||
path: terraform/
|
path: terraform/
|
||||||
|
|
|
||||||
2
.github/workflows/validate-caddyfile.yml
vendored
2
.github/workflows/validate-caddyfile.yml
vendored
|
|
@ -8,7 +8,7 @@ jobs:
|
||||||
name: caddy validate
|
name: caddy validate
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Check for Caddyfile
|
- name: Check for Caddyfile
|
||||||
id: check
|
id: check
|
||||||
|
|
|
||||||
4
.github/workflows/validate-terraform.yml
vendored
4
.github/workflows/validate-terraform.yml
vendored
|
|
@ -8,10 +8,10 @@ jobs:
|
||||||
name: tofu validate
|
name: tofu validate
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install OpenTofu
|
- name: Install OpenTofu
|
||||||
uses: opentofu/setup-opentofu@v1
|
uses: opentofu/setup-opentofu@v2
|
||||||
with:
|
with:
|
||||||
tofu_version: latest
|
tofu_version: latest
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
services:
|
services:
|
||||||
octopus-exporter:
|
octopus-exporter:
|
||||||
image: rwejlgaard/octopus_exporter:v1.1.0
|
image: rwejlgaard/octopus_exporter:v1.1.1
|
||||||
container_name: octopus_exporter
|
container_name: octopus_exporter
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
|
|
|
||||||
|
|
@ -37,3 +37,4 @@ resource "hcloud_server" "helsinki-a" {
|
||||||
ipv6_enabled = true
|
ipv6_enabled = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
4
terraform/hetzner_ssh_keys.tf
Normal file
4
terraform/hetzner_ssh_keys.tf
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
resource "hcloud_ssh_key" "personal" {
|
||||||
|
name = "personal"
|
||||||
|
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDlU2h+JgVMVsHkkcxed9WbrUCKWfuUrY6yErmGIIREP6X2cua2qE4H+329FSJXQs0Yd0OiNwsXzfW88kl0+aMopQXaccY3q8109KR43RNrRrril9od+PidVvT/fvV8eNYVE9M4gyT1c9t8ZLD85vJf9rILFWbLG4DqqFL3z33W2u//Bl8uVLoY3tSgBmukVt45If9g9mxVfSstLmZj7j75rghS0EbE2kzwgUH397mJGMlJJdFhzRtP+/D09hE+zgFxl45V6dszEu9ggawRRGvEcR1dXDB0g6n3/7h6M+pb8/77ZAxk4AwD6CzZi8k7SlVkzCKZQRPpge+C0xLdm9EAY7byj30XdGgpo80eiCJmVImYm4VmPnjh39IumQWkDgpXkYQ9aj9jUDvcSrEmwTBRJOqmaO7BW0sVbP0BDW3UjCyeUQ8zprmWsUscoB0u9r4bMOLnhNldXljjKcDRdX2JciIILiCEfnn781Q3uxLgOoHEnYto0tSxbLQI/o9WB4M="
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ terraform {
|
||||||
required_providers {
|
required_providers {
|
||||||
cloudflare = {
|
cloudflare = {
|
||||||
source = "cloudflare/cloudflare"
|
source = "cloudflare/cloudflare"
|
||||||
|
version = "~> 5.19"
|
||||||
}
|
}
|
||||||
|
|
||||||
hcloud = {
|
hcloud = {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue