# Tower\_cli.cfg is not applied

**URL:** <https://forum.ansible.com/t/tower-cli-cfg-is-not-applied/39506>\
**Category:** Get Help\
**Tags:** awx\
**Created:** [January 8, 2025, 1:29pm UTC](https://forum.ansible.com/t/tower-cli-cfg-is-not-applied/39506 "2025-01-08T13:29:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoonmin1030](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/yoonmin1030/32/2742_2.png) [@yoonmin1030](https://forum.ansible.com/u/yoonmin1030)\
**Post date:** [January 8, 2025, 1:29pm UTC](https://forum.ansible.com/t/tower-cli-cfg-is-not-applied/39506/1 "2025-01-08T13:29:14Z")

</div>

I am testing controller\_api module on a playbook.  
example playbook

```auto
- 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.

```auto
[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/:](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

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [January 29, 2025, 9:01pm UTC](https://forum.ansible.com/t/tower-cli-cfg-is-not-applied/39506/2 "2025-01-29T21:01:51Z")

</div>

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.

```auto
    - 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) }}"

```

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [January 30, 2025, 5:01pm UTC](https://forum.ansible.com/t/tower-cli-cfg-is-not-applied/39506/3 "2025-01-30T17:01:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![yoonmin1030](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/yoonmin1030/32/2742_2.png) [@yoonmin1030](https://forum.ansible.com/u/yoonmin1030)\
**Post date:** [February 7, 2025, 9:37am UTC](https://forum.ansible.com/t/tower-cli-cfg-is-not-applied/39506/4 "2025-02-07T09:37:01Z")

</div>

> [@dpowell](#):
>
> tower\_cli.cf

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

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [February 8, 2025, 3:58am UTC](https://forum.ansible.com/t/tower-cli-cfg-is-not-applied/39506/5 "2025-02-08T03:58:59Z")

</div>

That was the only way I got it to work.
