Tower_cli.cfg is not applied

I am testing controller_api module on a playbook.
example playbook

- name: debug all organizations in a loop  # use query to return a list
  debug:
    msg: "Organization description={{ item['description'] }} id={{ item['id'] }}"
  loop: "{{ query('awx.awx.controller_api', 'organizations') }}"
  loop_control:
    label: "{{ item['name'] }}"

and I config tower_cli.cfg with following.

[gerneral]
host= xxx
username =xxx
oauth_token = xxx
verity_ssl = false

and I put the file on my ~/project/playbooks/tower_cli.cfg
playbook runs on localhost with error
“trying to connect to https://127.0.0.1/api/v2/organizations/: URLError <urlopen error [Errno 111] Connection refused>”
I expect to lookup on host from tower_cli.cfg.

please help me to understand for controller_api

Did you ever figure this out? I’m seeing the same issue, I even set the value like the example but it doesn’t like that.

    - name: Load the UI settings specifying the connection info
      set_fact:
        controller_settings: "{{ lookup('awx.awx.controller_api', 'settings/ui', host='myhost',
                                username='olam_api', password=ansible_tower_admin_password, verify_ssl=False) }}"

Figured out my issue, the tower_cli.cfg needed to be on the EE not the AWX host.

Hello, I have a question for your comment.
Did you mean the tower_cli.cfg have to be in the task-ee container?

That was the only way I got it to work.