Compare commits

...

24 Commits

Author SHA1 Message Date
e785930578 chore: update terraform outputs 2026-05-22 20:55:25 +00:00
CC
92f9bd459d ci/cd ansible rsync
All checks were successful
Deploy VM and App / terraform-ansible-deploy (push) Successful in 1m20s
2026-05-22 21:54:02 +01:00
CC
8518bd6064 ci/cd vlans_rsa ansible
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 1m31s
2026-05-21 17:56:04 +01:00
CC
3c7a22032a ci/cd ssh ansible
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 1m23s
2026-05-21 17:51:16 +01:00
CC
a363aafd97 ci/cd abs path
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 1m29s
2026-05-21 17:42:31 +01:00
CC
e40fb6742a ci/cd abs path
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 35s
2026-05-21 17:40:30 +01:00
CC
da2362d0a9 ci/cd abs path
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 8s
2026-05-21 17:38:55 +01:00
CC
684a86385b ci/cd abs path
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 9s
2026-05-21 17:36:27 +01:00
CC
eded1b9777 ci/cd abs path
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 7s
2026-05-21 17:34:28 +01:00
CC
80c611ecda ci/cd file
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 1m19s
2026-05-21 17:25:43 +01:00
CC
2d27326cbc ci/cd file
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 3s
2026-05-21 17:25:18 +01:00
CC
325d61bef0 ci/cd file
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 4s
2026-05-21 17:24:32 +01:00
CC
4bff0f9703 ci/cd file 2026-05-21 17:20:57 +01:00
2f505e5062 chore: update terraform outputs 2026-05-21 16:16:06 +00:00
CC
d73dd0919d ci/cd
All checks were successful
Deploy VM and App / terraform-ansible-deploy (push) Successful in 1m22s
2026-05-21 17:14:32 +01:00
CC
ba593526bd ci/cd
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 1m32s
2026-05-21 17:11:34 +01:00
CC
adc4188918 ci/cd
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 1m21s
2026-05-21 17:08:44 +01:00
CC
5e4d5c82d8 ci/cd on push test
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 1m31s
2026-05-21 17:03:36 +01:00
CC
31cc759d4d ci/cd on push test
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 3m35s
2026-05-21 16:56:35 +01:00
CC
afbd95d765 ci/cd on push test
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Has been cancelled
2026-05-21 16:54:23 +01:00
CC
ae70feaaf3 ci/cd on push
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 5s
2026-05-21 16:52:36 +01:00
CC
d68ab4b309 ci/cd clone
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Has been cancelled
2026-05-21 16:51:06 +01:00
CC
1cb81833d7 ci/cd clone testing 2026-05-21 16:49:45 +01:00
CC
bf11724516 ci/cd clone testing 2026-05-21 16:46:34 +01:00
8 changed files with 46 additions and 33 deletions

View File

@@ -1,6 +1,8 @@
name: Deploy VM and App
on:
push:
workflow_dispatch:
inputs:
tfvars_file:
@@ -21,11 +23,11 @@ jobs:
- name: Check files & Select tfvars
shell: bash
run: |
pwd
#rm ansible/inventory/inventory.yml
mkdir -p ansible/inventory
cd terraform
cp ${{ inputs.tfvars_file }} terraform.tfvars
ls
#rm vm_data.yml
cp "${{ inputs.tfvars_file || 'single.tfvars.example' }}" terraform.tfvars
- uses: hashicorp/setup-terraform@v4
@@ -40,6 +42,27 @@ jobs:
run: terraform apply -auto-approve
working-directory: "terraform"
- name: Install Ansible
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y ansible rsync
- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/vlans_rsa
chmod 600 ~/.ssh/vlans_rsa
cat > ~/.ssh/config <<'EOF'
Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
EOF
- name: Run playbook
run: |
ansible-playbook ansible/playbooks/docker_copy.yml -i ansible/inventory/inventory.yml -u cloud --private-key ~/.ssh/vlans_rsa
- name: Configure Git
run: |
git config user.name "git-bot"
@@ -53,26 +76,3 @@ jobs:
git push origin HEAD:main
env:
GITEA_USERNAME: git-bot # or your bot account
- name: Install Ansible
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y ansible
- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo -e "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile=/dev/null\n" > ~/.ssh/config
- name: Setup Ansible Directories
run: |
pwd
cat ansible/inventory/inventory.yml
ls -r
- name: Run playbook
run: |
ansible-playbook ansible/playbooks/docker_copy.yml -i ansible/inventory/inventory.yml -u cloud --private-key ~/.ssh/id_rsa

View File

@@ -3,6 +3,6 @@
"n8n":
"hosts":
"n8n-01":
"ansible_host": "192.168.10.117"
"ansible_host": "192.168.10.107"
"vars":
"ansible_user": "cloud"

View File

@@ -40,12 +40,12 @@ module "vm-n8n" {
module "inventory" {
source = "./modules/proxmox_ansible_inventory"
filename = "${path.root}/ansible/inventory/inventory.yml"
filename = "${abspath("${path.root}/..")}/ansible/inventory/inventory.yml"
instances = local.vm_created
}
module "vm_data" {
source = "./modules/proxmox_vm_data"
filename = "${path.root}/terraform/vm_data.yml"
filename = "${abspath("${path.root}/..")}/terraform/vm_data.yml"
instances = local.vm_created
}

View File

@@ -57,7 +57,7 @@ resource "proxmox_virtual_environment_file" "cloud_config" {
}
}
resource "proxmox_virtual_environment_vm" "ubuntu_22_minimal_template" {
resource "proxmox_virtual_environment_vm" "ubuntu_22_minimal_clone" {
name = var.vm_name # VM name
node_name = var.node_name # Proxmox node to deploy the VM
tags = var.vm_tags # Optional VM tags for categorization

View File

@@ -1,3 +1,3 @@
output "vm_ipv4_address" {
value = proxmox_virtual_environment_vm.ubuntu_vm.ipv4_addresses[1][0]
value = proxmox_virtual_environment_vm.ubuntu_22_minimal_clone.ipv4_addresses[1][0]
}

View File

@@ -0,0 +1,13 @@
terraform {
required_providers {
proxmox = {
source = "bpg/proxmox"
version = "0.106.0"
#url = https://registry.terraform.io/providers/bpg/proxmox/latest/docs/guides/clone-vm
}
aws = {
source = "hashicorp/aws"
version = "6.38.0"
}
}
}

View File

@@ -16,7 +16,7 @@ variable "instance_configs" {
default = [
{ crispy_name = "snap", vmid = "9002" },
{ crispy_name = "crackle", vmid = "9000" },
{ crispy_name = "pop", vmid = "9001" }
{ crispy_name = "pop", vmid = "900" }
]
}

View File

@@ -6,5 +6,5 @@
- "terraform"
- "docker"
- "n8n"
- "ip-192-168-10-117"
- "ip-192-168-10-107"
"vm_name": "n8n-01"