我正在尝试slapd
使用 Ansible 在 Ubuntu 16 机器上设置服务,debops.slapd
但无法启动并运行有效的身份验证。
我的剧本文件如下所示:
---
- hosts: "{{hosts}}"
become: true
become_user: root
roles:
- role: debops.slapd
slapd_domain: 'development.local'
slapd_pki: false
slapd_config_admin_password: 'passwords/ldap-admin.password'
slapd_basedn_admin_password: 'passwords/ldap-admin.password'
slapd_ldapscripts: true
slapd_ldap_security_default: []
slapd_anonymous_bind: true
passwords/ldap-admin.password
文件:
yoh7eQue9Ki0aitee5uquaichuteo0ti
当我通过命令行启动 Ansible 时ansible-playbook install-devserver-ubuntu.yml --ask-sudo-pass --extra-vars "hosts=ubuntu"
,安装会正确进行并slapd
正确安装在目标机器上:
PLAY [ubuntu] ************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************
ok: [ubuntu]
TASK [debops.secret : Create secret directories on Ansible Controller] ***************************************
TASK [debops.slapd : Configure domain for OpenLDAP in debconf] ***********************************************
changed: [ubuntu] => (item=slapd/domain)
changed: [ubuntu] => (item=shared/organization)
TASK [debops.slapd : Configure database backend for OpenLDAP in debconf] *************************************
changed: [ubuntu]
TASK [debops.slapd : Install OpenLDAP packages] **************************************************************
changed: [ubuntu] => (item=[u'slapd', u'ldap-utils', u'python-ldap'])
TASK [debops.slapd : Install helper scripts] *****************************************************************
ok: [ubuntu]
TASK [debops.slapd : Copy custom LDAP schema files] **********************************************************
ok: [ubuntu]
TASK [debops.slapd : Load custom LDAP schema files] **********************************************************
changed: [ubuntu] => (item=/usr/local/etc/ldap/schema/ldapns.ldif)
changed: [ubuntu] => (item=/usr/local/etc/ldap/schema/openssh-lpk.ldif)
TASK [debops.slapd : Check if administrator password hash exists] ********************************************
ok: [ubuntu -> localhost]
TASK [debops.slapd : Read hash of config administrator password] *********************************************
ok: [ubuntu]
TASK [debops.slapd : Generate config administrator password] *************************************************
skipping: [ubuntu]
TASK [debops.slapd : Save hash of config administrator password] *********************************************
skipping: [ubuntu]
TASK [debops.slapd : Set config administrator password] ******************************************************
changed: [ubuntu] => (item=(censored due to no_log))
changed: [ubuntu] => (item=(censored due to no_log))
TASK [debops.slapd : Check if BaseDN administrator password hash exists] *************************************
ok: [ubuntu -> localhost]
TASK [debops.slapd : Read hash of BaseDN administrator password] *********************************************
ok: [ubuntu]
TASK [debops.slapd : Generate BaseDN administrator password] *************************************************
skipping: [ubuntu]
TASK [debops.slapd : Save hash of BaseDN administrator password] *********************************************
skipping: [ubuntu]
TASK [debops.slapd : Set BaseDN administrator] ***************************************************************
ok: [ubuntu] => (item=(censored due to no_log))
changed: [ubuntu] => (item=(censored due to no_log))
TASK [debops.slapd : Create path to LDAP password file in secrets] *******************************************
ok: [ubuntu]
TASK [debops.slapd : Save BaseDN administrator password for Ansible] *****************************************
changed: [ubuntu -> localhost]
TASK [debops.slapd : Add OpenLDAP system user to additional groups] ******************************************
skipping: [ubuntu]
TASK [debops.slapd : Check if TLS certificate is configured] *************************************************
ok: [ubuntu]
TASK [debops.slapd : Create random temporary directory for ldif file] ****************************************
skipping: [ubuntu]
TASK [debops.slapd : Prepare temporary ldif file] ************************************************************
skipping: [ubuntu]
TASK [debops.slapd : Restart slapd (first time only)] ********************************************************
skipping: [ubuntu]
TASK [debops.slapd : Configure TLS certificates (first time only)] *******************************************
skipping: [ubuntu]
TASK [debops.slapd : Configure TLS certificates] *************************************************************
skipping: [ubuntu] => (item={'key': u'olcTLSCipherSuite', 'value': u'SECURE256:-VERS-SSL3.0'})
skipping: [ubuntu] => (item={'key': u'olcTLSCertificateFile', 'value': u'/etc/pki/system/default.crt'})
skipping: [ubuntu] => (item={'key': u'olcTLSDHParamFile', 'value': u''})
skipping: [ubuntu] => (item={'key': u'olcTLSCertificateKeyFile', 'value': u'/etc/pki/system/default.key'})
skipping: [ubuntu] => (item={'key': u'olcTLSCACertificateFile', 'value': u'/etc/pki/system/CA.crt'})
TASK [debops.slapd : Allow anonymous bind] *******************************************************************
ok: [ubuntu] => (item={'key': u'olcDisallows', 'value': u'bind_anon'})
ok: [ubuntu] => (item={'key': u'olcRequires', 'value': u'authc'})
TASK [debops.slapd : Allow anonymous bind (frontend)] ********************************************************
ok: [ubuntu] => (item={'key': u'olcRequires', 'value': u'authc'})
TASK [debops.slapd : Deny anonymous bind, require authentication] ********************************************
skipping: [ubuntu] => (item={'key': u'olcDisallows', 'value': u'bind_anon'})
skipping: [ubuntu] => (item={'key': u'olcRequires', 'value': u'authc'})
TASK [debops.slapd : Deny anonymous bind, require authentication (frontend)] *********************************
skipping: [ubuntu] => (item={'key': u'olcRequires', 'value': u'authc'})
TASK [debops.slapd : Configure LDAP connection security] *****************************************************
ok: [ubuntu]
TASK [debops.slapd : Configure LDAP indices] *****************************************************************
changed: [ubuntu]
TASK [debops.slapd : Configure LDAP Access Control List] *****************************************************
changed: [ubuntu]
TASK [debops.slapd : Set slapd log level] ********************************************************************
ok: [ubuntu] => (item={'key': u'olcLogLevel', 'value': u'none'})
TASK [debops.slapd : Configure enabled services] *************************************************************
changed: [ubuntu]
TASK [debops.slapd : Install ldapscripts packages] ***********************************************************
ok: [ubuntu] => (item=[u'ldapscripts', u'ldap-utils', u'pwgen'])
TASK [debops.slapd : Configure ldapscripts] ******************************************************************
ok: [ubuntu]
TASK [debops.slapd : Configure ldapscripts password] *********************************************************
changed: [ubuntu]
TASK [debops.slapd : Create snapshot task in cron] ***********************************************************
ok: [ubuntu]
RUNNING HANDLER [debops.slapd : Restart slapd] ***************************************************************
changed: [ubuntu]
PLAY RECAP ***************************************************************************************************
ubuntu : ok=28 changed=12 unreachable=0 failed=0
到目前为止,一切都很好,但我无法使用已设置为参数的管理员用户和管理员密码连接到 LDAP 目录。为了测试这一点,我phpldapadmin
在同一台机器上安装了一个安装:
输入密码yoh7eQue9Ki0aitee5uquaichuteo0ti
(与密码文件中的密码相同)将始终导致“凭据无效”。
运行slapcat
显示管理员账户本身已经创建:
dn: dc=development,dc=local
objectClass: top
objectClass: dcObject
objectClass: organization
o: development.local
dc: development
structuralObjectClass: organization
entryUUID: 2b111f1a-058f-1037-9bc1-01ccfd85f1f8
creatorsName: cn=admin,dc=development,dc=local
createTimestamp: 20170725141325Z
entryCSN: 20170725141325.508993Z#000000#000#000000
modifiersName: cn=admin,dc=development,dc=local
modifyTimestamp: 20170725141325Z
dn: cn=admin,dc=development,dc=local
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator
userPassword:: e1NTSEF9S1haVEUvbVQ1U0tBSEU1RXhVYVVhMDM4UGVoSS9ZNVA=
structuralObjectClass: organizationalRole
entryUUID: 2b114558-058f-1037-9bc2-01ccfd85f1f8
creatorsName: cn=admin,dc=development,dc=local
createTimestamp: 20170725141325Z
entryCSN: 20170725141325.510040Z#000000#000#000000
modifiersName: cn=admin,dc=development,dc=local
modifyTimestamp: 20170725141325Z
任何想法为什么身份验证失败?我是否使用正确的机制将密码传递给debops.slapd
?