mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-07-01 15:38:33 +02:00
bitwarden
This commit is contained in:
@ -76,7 +76,7 @@
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/nslcd.conf
|
||||
regexp: "^binddn"
|
||||
line: "binddn cn=jaydee,dc=users,dc=sectorq,dc=eu"
|
||||
line: "binddn cn=ldapservice,ou=users,dc=sectorq,dc=eu"
|
||||
|
||||
- name: Reconfigure nslcd bindpw
|
||||
ansible.builtin.lineinfile:
|
||||
@ -103,8 +103,10 @@
|
||||
dest: "/usr/local/bin/fetchSSHKeysFromLDAP"
|
||||
content: |
|
||||
#!/usr/bin/bash
|
||||
ldapsearch -x '(&(objectClass=ldapPublicKey)(cn='"$1"'))' 'sshPublicKey' | sed -n '/^ /{H;d};/sshPublicKey:/x;$g;s/\n *//g;s/sshPublicKey: //gp'
|
||||
mode: '0755'
|
||||
ldapsearch -x -H ldap://192.168.77.101:2389 -D 'cn=ldapservice,ou=users,DC=sectorq,DC=eu' -w {{ ldap_admin_password }} '(&(objectClass=person)(cn='"$1"'))' 'sshPublicKey' | sed -n '/^ /{H;d};/sshPublicKey:/x;$g;s/\n *//g;s/sshPublicKey: //gp'
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0700'
|
||||
- name: Reconfigure sshd
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
@ -144,6 +146,6 @@
|
||||
|
||||
- name: Restart sshd service
|
||||
ansible.builtin.service:
|
||||
name: sshd.service
|
||||
name: ssh
|
||||
state: restarted
|
||||
become: true
|
Reference in New Issue
Block a user