Using Red Hat AAP

, ,

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.yml

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

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

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