0

In my playbook I setup the LDAP configuration with the awx.settings module. So far so good.

To attend groups in AWX under /Settings/LDAP Default/LDAP Team Map/ I need to retrieve the values from LDAP_TEAM_MAP and than attend a new value.

  • Is there a way to read this value from a variable?

  • Or is it a need to get the values from the AWX REST API

    https://{{ TOWER_URL }}/api/v2/settings/ldap/AUTH_LDAP_TEAM_MAP
    

Thanks

U880D
  • 8,601
  • 6
  • 24
  • 40
twmuss
  • 11
  • 1

2 Answers2

1

controller_api is the way it works!

---
- name: Load the UI settings specifying the connection info
  set_fact:
    controller_settings: "{{ lookup('awx.awx.tower_api', 'settings/ldap', 
              host='localhost', username='admin', password='password',
              verify_ssl=False) }}"

- name: debug
  debug:
     var: controller_settings["AUTH_LDAP_TEAM_MAP"]

Thx for support

twmuss
  • 11
  • 1
0

According Ansible Tower documentation Launch a Job Template, that kind of information will not be added to the environment. Also the documentation of awx.awx modules do not show an option for gathering the config directly.

Therefore the in the question mentioned REST API call will be necessary. For this a lookup plugin, controller_api is available also.

... currently there seems to be an error with the documentation import, therefore you may to have a look into the plugin source directly for usage information.

Further Reading

U880D
  • 8,601
  • 6
  • 24
  • 40