Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4aabec0

Browse files
author
Matt Reeves
committedOct 14, 2024
Merge branch 'main' into renovate/ghcr.io-requarks-wiki-2.x
2 parents f8fc477 + da7e214 commit 4aabec0

File tree

10 files changed

+138
-50
lines changed

10 files changed

+138
-50
lines changed
 

‎.forgejo/workflows/tofu.yml

Lines changed: 74 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,92 @@
1-
name: Terraform Apply
1+
name: OpenTofu Automation
22

33
on:
44
push:
5+
branches:
6+
- main
57
paths:
68
- 'terraform/**'
79

810
jobs:
9-
terraform:
10-
runs-on: ubuntu-latest
11+
deploy:
12+
runs-on: docker
13+
container:
14+
image: node:22
1115
steps:
1216
- name: Checkout code
1317
uses: actions/checkout@v4
1418

15-
- name: Download OpenTofu Installer
19+
- name: Get Secrets from Bitwarden
20+
id: bitwarden-secrets
21+
uses: https://github.com/bitwarden/sm-action@v2
22+
with:
23+
access_token: ${{ secrets.BW_ACCESS_TOKEN }}
24+
base_url: https://vault.bitwarden.com
25+
secrets: |
26+
c65f8886-f6fb-4c17-bc79-b208000604bf > arrbuntu_ip_address
27+
2dae51bd-bd65-474c-971c-b20800f22afa > aws_access_key_id
28+
287c852d-f2b5-467d-bfc4-b20800f25f52 > aws_secret_access_key
29+
a54974b8-c6b3-4df7-9042-b20800064050 > downloaders_ip_address
30+
dacbeafa-c671-4b9c-9334-b2080006f75b > init_password
31+
9ceabbd0-6492-4674-9bab-b2080006e333 > init_username
32+
0bc3c1a3-fc48-48ce-85c5-b2080007136a > kasm_ip
33+
63ca1819-5090-4e30-9dba-b20800072718 > kasm_ssh_ip
34+
47ef68aa-32a9-45b0-835d-b2080006ce38 > npm_ip_address
35+
d0c7f3ec-8277-4b1b-9a1b-b2080006b842 > prox_ip_address
36+
17ab7869-c7a1-4ece-8c64-b20800075213 > pve2_ip_address
37+
f8f85ab2-5f6d-46a7-9e06-b20800076d26 > s3_endpoint
38+
68f1d77d-4e96-498a-9464-b208000679a4 > ssh_password
39+
d0762ced-73de-4f30-aa1c-b20800069536 > ssh_username
40+
d8017351-7a11-42e6-9e8d-b208000739b8 > ubu_ip_address
41+
1d250f4a-ae18-4e19-934c-b2080005e132 > virtual_environment_api
42+
a4ed343a-bb92-4beb-a421-b2080005bf98 > virtual_environment_endpoint
43+
af0ed579-05f8-405f-b0f3-b208000620ca > vlan_gateway
44+
45+
46+
- name: Create tfvars file
47+
working-directory: ./terraform
1648
run: |
17-
curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh
18-
chmod +x install-opentofu.sh
49+
cat <<EOF > terraform.tfvars
50+
arrbuntu_ip_address = "${{ steps.bitwarden-secrets.outputs.arrbuntu_ip_address }}"
51+
aws_access_key_id = "${{ steps.bitwarden-secrets.outputs.aws_access_key_id }}"
52+
aws_secret_access_key = "${{ steps.bitwarden-secrets.outputs.aws_secret_access_key }}"
53+
downloaders_ip_address = "${{ steps.bitwarden-secrets.outputs.downloaders_ip_address }}"
54+
init_password = "${{ steps.bitwarden-secrets.outputs.init_password }}"
55+
init_username = "${{ steps.bitwarden-secrets.outputs.init_username }}"
56+
kasm_ip = "${{ steps.bitwarden-secrets.outputs.kasm_ip }}"
57+
kasm_ssh_ip = "${{ steps.bitwarden-secrets.outputs.kasm_ssh_ip }}"
58+
npm_ip_address = "${{ steps.bitwarden-secrets.outputs.npm_ip_address }}"
59+
prox_ip_address = "${{ steps.bitwarden-secrets.outputs.prox_ip_address }}"
60+
pve2_ip_address = "${{ steps.bitwarden-secrets.outputs.pve2_ip_address }}"
61+
s3_endpoint = "${{ steps.bitwarden-secrets.outputs.s3_endpoint }}"
62+
ssh_password = "${{ steps.bitwarden-secrets.outputs.ssh_password }}"
63+
ssh_username = "${{ steps.bitwarden-secrets.outputs.ssh_username }}"
64+
ubu_ip_address = "${{ steps.bitwarden-secrets.outputs.ubu_ip_address }}"
65+
virtual_environment_api = "${{ steps.bitwarden-secrets.outputs.virtual_environment_api }}"
66+
virtual_environment_endpoint = "${{ steps.bitwarden-secrets.outputs.virtual_environment_endpoint }}"
67+
vlan_gateway = "${{ steps.bitwarden-secrets.outputs.vlan_gateway }}"
68+
EOF
1969
20-
- name: Inspect and Install OpenTofu
21-
run: ./install-opentofu.sh --install-method deb
70+
- name: Setup OpenTofu
71+
uses: https://github.com/opentofu/setup-opentofu@v1.0.4
2272

