'script' module in ansible not supported in AWX?

I’ve set up an AWX-23.5.1 by using awx-operator on my K8S cluster. When I tried to run command for my inventory from web I failed to find ‘script’ module, which is available in ansible that I’ve used some days before. (available modules includes: command, shell, apt, yum, etc. but no script)
So I wonder is this because I missed some configuration to include ‘script’ module in my AWX? If so , is there any document for fix this? Or AWX did exclude ‘script’ module on purpose and why?


There is an option called Ansible Modules Allowed for Ad Hoc Jobs under Settings > Jobs and you can add any modules to this list.


However, script module in AWX will probably not work as expected. My understanding is that script is intentionally excluded by default. The problem is that it is difficult to place the script files to run.

The technical background is:

  • Any ad hoc commands are executed in a pod called Automation Job Pod. This is an ephemeral pod that is created each time it is run and deleted upon completion.
  • Script files to be executed by the script module must be present in this pod.
  • To place files in this pod, you must either create your own EE image containing the files, or define an EE containing the custom pod spec and mount ConfigMap or PV that contains files. This is a bit of a complicated procedure and is not a solution that is readily available to everyone.

That’s a quick and clear answer and helps a lot. thx

Could you include the script in your git source control? Then, when you create a job template and choose a project that uses the source control the file will also be loaded into the EE pod.

This can be done for script module in playbooks (job template), but OP wants to use script module as an ad-hoc command, so there is no chance to read files from SCM :frowning_face:

I see. I misunderstood and though he was trying to use in playbook. Thanks for clarification.