Using template module

Hi all

Hoping someone can help me.

We have recently installed awx operator, running inside minikube.

Everything is working as expected, and can run multiple jobs.

The prblem I’m currently having is being able to grab files form the ansible controller to copy to the selected host.

Example:

  • hosts: sonarqube.platsoft.lan

tasks:

  • name:
    template: src=/etc/nginx/conf.d/nginx.conf.j2 dest=/etc/nginx/conf.d/y.conf

The above task should copy the nginx.conf.j2 on the controller to the host right?

I am getting an error stating “Could not find or access file on ansible controller”.

Im just a bit confused. Where should the files be placed for the playbook to see them on the controller? Do they need to be within one of the containers, or on the VM hosting the containers?

Please help :frowning:

Thank you in advance!

Hi,

The way job execution works with the operator is that jobs are launched against the kubernetes api. You’ll need to do some work around mounting the file system:

https://docs.ansible.com/automation-controller/4.3/html/userguide/execution_environments.html#execution-environment-mount-options

This documentation should help you figure out what options you’ll want to expose.

Thanks,

AWX Team

Thanks, appreciate it.
So my question now - Where does the file that I want to mount into the temp pod need to exist? On the VM where awx operator is being hosted? Or within the ee container?
I have tried isolated paths as well as instance groups, but still no luck.

I came right, thanks very much!