23-
- name: Clean up Installer Script
24-
run: rm -f install-opentofu.sh
73+
- name: Run OpenTofu Init
74+
working-directory: ./terraform
75+
run: |
76+
tofu init -var-file=terraform.tfvars
2577
26-
- name: Initialize OpenTofu
27-
run: tofu init
78+
79+
- name: Run OpenTofu Plan
80+
id: plan
2881
working-directory: ./terraform
82+
run: tofu plan -no-color
83+
84+
- name: Display Plan Output
85+
run: |
86+
echo "Plan output:"
87+
echo "${{ steps.plan.outputs.stdout }}"
2988
30-
- name: Apply OpenTofu
31-
run: tofu apply -input=false
89+
- name: Apply the Plan
90+
if: success()
3291
working-directory: ./terraform
92+
run: tofu apply -auto-approve

‎ansible/playbooks/ntp.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
- name: Configure systemd-timesyncd to use router NTP server
3+
hosts: all
4+
become: true
5+
6+
tasks:
7+
- name: Ensure systemd-timesyncd is installed
8+
apt:
9+
name: systemd-timesyncd
10+
state: present
11+
update_cache: yes
12+
13+
- name: Configure timesyncd to use the router's NTP server
14+
shell: sed -i '/^NTP=/c\NTP=10.0.0.1' /etc/systemd/timesyncd.conf
15+
16+
17+
- name: Restart systemd-timesyncd to apply changes
18+
systemd:
19+
name: systemd-timesyncd
20+
state: restarted
21+
enabled: yes
22+
23+
- name: Verify the NTP configuration
24+
command: timedatectl status
25+
register: timesync_status
26+
27+
- name: Show the status of time synchronization
28+
debug:
29+
msg: "{{ timesync_status.stdout }}"

‎docker/arm/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ services:
148148
- gitea_main
149149

150150
vaultwarden:
151-
image: vaultwarden/server:1.32.1
151+
image: vaultwarden/server:1.32.2
152152
container_name: vaultwarden
153153
ports:
154154
- 8989:80

‎docker/cf/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77

88
wallos:
99
container_name: wallos
10-
image: bellamy/wallos:2.29.2
10+
image: bellamy/wallos:2.30.0
1111
ports:
1212
- "8282:80/tcp"
1313
environment:

