mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-01-24 04:49:26 +00:00
upt playbook
This commit is contained in:
parent
509a9c9633
commit
5334267773
@ -1,4 +1,4 @@
|
|||||||
- hosts: morefine
|
- hosts: raspberry
|
||||||
name: Install omv
|
name: Install omv
|
||||||
become: true
|
become: true
|
||||||
tasks:
|
tasks:
|
||||||
@ -100,3 +100,22 @@
|
|||||||
name: nslcd.service
|
name: nslcd.service
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
|
- name: Creating a file with content
|
||||||
|
copy:
|
||||||
|
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'
|
||||||
|
|
||||||
|
- name: Reconfigure sshd
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
regexp: "^#AuthorizedKeysCommand *"
|
||||||
|
line: "AuthorizedKeysCommand /usr/local/bin/fetchSSHKeysFromLDAP"
|
||||||
|
|
||||||
|
- name: Reconfigure sshd
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
regexp: "^#AuthorizedKeysCommandUser *"
|
||||||
|
line: "AuthorizedKeysCommandUser root"
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user