代码之家  ›  专栏  ›  技术社区  ›  aneela

LDAP父项不存在:Openstack OIDC

  •  0
  • aneela  · 技术社区  · 2 年前

    我是openstack和OIDC的新手,为我的实例创建了一个虚拟的OIDC发行者,但是在 Ensuring ou for users (我正在跟踪一个 official guide )我有个例外。

    我的yml文件是

    - name: Ensure ou for users
      community.general.ldap_entry:
        dn: ou=people,dc=springframework,dc=org
        objectClass:
          - top
          - organizationalUnit
        bind_dn: cn=Directory\ Manager
        bind_pw: "{{ kypo_crp_oidc_local_provider_ldap_root_password }}"
        server_uri: ldaps://localhost:1636
        validate_certs: False
      register: ldap_entry
      until: ldap_entry is not failed
      retries: 30
      delay: 5
    

    我有个例外说 parent entry doesnot exist in server

    FAILED - RETRYING: Ensure ou for users (3 retries left).
    FAILED - RETRYING: Ensure ou for users (2 retries left).
    FAILED - RETRYING: Ensure ou for users (1 retries left).
    An exception occurred during task execution. To see the full traceback, use -vvv. The error was: 
    ldap.NO_SUCH_OBJECT: {'msgtype': 105, 'msgid': 3, 'result': 32, 'desc': 'No such object', 'ctrls': [], 'info': 'Entry ou=people,dc=springframework,dc=org cannot be added because its parent entry dc=springframework,dc=org does not exist in the server'}
    fatal: [kypo]: FAILED! => {"attempts": 30, "changed": false, "details": "{'msgtype': 105, 'msgid': 3, 'result': 32, 'desc': 'No such object', 'ctrls': [], 'info': 'Entry ou=people,dc=springframework,dc=org cannot be added because its parent entry dc=springframework,dc=org does not exist in the server'}", "msg": "Entry action failed."}
    
    0 回复  |  直到 2 年前
        1
  •  0
  •   Hamza Tahiri    2 年前

    在你的ldaps://localhost:1636ldap服务器,您需要创建基本搜索dn,您可以将yml文件更改为:

    - name: pre-Ensure ou for users
      community.general.ldap_entry:
      dn: dc=springframework,dc=org
      objectClass:
      - top
      - organizationalUnit
    bind_dn: cn=Directory\ Manager
    bind_pw: "{{ kypo_crp_oidc_local_provider_ldap_root_password }}"
    server_uri: ldaps://localhost:1636
    validate_certs: False
    register: ldap_entry
    until: ldap_entry is not failed
    retries: 30
    delay: 5
    
    - name: Ensure ou for users
    community.general.ldap_entry:
    dn: ou=people,dc=springframework,dc=org
    objectClass:
      - top
      - organizationalUnit
    bind_dn: cn=Directory\ Manager
    bind_pw: "{{ kypo_crp_oidc_local_provider_ldap_root_password }}"
    server_uri: ldaps://localhost:1636
    validate_certs: False
    register: ldap_entry
    until: ldap_entry is not failed
    retries: 30
    delay: 5
    

    另一种解决方案是使用ldapadd或ldapmodify命令直接在ldap中创建基本条目: 您的输入ldif:

     dn: dc=springframework,dc=org
     changetype: add
     objectClass: top
     
    

    然后:

    ldapmodify -a -x -D "cn=Directory Manager" -w password -H ldap://lcoalhost -f file.ldif