mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-01-23 20:39:26 +00:00
14 lines
539 B
YAML
Executable File
14 lines
539 B
YAML
Executable File
- hosts: containers
|
|
name: Stop mailu
|
|
gather_facts: false
|
|
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'
|
|
owner: admin
|
|
mode: '0744'
|
|
when: inventory_hostname in groups['nas']
|