ansible / tower-cli

THIS TOOL IS NO LONGER UNDER ACTIVE DEVELOPMENT. This tool is being phased out in favor of the new official AWX CLI
https://github.com/ansible/awx/tree/devel/awxkit/awxkit/cli/docs
Apache License 2.0
362 stars 151 forks source link

setting modify AUTH_LDAP_USER_SEARCH value format #472

Open mrj1m0thy opened 6 years ago

mrj1m0thy commented 6 years ago

I'm trying to use the following command: tower-cli setting modify AUTH_LDAP_USER_SEARCH

However, I can't find any documentation or any relevant source that explains what the expected value is supposed to be. Closest thing is what it is represented as in the /etc/awx/setting.py which is the following:

AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=users,dc=example,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)")

I've tried running the command with the above formatting to no avail. Would greatly appreciate any assistance! Thanks

cchurch commented 6 years ago

See http://docs.ansible.com/ansible-tower/latest/html/administration/ldap_auth.html

mrj1m0thy commented 6 years ago

My problem with that is that the configuration isn't saved when I click "Save" in the UI. Load another page and come back and the config is gone. Either way, I'm automating a ansible tower deployment so the command line is a necessity.

skamithi commented 6 years ago

@mrj1m0thy check out my ansible module for examples of how to use the tower cli code to modify ldap settings. https://github.com/skamithi/ansible-tower-ldap-settings/blob/master/library/tower_ldap_settings.py

foofoo-2 commented 6 years ago

@mrj1m0thy I had the same question as yours and I was finally able to set the AUTH_LDAP_* settings using the following tower-cli syntax:

tower-cli setting modify AUTH_LDAP_USER_ATTR_MAP "{'first_name': 'givenName', 'last_name': 'sn', 'email': 'mail'}"