From 3a11af25bdef4456d0483a26a731b209487375ea Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 28 Aug 2023 13:47:48 +0200 Subject: [PATCH] upt playbook --- playbooks/setup_ldap_ssh.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 playbooks/setup_ldap_ssh.yaml diff --git a/playbooks/setup_ldap_ssh.yaml b/playbooks/setup_ldap_ssh.yaml new file mode 100644 index 0000000..8c3139d --- /dev/null +++ b/playbooks/setup_ldap_ssh.yaml @@ -0,0 +1,10 @@ +- hosts: containers + name: Stop mailu + tasks: + - name: Creating script to fetch ldap info + ansible.builtin.copy: + dest: "/usr/local/bin/fetchSSHKeysFromLDAP" + content: | + #!/bin/bash + ldapsearch -b "dc=sectorq,dc=eu" -H ldap://192.168.77.106:389 -x '(&(objectClass=ldapPublicKey)(cn='"$1"'))' 'sshPublicKey' | sed -n '/^ /{H;d};/sshPublicKey:/x;$g;s/\n *//g;s/sshPublicKey: //gp' + when: inventory_hostname in groups['nas']