summaryrefslogtreecommitdiff
path: root/roles/whawty/auth/store/tasks/sync-client.yml
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2024-01-24 00:34:32 +0100
committerChristian Pointner <equinox@spreadspace.org>2024-01-24 00:34:32 +0100
commit13804dc388ccd7e8b8344de5fbbcf52395565297 (patch)
tree3af4b74125fb01c3c125b2bf4d3c4223bac27664 /roles/whawty/auth/store/tasks/sync-client.yml
parentsshd: disable umac-64 based macs from serer mac list (diff)
whawty/auth/store role mostly done
Diffstat (limited to 'roles/whawty/auth/store/tasks/sync-client.yml')
-rw-r--r--roles/whawty/auth/store/tasks/sync-client.yml42
1 files changed, 42 insertions, 0 deletions
diff --git a/roles/whawty/auth/store/tasks/sync-client.yml b/roles/whawty/auth/store/tasks/sync-client.yml
new file mode 100644
index 00000000..106e347b
--- /dev/null
+++ b/roles/whawty/auth/store/tasks/sync-client.yml
@@ -0,0 +1,42 @@
+---
+- name: make sure sync client config directory exists
+ file:
+ path: "/etc/whawty/auth/.store-{{ whawty_auth_store.name }}-sync"
+ state: directory
+
+- name: generate ssh config for whawty-auth store sync client
+ copy:
+ content: |
+ Host whawty-auth-server
+ Hostname {{ whawty_auth_store.sync.hostname }}
+ {% if 'port' in whawty_auth_store.sync %}
+ Port {{ whawty_auth_store.sync.port }}
+ {% endif %}
+ User {{ whawty_auth_store.sync.user }}
+ IdentityFile /etc/whawty/auth/.store-{{ whawty_auth_store.name }}-sync/id_ed25519
+ IdentitiesOnly yes
+ UserKnownHostsFile /etc/whawty/auth/.store-{{ whawty_auth_store.name }}-sync/known_hosts
+ dest: "/etc/whawty/auth/.store-{{ whawty_auth_store.name }}-sync/ssh_config"
+
+- name: generate ssh keypair for sync client
+ openssh_keypair:
+ path: /etc/whawty/auth/.store-{{ whawty_auth_store.name }}-sync/id_ed25519
+ type: ed25519
+ comment: "whawty-auth-sync-{{ whawty_auth_store.name }}@{{ inventory_hostname }}"
+
+## TODO: known-hosts file...
+
+- name: install systemd units for whawty-auth store sync client
+ loop:
+ - service
+ - timer
+ template:
+ src: "systemd.{{ item }}.j2"
+ dest: "/etc/systemd/system/whawty-auth-store-sync-{{ whawty_auth_store.name }}.{{ item }}"
+
+- name: make sure whawty-auth store sync client timer is enabled and started
+ systemd:
+ daemon_reload: yes
+ name: "whawty-auth-store-sync-{{ whawty_auth_store.name }}.timer"
+ state: started
+ enabled: yes