‎docker/whisper/docker-compose.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎terraform/cloud-init.tf

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
data "local_file" "ssh_public_key" {
2-
filename = "/home/mafyuh/.ssh/main_key.pub"
3-
}
4-
5-
data "local_file" "ssh_public_key_2" {
6-
filename = "/home/mafyuh/.ssh/id_rsa.pub"
1+
locals {
2+
ssh_public_key_1 = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDndt2pi7jZx0qY1qn/UEn2AcZThxCQBvIGNytlPDz1cFNHjB1lGgHdI4uCw7fu2ET6/vpqHxjdQqB/Ehj2fajw1L2zncKB93NMv3pcq7ZJGwIgdw26vfBQZWFazaPk7O5rOGO1hWohE4YlejpOHYGCFs1pUxaC8DQPR0M6GvnccWxzJhpiO+NUeU8F/NC1uKLyypK8CpTmjVQaiTSgn/RorTf7A6sdzfWFndM7k6hw5NqqKVk0OhDfy/XCGQrIRh6/yxFbbthAUJgd8/djELlc7XQaG0nMSBtu6m8+VmMN8XO7FZmus8PwlcXPIhwos+vJlh2+xU+E7Ciwyw4WytCjuw67rL4REbdOh+zqZm//OMswvTxtDiRbTXTsOXqgyh5cOUcNub3UdAl6e7c2ZQT5lz5ZVCNNLVrFigvRE813YlKsoYu1p4XrtyHodeYEXgoLjU0jgRj0EmBEDriafo84lamHK7zItZllNH9hHKWs+iXiQQ4nVD65Ng0mYmM9OF76corqfIuQWkQd8kN2r5a0UHrl+tkhZOY3x3PB9r88yCPRdSkW8ICFObQ069yE4HU9kA41rVPXOU8zxK8UT2svTM0YRcDcfr2VUktU0wEP1ASv8nOAdvq7+pcqpoKrw3sZyyeLncxSAfJCRMjJvUDww92YSTjG4TCwY2gcPXRsww== Generated By Termius"
3+
ssh_public_key_2 = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCt9kj7JcJVf8zfzLlsDv12d9dV7J4SM+Wrq7fWMUseCzl7BK3SX+cNFYWbkZsDsp81VtXrqXDpImIGc9KtRy1tvNmrd/+xlj6aVFH9tHYq//5pOC2C4wcf3wVlSazdhZ64qVwY4glr1Bs4M02GZ92VDjb51JvByl5kfgiKLqRiFyJHv9f5FYEfZqdLY+SKjd7H6fjhMTFTcyfXeGaifUTqogDXPLzk0iP0rx7C3oHOfsKKhZvUe/la9uYJGdbSeQX1H59KOVJQ7UQxr7wn+uu5e7IPPXiBoR4dBU8pAmtWgLo9F0ZdXgu2bOunUBIeL2/dj6xFCI3ZrQ3mLe+upoyhqLKh4+qi5SeQNcqXi7pHhcA1hGzmOMDrPXV/2DA0NcJ6v43qJFRn+Qp8Oy/zApvQ6F/opLhX0yghEc5ltmj+MPMom4ykKxpuGPUHxNplMgmVG+V/YlRXG9BATsQX35kt2lqivX9L4XppgJHhby0bJnZQKozExCn67w1rSW7MvYyo/W7aXK7ZGLIeH7sxqwwisQlbMjhVzYcods1p+JDi1VhNQUsc4nDA0ghk9PiSY11pwAvvzds46wZLMrxlNeIs2cEdghIi+5QO68qvZHODHrtiAn3yJ7qjarx5qOx5oe2DX2duY6/7cUEnwQFNX5z4hfeCCThz9jIn316Jk/oeXQ== admin@mafyuh.io"
74
}
85

96
resource "proxmox_virtual_environment_file" "cloud_config" {
@@ -22,8 +19,8 @@ resource "proxmox_virtual_environment_file" "cloud_config" {
2219
- docker
2320
shell: /bin/bash
2421
ssh_authorized_keys:
25-
- ${trimspace(data.local_file.ssh_public_key.content)}
26-
- ${trimspace(data.local_file.ssh_public_key_2.content)}
22+
- ${trimspace(local.ssh_public_key_1)}
23+
- ${trimspace(local.ssh_public_key_2)}
2724
sudo: ALL=(ALL) NOPASSWD:ALL
2825
runcmd:
2926
- apt update
@@ -58,8 +55,8 @@ resource "proxmox_virtual_environment_file" "cloud_config2" {
5855
- docker
5956
shell: /bin/bash
6057
ssh_authorized_keys:
61-
- ${trimspace(data.local_file.ssh_public_key.content)}
62-
- ${trimspace(data.local_file.ssh_public_key_2.content)}
58+
- ${trimspace(local.ssh_public_key_1)}
59+
- ${trimspace(local.ssh_public_key_2)}
6360
sudo: ALL=(ALL) NOPASSWD:ALL
6461
runcmd:
6562
- apt update

‎terraform/kasm.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_vm" "Kasm" {
3636
# VM Disk Settings
3737
disk {
3838
datastore_id = "local-lvm"
39-
size = 150
39+
size = 151
4040
interface = "scsi0"
4141
}
4242

‎terraform/provider.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ terraform {
1919
endpoints = {
2020
s3 = var.s3_endpoint
2121
}
22+
access_key = var.aws_access_key_id
23+
secret_key = var.aws_secret_access_key
2224
}
2325
}
2426

‎terraform/secrets.tfvars

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
arrbuntu_ip_address = ""
2+
downloaders_ip_address = ""
3+
init_password = ""
4+
kasm_ip = ""
5+
kasm_ssh_ip = ""
6+
npm_ip_address = ""
7+
prox_ip_address = ""
8+
pve2_ip_address = ""
9+
s3_endpoint = ""
10+
ssh_password = ""
11+
ssh_username = ""
12+
ubu_ip_address = ""
13+
virtual_environment_api = ""
14+
virtual_environment_endpoint = ""
15+
vlan_gateway = ""

‎terraform/vars.tf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ variable "downloaders_ip_address" {
1818
type = string
1919
}
2020

21-
variable "whisper_ip_address" {
22-
type = string
23-
}
24-
2521
variable "ssh_password" {
2622
type = string
2723
}
@@ -64,4 +60,12 @@ variable "pve2_ip_address" {
6460

6561
variable "s3_endpoint" {
6662
type = string
63+
}
64+
65+
variable "aws_secret_access_key" {
66+
type = string
67+
}
68+
69+
variable "aws_access_key_id" {
70+
type = string
6771
}

0 commit comments

Comments
 (0)
Please sign in to comment.