2023-08-28 13:47:48 +02:00
|
|
|
- hosts: containers
|
|
|
|
name: Stop mailu
|
2023-08-28 13:56:40 +02:00
|
|
|
gather_facts: false
|
2023-08-28 13:47:48 +02:00
|
|
|
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'
|
2023-08-28 13:54:38 +02:00
|
|
|
owner: admin
|
|
|
|
mode: '0744'
|
2023-08-28 13:53:09 +02:00
|
|
|
when: inventory_hostname in groups['nas']
|