Implement lmn-sssd and lmn-mount roles.

This commit is contained in:
Andreas B. Mundt 2023-01-18 19:32:43 +01:00
parent f88626ec7e
commit db054949a5
6 changed files with 78 additions and 16 deletions

View file

@ -4,7 +4,17 @@
hosts: all hosts: all
remote_user: ansible remote_user: ansible
become: yes become: yes
pre_tasks:
- pause:
prompt: "Enter global-admin active directory password to join domain:"
minutes: 5
echo: false
register: adpw
no_log: true
when: "ansible_cmdline.adpw is not defined"
vars: vars:
domain: "pn.steinbeis.schule"
extra_pkgs: extra_pkgs:
- webext-privacy-badger - webext-privacy-badger
- webext-ublock-origin - webext-ublock-origin
@ -35,6 +45,7 @@
- console-setup - console-setup
- virt-manager - virt-manager
- libreoffice-l10n-de - libreoffice-l10n-de
- krb5-user
extra_pkgs_bpo: [ libreoffice ] # [ linux-image-amd64 ] # [ libreoffice ] extra_pkgs_bpo: [ libreoffice ] # [ linux-image-amd64 ] # [ libreoffice ]
ansible_python_interpreter: "/usr/bin/python3" ansible_python_interpreter: "/usr/bin/python3"
@ -43,8 +54,8 @@
#- gnome #- gnome
- kde - kde
- up2date_debian - up2date_debian
# - fvs-sssd - lmn-sssd
# - fvs-mount - lmn-mount
# - fvs-client # - fvs-client
tasks: tasks:
@ -56,17 +67,3 @@
shell: /bin/bash shell: /bin/bash
groups: libvirt groups: libvirt
append: yes append: yes
- name: add lmn key
ansible.builtin.apt_key:
url: https://deb.linuxmuster.net/pub.gpg
keyring: /etc/apt/trusted.gpg.d/linuxmuster.net.gpg
- name: add lmn repo
apt_repository:
repo: deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/linuxmuster.net.gpg] http://deb.linuxmuster.net/ lmn71 main
state: present
update_cache: true
- name: install
apt:
name: linuxmuster-linuxclient7
state: latest

View file

@ -0,0 +1,2 @@
smb_server: "server"
smb_home: "default-school/teachers/%(DOMAIN_USER)"

View file

@ -0,0 +1,20 @@
---
- name: install needed packages
apt:
name:
- libpam-mount
- cifs-utils
state: latest
- name: configure pam_mount
blockinfile:
dest: /etc/security/pam_mount.conf.xml
block: |
<volume
fstype="cifs"
server="{{ smb_server }}"
path="{{ smb_home }}"
mountpoint="/home/%(DOMAIN_USER)"
options="sec=krb5i,vers=3.0,cruid=%(USERUID),user=%(USER)"
><not><or><user>root</user><user>ansible</user><user>Debian-gdm</user><user>sddm</user><user>virti</user></or></not></volume>
insertafter: "<!-- Volume definitions -->"

View file

@ -0,0 +1,3 @@
- name: restart sssd
service: name=sssd state=restarted enabled=yes
listen: "restart sssd"

View file

@ -0,0 +1,21 @@
---
- name: install needed packages
apt:
name:
- sssd-ad
- sssd-tools
- adcli
state: latest
- name: provide identities from directory
template:
src: sssd.conf.j2
dest: /etc/sssd/sssd.conf
mode: 0600
notify: restart sssd
## Either one of the variables is defined:
- name: join the domain
shell:
cmd: echo "{{ ansible_cmdline.adpw | default('') + adpw.user_input | default('') }}" | adcli join --stdin-password -U global-admin {{ domain | upper }}
when: ansible_cmdline.adpw | default('') | length > 0 or adpw.user_input | default('') | length > 0

View file

@ -0,0 +1,19 @@
[sssd]
domains = {{ domain }}
config_file_version = 2
[domain/{{ domain }}]
default_shell = /bin/bash
cache_credentials = True
krb5_store_password_if_offline = True
cache_credentials = True
krb5_realm = {{ domain | upper }}
id_provider = ad
override_homedir = /home/%u
ad_domain = {{ domain }}
use_fully_qualified_names = False
ldap_id_mapping = True
access_provider = ad
ad_gpo_access_control = permissive
ad_gpo_ignore_unreadable = True
ad_maximum_machine_account_password_age = 0