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
|
||||
- top
|
||||
|
||||
childs:
|
||||
children:
|
||||
cn=admins,ou=groups:
|
||||
cn: admins
|
||||
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,9 +25,21 @@ def tools_ldapinit():
|
|||
for rdn, attr_dict in ldap_map['parents'].items():
|
||||
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)
|
||||
|
||||
|
||||
admin_dict = {
|
||||
'cn': 'admin',
|
||||
|
|
Loading…
Reference in a new issue