# Using Red Hat AAP

**URL:** <https://forum.ansible.com/t/using-red-hat-aap/37037>\
**Category:** AWX Project\
**Tags:** aap, awx, ee\
**Created:** [August 25, 2022, 11:07pm UTC](https://forum.ansible.com/t/using-red-hat-aap/37037 "2022-08-25T23:07:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bill\_Biker](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bill_biker/32/8087_2.png) [@Bill\_Biker](https://forum.ansible.com/u/Bill_Biker)\
**Post date:** [August 25, 2022, 11:07pm UTC](https://forum.ansible.com/t/using-red-hat-aap/37037/1 "2022-08-25T23:07:21Z")

</div>

Hello and thanks for th help. I have some measure of sucesss  
With the Trial redhat AAP. I get the same issue with the open source AWX-operator.

I am trying to crated a job template using “ansible.controller.job\_template” - Red hat AAP or  
“awx.awx.job\_templ.ate” AWX Operator

I got the code sample from:

[https://github.com/network-automation/toolkit/blob/master/playbooks/network\_backup.ym](https://github.com/network-automation/toolkit/blob/master/playbooks/network_backup.yml)l

I have solved the “run once” issue - it works alphabetically! my hosts are backup-server and network.

The “make template” task code is code is this:

_- name: create restore job template_

_ansible.controller.job\_template:_

_name: “Network Automation - Restore”_

_job\_type: “run”_

_inventory: “{{ restore\_inventory|default(‘Network Inventory’) }}”_

_project: “{{ restore\_project|default(‘Network Toolkit’) }}”_

_playbook: “{{ restores\_playbook|default(‘playbooks/network\_restore.yml’) }}”_

_credential: “{{ restore\_credential|default(‘Network Credential’) }}”_

_survey\_enabled: true_

_survey\_spec: “{{ lookup(‘template’, ‘{{ playbook\_dir }}/…/network\_setup/templates/backup.j2’) }}”_

_validate\_certs: no_

_execution\_environment: “Default execution environment”_

_run\_once: true_

The task works to a point - all the json code is fine, the error text show all the right data for backup files, etc . BUT the execution environment ALWAYS errors out with this error:

“msg”: “The requested object could not be found at /api/v2/execution\_environments/.”,

If I comment out the execution\_environment line, I get the same error, but this time for “job\_template”, if I add a line for “organzation” I get the same message but this time for /api/v2/organizations…The code works through, and the survy\_spec gets the correct results, etc. but no template gets created the “backup-server” and the controller\_host are the same box.

Any Ideas on what I might be missing? Same problem with the Red Hat Trial, and the awx-operator,

thanks

ewholz

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [August 26, 2022, 5:43pm UTC](https://forum.ansible.com/t/using-red-hat-aap/37037/2 "2022-08-26T17:43:30Z")

</div>

Hello,  
We tried to reproduce this error locally and were unable to do so. Here is the Ansible Playbook that we used:

---

<div class="post-metadata">

**Author:** ![Bill\_Biker](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bill_biker/32/8087_2.png) [@Bill\_Biker](https://forum.ansible.com/u/Bill_Biker)\
**Post date:** [August 26, 2022, 8:24pm UTC](https://forum.ansible.com/t/using-red-hat-aap/37037/3 "2022-08-26T20:24:47Z")

</div>

Hello All and the AWX Project Group -  
Again thanks for the information. I did manage to solve the problem I was having. This may help others.  
I quit using the Red Hat AAP credential and url ( my server). I am using the AWX-Operator. This version uses the

awx.awx.job\_template module… I reviewed the help for this module at: [https://docs.ansible.com/ansible/latest/collections/awx/awx/job\_template\_module.html](https://docs.ansible.com/ansible/latest/collections/awx/awx/job_template_module.html).  
I added values to the job\_template code for: controller\_host, controller\_username, and controller\_password.  
Placing these values in the task under awx.awx.job\_template: solved my issue. I re-read the instructions on using the awx.awx.job\_template module, and that

solved my issue.

Thanks for the excellent support - I appreciate it, it did help.  
ewholz1
