]> xn--ix-yja.es Git - alex.git/commitdiff
Allow multiple clusters
authoralex <alex@pdp7.net>
Mon, 20 Feb 2023 22:40:21 +0000 (23:40 +0100)
committeralex <alex@pdp7.net>
Mon, 20 Feb 2023 22:40:21 +0000 (23:40 +0100)
personal_infra/playbooks/roles/talos/README.md
personal_infra/playbooks/roles/talos/tasks/main.yaml

index ec364022a7ff92152b6f728bd504287e1278af9a..6c45f9979cdea155b3f1b63f9540d9d676f792fd 100644 (file)
@@ -1,4 +1,4 @@
 ```
-$ talosctl gen secrets -o talos/secrets.yaml
-$ ansible-vault encrypt talos/secrets.yaml
+$ talosctl gen secrets -o talos/$cluster-secrets.yaml
+$ ansible-vault encrypt talos/$cluster-secrets.yaml
 ```
index 92d54b3880967094c202cd1a6e40853e12b14b87..672061bc65afc56d9fb08144aad8c4e539adf921 100644 (file)
@@ -38,7 +38,7 @@
 
 - name: generate controlplane config
   shell:
-    cmd: talosctl gen config -t controlplane -o talos/host-{{ inventory_hostname }}.yaml --with-secrets <(ansible-vault view talos/secrets.yaml) --config-patch-control-plane @talos/host-{{ inventory_hostname }}.patch {{ talos_host.talos_cluster }} {{ talos_clusters[talos_host.talos_cluster].endpoint }}
+    cmd: talosctl gen config -t controlplane -o talos/host-{{ inventory_hostname }}.yaml --with-secrets <(ansible-vault view talos/{{ talos_host.talos_cluster }}-secrets.yaml) --config-patch-control-plane @talos/host-{{ inventory_hostname }}.patch {{ talos_host.talos_cluster }} {{ talos_clusters[talos_host.talos_cluster].endpoint }}
     chdir: "{{ inventory_dir }}"
   delegate_to: 127.0.0.1
   when: "not 'resources' in nodes or nodes.resources|length == 0"
@@ -52,7 +52,7 @@
 
 - name: generate talosconfig
   shell:
-    cmd: talosctl gen config -t talosconfig -o talos/talosconfig-{{ talos_host.talos_cluster }} --with-secrets <(ansible-vault view talos/secrets.yaml) {{ talos_host.talos_cluster }} {{ talos_clusters[talos_host.talos_cluster].endpoint }}
+    cmd: talosctl gen config -t talosconfig -o talos/talosconfig-{{ talos_host.talos_cluster }} --with-secrets <(ansible-vault view talos/{{ talos_host.talos_cluster }}-secrets.yaml) {{ talos_host.talos_cluster }} {{ talos_clusters[talos_host.talos_cluster].endpoint }}
     chdir: "{{ inventory_dir }}"
   delegate_to: 127.0.0.1
   when: "not 'resources' in nodes or nodes.resources|length == 0"