mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-07-01 15:38:33 +02:00
upt playbook
This commit is contained in:
10
playbooks/setup_ldap_ssh.yaml
Normal file
10
playbooks/setup_ldap_ssh.yaml
Normal file
@ -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']
|
Reference in New Issue
Block a user