]> xn--ix-yja.es Git - alex.git/commitdiff
Migrate Takahe to k8s-prod, femto.pub domain
authoralex <alex@pdp7.net>
Sat, 23 Mar 2024 09:50:46 +0000 (10:50 +0100)
committeralex <alex@pdp7.net>
Sat, 23 Mar 2024 09:51:02 +0000 (10:51 +0100)
personal_infra/playbooks/roles/takahe/tasks/main.yaml
personal_infra/playbooks/site.yaml
personal_infra/puppet/site/h1.pdp7.net.pp
personal_infra/puppet/site/pg.h1.int.pdp7.net.pp

index ce3767eafbff970249f605c39d925815b7613741..091d00f0af344c20d1493a24933f923560aeda67 100644 (file)
@@ -1,4 +1,29 @@
 ---
+# extra setup:
+#
+# - create the postgres database
+# - s3 bucket?
+- name: create CNAMEs
+  local_action:
+    module: amazon.aws.route53
+    zone: "{{ takahe.dns_zone }}"
+    record: "{{ item }}"
+    type: CNAME
+    value: "{{ takahe.cnames.target }}"
+    wait: true
+    state: present
+  tags: dns
+  loop: "{{ takahe.cnames.domains }}"
+- name: create main domain
+  local_action:
+    module: amazon.aws.route53
+    zone: "{{ takahe.dns_zone }}"
+    record: "{{ takahe.main_domain.name }}"
+    type: "{{ takahe.main_domain.dns_record_type }}"
+    value: "{{ takahe.main_domain.target }}"
+    wait: true
+    state: present
+  tags: dns
 - k8s:
     context: "{{ context }}"
     state: present
         PGHOST: "{{ takahe.database_host }}"
         PGUSER: "{{ takahe.database_user }}"
         PGDATABASE: "{{ takahe.database }}"
-        TAKAHE_MAIN_DOMAIN: "{{ takahe.main_domain }}"
+        TAKAHE_MAIN_DOMAIN: "{{ takahe.main_domain.name }}"
         TAKAHE_EMAIL_FROM: "{{ takahe.email_from }}"
         TAKAHE_USE_PROXY_HEADERS: "true"
         TAKAHE_AUTO_ADMIN_EMAIL: "{{ takahe.admin_email }}"
-        TAKAHE_CSRF_HOSTS: "{{ ['https://' + takahe.main_domain] | to_json }}"
+        TAKAHE_CSRF_HOSTS: "{{ ['https://femto.pub', 'https://alex.femto.pub'] | to_json }}"
         TAKAHE_ERROR_EMAILS: "{{ [takahe.admin_email] | to_json }}"
   delegate_to: 127.0.0.1
 - k8s:
         namespace: "{{ takahe.namespace }}"
       spec:
         rules:
-          - host: "{{ takahe.main_domain }}"
+          - host: "{{ takahe.main_domain.name }}"
             http:
               paths:
                 - path: /
                       name: webserver
                       port:
                         name: web
-          - host: "*.example.com"
+          - host: "*.femto.pub"
             http:
               paths:
                 - path: /
index 274af8ef86279a96191489041777b251a136e130..670a8c777d49c595d0ed9a357d761fd0d89ee07c 100644 (file)
@@ -63,7 +63,7 @@
         definition: "{{ weight }}"
 
 - name: deploy takahe
-  hosts: k8s-test.h1.int.pdp7.net
+  hosts: k8s-prod.h1.int.pdp7.net
   tags:
     - k8s
     - takahe
index 5198976d374767ed3d99ab321624ea318cfb2ad7..f603bfe3ad8251e1163128667c9e25268d3f5e64 100644 (file)
@@ -72,11 +72,15 @@ node 'h1.pdp7.net' {
     target => 'http://grafana.h1.int.pdp7.net:3000/',
   }
 
-  proxmox::proxy_host {'takahe.pdp7.net':
-    target => 'http://k8s-test.h1.int.pdp7.net/',
+  proxmox::proxy_host {'femto.pub':
+    target => 'http://k8s-prod.h1.int.pdp7.net/',
   }
 
-  proxmox::proxy_host {'takahe-media.pdp7.net':
+  proxmox::proxy_host {'alex.femto.pub':
+    target => 'http://k8s-prod.h1.int.pdp7.net/',
+  }
+
+  proxmox::proxy_host {'media.femto.pub':
     target => 'http://weed.h1.int.pdp7.net:8333/',
   }
 
index 7256501ef84ccc3f20f403c602ac0e8bcdc3daf5..a71d88dc04617baca2af30e415156aba9a85b8f8 100644 (file)
@@ -9,7 +9,7 @@ node 'pg.h1.int.pdp7.net' {
       host    weight          nagios          nagios.h1.int.pdp7.net    trust
       host    miniflux        miniflux        miniflux.h1.int.pdp7.net  trust
       host    nextcloud       nextcloud       nextcloud.h1.int.pdp7.net trust
-      host    takahe          k8s_test        k8s-test.h1.int.pdp7.net  trust
+      host    takahe          k8s_prod        k8s-prod.h1.int.pdp7.net  trust
       | EOT
     ,
   }