Compare commits
2 commits
673449026e
...
7ddc8cc12f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ddc8cc12f | ||
|
|
a78c04d098 |
2 changed files with 658 additions and 670 deletions
1317
inventory.yml
1317
inventory.yml
File diff suppressed because it is too large
Load diff
|
|
@ -4,6 +4,7 @@ import argparse
|
||||||
import struct
|
import struct
|
||||||
import subprocess
|
import subprocess
|
||||||
import json
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
from os import environ,path
|
from os import environ,path
|
||||||
from impacket.krb5.ccache import CCache
|
from impacket.krb5.ccache import CCache
|
||||||
|
|
@ -25,7 +26,7 @@ def get_printers():
|
||||||
printers.append(printer)
|
printers.append(printer)
|
||||||
return printers
|
return printers
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
print(f"Fehler beim Abrufen der Drucker: {e}")
|
sys.stderr.write(f"Fehler beim Abrufen der Drucker: {e}")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def get_groups(username):
|
def get_groups(username):
|
||||||
|
|
@ -34,7 +35,7 @@ def get_groups(username):
|
||||||
groups = result.stdout.strip().split('\0')
|
groups = result.stdout.strip().split('\0')
|
||||||
return groups
|
return groups
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
print(f"Fehler beim Abrufen der Gruppen: {e}")
|
sys.stderr.write(f"Fehler beim Abrufen der Gruppen: {e}")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def get_krb5 ():
|
def get_krb5 ():
|
||||||
|
|
@ -50,7 +51,7 @@ def get_krb5 ():
|
||||||
krb5['endtime'] = ccache.credentials[0]['time']['endtime']
|
krb5['endtime'] = ccache.credentials[0]['time']['endtime']
|
||||||
krb5['renew_till'] = ccache.credentials[0]['time']['renew_till']
|
krb5['renew_till'] = ccache.credentials[0]['time']['renew_till']
|
||||||
except:
|
except:
|
||||||
print("Fehler beim Ticket laden")
|
sys.stderr.write("Fehler beim Ticket laden")
|
||||||
return krb5
|
return krb5
|
||||||
|
|
||||||
def get_mounts():
|
def get_mounts():
|
||||||
|
|
@ -96,7 +97,7 @@ def main():
|
||||||
nethome = f"/srv/samba/schools/default-school/teachers/{vminfo['User']}"
|
nethome = f"/srv/samba/schools/default-school/teachers/{vminfo['User']}"
|
||||||
else:
|
else:
|
||||||
result = subprocess.run(['find', '/srv/samba/schools/default-school/students/', '-name', vminfo['User'], '-maxdepth', '2', '-type', 'd'], capture_output=True, text=True, check=False)
|
result = subprocess.run(['find', '/srv/samba/schools/default-school/students/', '-name', vminfo['User'], '-maxdepth', '2', '-type', 'd'], capture_output=True, text=True, check=False)
|
||||||
nethome = result.stdout
|
nethome = result.stdout.splitlines()[0]
|
||||||
|
|
||||||
vminfo['Printers'] = get_printers()
|
vminfo['Printers'] = get_printers()
|
||||||
vminfo['krb5'] = get_krb5()
|
vminfo['krb5'] = get_krb5()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue