LDAP setup??

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
–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

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

my play book look like this

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

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

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

PLAY [172.16.13.244] ************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************************************************************
task path: /var/lib/awx/projects/playbook/LDAP.yml:2
ok: [172.16.13.244]
META: ran handlers

TASK [install nss-pam-ldap] *****************************************************************************************************************************************************************************************************************
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

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

Thank you racke,

Now it’s working