Verified Commit 6337181e authored by Frederik Enste's avatar Frederik Enste
Browse files

init commit (not working)

parents
.idea/
*.iml
venv/
build/
\ No newline at end of file
#!/bin/python3
import pprint
import ldap as ldaplib
from proxmoxer import ProxmoxAPI
log = pprint.PrettyPrinter(indent=4)
ldap_uri = 'ldaps://ldap.teco.edu:636'
ldap_base = 'dc=teco,dc=edu'
ldap_users = 'ou=People'
ldap_groups = 'ou=Group'
proxmox_user = 'sync@pve'
proxmox_password = 'password'
ldap = ldaplib.initialize(ldap_uri)
proxmox = ProxmoxAPI(host='192.168.122.11',
backend='https',
user=proxmox_user,
password=proxmox_password,
verify_ssl=False)
def get_ldap_users():
result = connection.search_s(ldap_base,
ldap.SCOPE_SUBTREE)
log.pprint(result)
def get_ldap_groups():
connection = ldap.initialize(ldap_uri)
result = connection.search_s(ldap_base,
ldap.SCOPE_SUBTREE)
log.pprint(result)
def get_proxmox_users():
log.pprint(proxmox.access.users.get())
log.pprint(proxmox.access.groups.get())
def main():
get_proxmox_users()
if __name__ == '__main__':
main()
# Make this match the current debian package version
python-ldap>=3.2.0
proxmoxer>=1.1.1
requests #needed for proxmoxer
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment