# ca\_path in play and EE container

**URL:** <https://forum.ansible.com/t/ca-path-in-play-and-ee-container/35830>\
**Category:** AWX Project\
**Tags:** awx, ee\
**Created:** [October 6, 2021, 9:26pm UTC](https://forum.ansible.com/t/ca-path-in-play-and-ee-container/35830 "2021-10-06T21:26:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cnu\_k](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@Cnu\_k](https://forum.ansible.com/u/Cnu_k)\
**Post date:** [October 6, 2021, 9:26pm UTC](https://forum.ansible.com/t/ca-path-in-play-and-ee-container/35830/1 "2021-10-06T21:26:26Z")

</div>

We’re making a GET call using uri module and passing CA certificate using ca\_path value.  
For some reason we’re randomly seeing following error for that play/job run in AWX 19.2.2.

“Status code was -1 and not [200]: Connection failure: [Errno 2] No such file or directory: b’/home/runner/ca-cert.pem’”

Any clues on what the issue could be since I added the ca-cert.pem to the custom EE docker image at above path and verified that it exists in the container.

Thanks

---

<div class="post-metadata">

**Author:** ![Cnu\_k](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@Cnu\_k](https://forum.ansible.com/u/Cnu_k)\
**Post date:** [October 7, 2021, 1:06pm UTC](https://forum.ansible.com/t/ca-path-in-play-and-ee-container/35830/2 "2021-10-07T13:06:29Z")

</div>

Here is the playbook YAML for the call. I don’t get why the calls are failing though the EE container image has the certificate at the given path.

- name: “GET something”  
uri:  
url: “https://{{hostname }}/api/somecall”  
method: GET  
url\_username: ‘{{ lookup(“env”, “ANSIBLE\_NET\_USERNAME”) }}’  
url\_password: ‘{{ lookup(“env”, “ANSIBLE\_NET\_PASSWORD”) }}’  
status\_code: 200  
ca\_path: “'/home/runner/ca-cert.pem”  
register: results  
ignore\_errors: yes

---

<div class="post-metadata">

**Author:** ![Cnu\_k](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@Cnu\_k](https://forum.ansible.com/u/Cnu_k)\
**Post date:** [October 14, 2021, 2:26pm UTC](https://forum.ansible.com/t/ca-path-in-play-and-ee-container/35830/3 "2021-10-14T14:26:12Z")

</div>

Any clues from Ansible or AWX gurus as we’re still having this issue though the ca-cert.pem exists in the EE container?  
Does it have to done in a different way since AWX 19.x is now using Ansible Execution Environments for running the plays and jobs?  
There is not much documentation for using ca\_path other that referencing the path, so wondering why this wouldn’t work.

Thanks

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [October 14, 2021, 2:39pm UTC](https://forum.ansible.com/t/ca-path-in-play-and-ee-container/35830/4 "2021-10-14T14:39:04Z")

</div>

There are multiple ways you can do this. One is through ee. Including it in a project. I wouldn’t recommend those ways because yoy are including the secret inside the artifact.

Another way is to create a custom credential. With A custom credential you can create a Credential object. One type of properties that you can create is Multiline object.  
So yoy could for example create a custom credential for certificates say.

Then In that credential type you can create a Multiline property which is encrypted which houses your credential. Then in your playbook you can reference that object

[https://docs.ansible.com/ansible-tower/latest/html/userguide/credential\_types.html](https://docs.ansible.com/ansible-tower/latest/html/userguide/credential_types.html)

---

<div class="post-metadata">

**Author:** ![Cnu\_k](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@Cnu\_k](https://forum.ansible.com/u/Cnu_k)\
**Post date:** [October 14, 2021, 2:53pm UTC](https://forum.ansible.com/t/ca-path-in-play-and-ee-container/35830/5 "2021-10-14T14:53:59Z")

</div>

Thanks for the suggestions, will try that route if we run into this issue again.  
It’s weird, but I noticed that restarting the AWX pod has resolved the issue. Same play that failed few minutes ago ran to success and it’s able to find ca\_opath file from the same location. Not sure if there was something going on with the EE container as I don’t recall seeing any errors in the logs, but the job was failing earlier.

---

<div class="post-metadata">

**Author:** ![Cnu\_k](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@Cnu\_k](https://forum.ansible.com/u/Cnu_k)\
**Post date:** [October 15, 2021, 3:25am UTC](https://forum.ansible.com/t/ca-path-in-play-and-ee-container/35830/6 "2021-10-15T03:25:00Z")

</div>

Getting the same error intermittently, not sure if it’s related to SELinux or some security components are blocking anything or other weird issues.  
On a side note, if we place .pem file in the AWX project, what changes are required for the ‘ca\_path’ entry to refer to that file?  
Would it work if it’s referenced as ca\_path: “ca-cert.pem” or some other way?

Thanks

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [October 15, 2021, 3:27am UTC](https://forum.ansible.com/t/ca-path-in-play-and-ee-container/35830/7 "2021-10-15T03:27:50Z")

</div>

Yoy would do a lookup plugin if you referenced the file in the project
