# LDAP setup??

**URL:** <https://forum.ansible.com/t/ldap-setup/36704>\
**Category:** Ansible Project\
**Created:** [June 9, 2022, 4:57am UTC](https://forum.ansible.com/t/ldap-setup/36704 "2022-06-09T04:57:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shivakumar\_Venkatasw](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Shivakumar\_Venkatasw](https://forum.ansible.com/u/Shivakumar_Venkatasw)\
**Post date:** [June 9, 2022, 4:57am UTC](https://forum.ansible.com/t/ldap-setup/36704/1 "2022-06-09T04:57:12Z")

</div>

Hi all,  
Any one can share the playbook for which are details mentioned below.

Step1: yum -y install openldap-clients nss-pam-ldapd  
Step2: Execute below command

authconfig --enableldap   
–enableldapauth   
–ldapserver=[pdc.example.com](http://pdc.example.com)   
–ldapbasedn=“dc=example,dc=com”   
–enablemkhomedir   
–update

Step3: authconfig --enableforcelegacy --update

I’m touble to write a playbook for command with entries. please help me out.

Regards,  
shivu

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [June 9, 2022, 6:30am UTC](https://forum.ansible.com/t/ldap-setup/36704/2 "2022-06-09T06:30:52Z")

</div>

What kind of trouble do you have?  
What does your playbook look like?

---

<div class="post-metadata">

**Author:** ![Shivakumar\_Venkatasw](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Shivakumar\_Venkatasw](https://forum.ansible.com/u/Shivakumar_Venkatasw)\
**Post date:** [June 9, 2022, 9:01am UTC](https://forum.ansible.com/t/ldap-setup/36704/3 "2022-06-09T09:01:12Z")

</div>

my play book look like this

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [June 9, 2022, 11:53am UTC](https://forum.ansible.com/t/ldap-setup/36704/4 "2022-06-09T11:53:49Z")

</div>

Thx much appreciated.  
But what is the error you are referring to?

---

<div class="post-metadata">

**Author:** ![Shivakumar\_Venkatasw](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Shivakumar\_Venkatasw](https://forum.ansible.com/u/Shivakumar_Venkatasw)\
**Post date:** [June 10, 2022, 4:48am UTC](https://forum.ansible.com/t/ldap-setup/36704/5 "2022-06-10T04:48:19Z")

</div>

Hi…  
I’m facing this kind issue while running this playbook.

PLAYBOOK: LDAP.yml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
1 plays in LDAP.yml

PLAY [172.16.13.244] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*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\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /var/lib/awx/projects/playbook/LDAP.yml:6  
ok: [172.16.13.244] =\> {“changed”: false, “msg”: “”, “rc”: 0, “results”: [“openldap-clients-2.4.44-25.el7\_9.x86\_64 providing openldap-clients is already installed”, “nss-pam-ldapd-0.8.13-25.el7.x86\_64 providing nss-pam-ldapd is already installed”]}

TASK [join a node to an LDAP server] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /var/lib/awx/projects/playbook/LDAP.yml:11  
fatal: [172.16.13.244]: FAILED! =\> {“changed”: true, “cmd”: “authconfig --enableldap --enableldapauth --ldapserver="pdc.medgenome.com" --ldapbasedn="dc=medgenome,dc=com" --enablemkhomedir --enableforcelegancy --update”, “delta”: “0:00:00.058063”, “end”: “2022-06-10 10:15:15.112762”, “msg”: “non-zero return code”, “rc”: 2, “start”: “2022-06-10 10:15:15.054699”, “stderr”: “Usage: authconfig [options] {–update|–updateall|–test|–probe|–restorebackup |–savebackup |–restorelastbackup}\n\nauthconfig: error: no such option: --enableforcelegancy”, “stderr\_lines”: [“Usage: authconfig [options] {–update|–updateall|–test|–probe|–restorebackup |–savebackup |–restorelastbackup}”, “”, “authconfig: error: no such option: --enableforcelegancy”], “stdout”: “”, “stdout\_lines”: }

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
172.16.13.244 : ok=2 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [June 10, 2022, 4:56am UTC](https://forum.ansible.com/t/ldap-setup/36704/6 "2022-06-10T04:56:39Z")

</div>

> Hi..  
> I'm facing this kind issue while running this playbook.

Looks like you have a typo in the command line options:

"authconfig: error: no such option: --enableforcelegancy"],

Regards

```
         Racke

```

---

<div class="post-metadata">

**Author:** ![Shivakumar\_Venkatasw](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Shivakumar\_Venkatasw](https://forum.ansible.com/u/Shivakumar_Venkatasw)\
**Post date:** [June 10, 2022, 5:22am UTC](https://forum.ansible.com/t/ldap-setup/36704/7 "2022-06-10T05:22:00Z")

</div>

Thank you racke,

Now it’s working
