mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
sudo_ldap_scheme.yml
This commit is contained in:
parent
79a0f93144
commit
19e730f5e3
3 changed files with 40 additions and 2 deletions
|
@ -23,7 +23,7 @@ parents:
|
||||||
- organizationalUnit
|
- organizationalUnit
|
||||||
- top
|
- top
|
||||||
|
|
||||||
childs:
|
children:
|
||||||
cn=admins,ou=groups:
|
cn=admins,ou=groups:
|
||||||
cn: admins
|
cn: admins
|
||||||
gidNumber: "4001"
|
gidNumber: "4001"
|
||||||
|
|
26
sudo_ldap_scheme.yml
Normal file
26
sudo_ldap_scheme.yml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
parents:
|
||||||
|
ou=sudo:
|
||||||
|
ou: sudo
|
||||||
|
objectClass:
|
||||||
|
- organizationalUnit
|
||||||
|
- top
|
||||||
|
children:
|
||||||
|
cn=admin,ou=sudo:
|
||||||
|
cn: admin
|
||||||
|
sudoUser: admin
|
||||||
|
sudoHost: ALL
|
||||||
|
sudoCommand: ALL
|
||||||
|
sudoOption: "!authenticate"
|
||||||
|
objectClass:
|
||||||
|
- sudoRole
|
||||||
|
- top
|
||||||
|
|
||||||
|
cn=yunohost-admin,ou=sudo:
|
||||||
|
cn: yunohost-admin
|
||||||
|
sudoUser: yunohost-admin
|
||||||
|
sudoHost: ALL
|
||||||
|
sudoCommand: /usr/bin/yunohost
|
||||||
|
sudoOption: "!authenticate"
|
||||||
|
objectClass:
|
||||||
|
- sudoRole
|
||||||
|
- top
|
|
@ -25,7 +25,19 @@ def tools_ldapinit():
|
||||||
for rdn, attr_dict in ldap_map['parents'].items():
|
for rdn, attr_dict in ldap_map['parents'].items():
|
||||||
yldap.add(rdn, attr_dict)
|
yldap.add(rdn, attr_dict)
|
||||||
|
|
||||||
for rdn, attr_dict in ldap_map['childs'].items():
|
for rdn, attr_dict in ldap_map['children'].items():
|
||||||
|
yldap.add(rdn, attr_dict)
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open('/etc/yunohost/from_script') as f: pass
|
||||||
|
except IOError:
|
||||||
|
with open('sudo_ldap_scheme.yml') as f:
|
||||||
|
ldap_map = yaml.load(f)
|
||||||
|
|
||||||
|
for rdn, attr_dict in ldap_map['parents'].items():
|
||||||
|
yldap.add(rdn, attr_dict)
|
||||||
|
|
||||||
|
for rdn, attr_dict in ldap_map['children'].items():
|
||||||
yldap.add(rdn, attr_dict)
|
yldap.add(rdn, attr_dict)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue