- awx.awx.settings:
settings:
AUTH_LDAP_USER_SEARCH: [
[ "OU=Users,DC=northamerica,DC=acme,DC=com", "SCOPE_SUBTREE", "(sAMAccountName=%(user)s)" ],
[ "OU=Users,DC=apac,DC=corp,DC=com", "SCOPE_SUBTREE", "(sAMAccountName=%(user)s)" ],
[ "OU=Users,DC=emea,DC=corp,DC=com", "SCOPE_SUBTREE", "(sAMAccountName=%(user)s)" ]
]
--
You received this message because you are subscribed to a topic in the Google Groups "AWX Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/awx-project/-Qf6K2C_VOw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to awx-project...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/b99a68b5-67b8-4067-844c-306e37d50605n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/0b948648-c6ae-40e6-bc70-b55fbe4016d3n%40googlegroups.com.
import ldap from django_auth_ldap.config import LDAPSearch, LDAPSearchUnion AUTH_LDAP_USER_SEARCH = LDAPSearchUnion( LDAPSearch("ou=users,dc=example,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)"), LDAPSearch("ou=otherusers,dc=example,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)"), )
Is it possible to use above syntax in ansible awx.awx.settings
---
- name: Set multiple LDAP user search
hosts: localhost
connection: local
gather_facts: False
tasks:
- awx.awx.settings:
settings:
AUTH_LDAP_USER_SEARCH: [
[ "OU=Users,OU=Corporate,DC=cable,DC=comcast,DC=com","SCOPE_SUBTREE","(sAMAccountName=%(user)s)" ],
[ "OU=employees,OU=users,OU=india,DC=apac,DC=comcast,DC=com","SCOPE_SUBTREE","(sAMAccountName=%(user)s)" ]
]
controller_host: https://<my server>:8043
controller_username: <my user>
controller_password: <my password>
validate_certs: False
Here is the output from ansible-playbook my_test_playbook.yml:
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [Set multiple LDAP user search] **********************************************************************************************************************************************************************************************************************************************************
TASK [awx.awx.settings] ***********************************************************************************************************************************************************************************************************************************************************************
[WARNING]: You are running collection version 0.0.1-devel but connecting to AWX version 21.0.1.dev120+ge7514e4547.d20220518
changed: [localhost]
PLAY RECAP ************************************************************************************************************************************************************************************************************************************************************************************
localhost : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Maybe try just filling in the missing pieces (<my server>, <my user>, <my password>) and see if this sample helps? If not I'm afraid I'm out of ideas. As I mentioned before, sometimes when ansible references a specific line/column number its not quite accurate. Maybe there is an error somewhere else in your playbook?
-John