diff --git a/main.tf b/main.tf index e4e0466..26e3e76 100644 --- a/main.tf +++ b/main.tf @@ -152,3 +152,26 @@ module "fefan" { ssh_public_key = var.ssh_public_key proxmox_host_ip = var.proxmox_host_ip } + +# module "keycloak" { + # source = "./modules/apps/keycloak" + # providers = {} + # vm_ip_address = "192.168.1.93" + # depends_on = [] + + # name = "keycloak" + # hostname = "keycloak" + # domain = "aldon.fr" + # vm_id = 214 + # node_name = "mop" + + # template_id = 103 + + # cores = 1 + # memory = 2048 + # balloon = 1024 + # disk_size = 16 + + # ssh_public_key = var.ssh_public_key + # proxmox_host_ip = var.proxmox_host_ip +# } \ No newline at end of file diff --git a/modules/apps/bookshelf/.env.example b/modules/apps/bookshelf/.env.example index b96b5cd..d29c5de 100644 --- a/modules/apps/bookshelf/.env.example +++ b/modules/apps/bookshelf/.env.example @@ -6,6 +6,7 @@ ACT_RUNNER_VERSION=0.2.13 ACT_RUNNER_LOCATION=/usr/local/bin ACT_RUNNER_USER=act_runner GITEA_RUNNER_REGISTRATION_TOKEN= +USERNAME=bookshelf # gitea instance GITEA_INSTANCE_URL=https://gitea.aldon.fr @@ -23,9 +24,6 @@ SERVICE_ORIGIN=https://bookshelf.aldon.fr SERVICE_ROOT_FQDN=https://bookshelf.aldon.fr/api SERVICE_DATABASE_CONTAINER_NAME=bookshelf-database -# VM -USERNAME=bookshelf - # Backup specifics SERVICE_BACKUPS_DIR=/backups/bookshelf SERVICE_BACKUPS_PREFIX=bookshelf-dump diff --git a/modules/apps/bookshelf/cloud-init/service.yaml b/modules/apps/bookshelf/cloud-init/service.yaml index 073673c..8429efa 100644 --- a/modules/apps/bookshelf/cloud-init/service.yaml +++ b/modules/apps/bookshelf/cloud-init/service.yaml @@ -58,11 +58,11 @@ write_files: permissions: "0644" content: | ${act_runner-service} - - path: /opt/bookshelf/install-runner.sh + - path: /opt/${hostname}/install-runner.sh permissions: "0755" content: | ${act_runner-install-script} - - path: /opt/bookshelf/install-service.sh + - path: /opt/${hostname}/install-service.sh permissions: "0755" content: | ${service-install-script} @@ -77,12 +77,12 @@ runcmd: - systemctl start docker - usermod -aG docker ${hostname} # Act_runner install - - /opt/bookshelf/install-runner.sh + - /opt/${hostname}/install-runner.sh - systemctl daemon-reload - systemctl enable act_runner.service - systemctl start act_runner.service - # Bookshelf install - - /opt/bookshelf/install-service.sh + # ${hostname} install + - /opt/${hostname}/install-service.sh final_message: | diff --git a/modules/apps/bookshelf/main.tf b/modules/apps/bookshelf/main.tf index 9691909..e1a7203 100644 --- a/modules/apps/bookshelf/main.tf +++ b/modules/apps/bookshelf/main.tf @@ -15,7 +15,7 @@ module "vm" { ssh_public_key = var.ssh_public_key proxmox_host_ip = var.proxmox_host_ip - + cloudinit_config = templatefile( "${path.module}/cloud-init/service.yaml", { diff --git a/modules/apps/fefan/.env.example b/modules/apps/fefan/.env.example index b9a2b47..efbae23 100644 --- a/modules/apps/fefan/.env.example +++ b/modules/apps/fefan/.env.example @@ -6,6 +6,7 @@ ACT_RUNNER_VERSION=0.2.13 ACT_RUNNER_LOCATION=/usr/local/bin ACT_RUNNER_USER=act_runner GITEA_RUNNER_REGISTRATION_TOKEN= +USERNAME=fefan # Gitea instance GITEA_INSTANCE_URL=https://gitea.aldon.fr @@ -26,9 +27,6 @@ STRAPI_TRANSFER_TOKEN_SALT= STRAPI_JWT_SECRET= SERVICE_DATABASE_CONTAINER_NAME=fefan-db -# VM -USERNAME=fefan - # Backup specifics SERVICE_BACKUPS_DIR=/backups/fefan SERVICE_BACKUPS_PREFIX=fefan-dump diff --git a/modules/apps/fefan/cloud-init/service.yaml b/modules/apps/fefan/cloud-init/service.yaml index bacb0eb..8429efa 100644 --- a/modules/apps/fefan/cloud-init/service.yaml +++ b/modules/apps/fefan/cloud-init/service.yaml @@ -58,11 +58,11 @@ write_files: permissions: "0644" content: | ${act_runner-service} - - path: /opt/fefan/install-runner.sh + - path: /opt/${hostname}/install-runner.sh permissions: "0755" content: | ${act_runner-install-script} - - path: /opt/fefan/install-fefan.sh + - path: /opt/${hostname}/install-service.sh permissions: "0755" content: | ${service-install-script} @@ -77,12 +77,13 @@ runcmd: - systemctl start docker - usermod -aG docker ${hostname} # Act_runner install - - /opt/fefan/install-runner.sh + - /opt/${hostname}/install-runner.sh - systemctl daemon-reload - systemctl enable act_runner.service - systemctl start act_runner.service - # Install fefan - - /opt/fefan/install-fefan.sh + # ${hostname} install + - /opt/${hostname}/install-service.sh + final_message: | Base system ready for ${hostname} \ No newline at end of file diff --git a/templates/traefik.services.tpl b/templates/traefik.services.tpl index 2b10a7d..8529a63 100644 --- a/templates/traefik.services.tpl +++ b/templates/traefik.services.tpl @@ -21,6 +21,23 @@ http: - redirect-errors %{~ endfor } %{~ endfor } + aldon-http: + rule: "Host(`aldon.fr`)" + entryPoints: + - web + middlewares: + - redirect-to-aldon + service: noop + aldon: + rule: "Host(`aldon.fr`)" + entryPoints: + - websecure + service: noop + tls: + certResolver: letsencrypt + middlewares: + - redirect-to-aldon + - redirect-errors nextcloud: rule: "Host(`nextcloud.aldon.fr`)" entryPoints: @@ -114,6 +131,11 @@ http: servers: - url: "http://127.0.0.1:8090" middlewares: + redirect-to-aldon: + redirectRegex: + regex: "^https?://aldon.fr/(.*)" + replacement: "https://julien.aldon.fr/$1" + permanent: true redirect-to-https: redirectScheme: scheme: https