Initial Commit

This commit is contained in:
ansible user
2025-11-24 21:44:03 +00:00
commit a1d27055c7
6 changed files with 164 additions and 0 deletions

60
ldap_unix.yml Normal file
View File

@@ -0,0 +1,60 @@
- hosts: proxmox_all_lxc
remote_user: root
tasks:
- name: Install sssd
package:
name:
- sssd
- sssd-tools
- libnss-sss
- libpam-sss
- libsss-sudo
- sudo
state: latest
- name: Create sssd.conf
copy:
src: /home/ansible/playbooks/contents/sssd.conf
dest: /etc/sssd/sssd.conf
mode: '0600'
owner: root
group: root
- name: Start sssd
service:
name: sssd
state: restarted
- name: Update PAM
shell:
cmd: pam-auth-update --enable mkhomedir
- name: Create sudoers file
file:
path: /etc/sudoers.d/unix_admin
state: touch
mode: '0440'
- name: Add unix_admin to sudoers
community.general.sudoers:
name: unix_admin
state: present
group: unix_admin
commands: ALL
- name: Edit sshd_config - AuthorizedKeysCommand
lineinfile:
path: /etc/ssh/sshd_config
search_string: 'AuthorizedKeysCommand'
line: AuthorizedKeysCommand /usr/bin/sss_ssh_authorizedkeys
- name: Edit sshd_config - AuthorizedKeysCommand
lineinfile:
path: /etc/ssh/sshd_config
search_string: 'AuthorizedKeysCommandUser'
line: AuthorizedKeysCommandUser nobody
- name: Restart ssh
service:
name: ssh
state: restarted