bitwarden

This commit is contained in:
jaydee
2024-12-11 23:10:40 +01:00
parent 43dc4a8009
commit 44822bd37b
7 changed files with 91 additions and 146 deletions

View File

@ -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