Does Ansible Runner allow user-friendly `job_events` JSON file Names?

I am creating a Simple REST API based on the https://github/com/ansible/ansible-runner-service that suits my needs as opposed to AWX for the moment. As I am experimenting with ansible-runner CLI at the moment, I generate artifacts for my playbooks by explicitly mentioning:

  • artifact-dir
  • -i to not use UUID

A typical CLI execution looks like the following:

ansible-runner run . \
  --artifact-dir=artifacts/stack/ \
  -i teardown \
  --project-dir=project \
  -p stack_teardown.yml

I wish to create the artifacts based on the name of the playbook e.g. stack_generate.yml Playbook will have artifacts in artifacts/stack/generate and stack_teardown.yml will have artifacts in artifacts/stack/teardown directory respectively.

This is achievable via the -i flag and works really well.

However, the job_events generated under the respective artifacts directory are still UUID based. I was wondering if there would be some API in the Runner where the job_events can also have user-friendly names?

Hi, the name for the JSON files under job_events is generated based on counter and uuid in the JSON data itself. AFAIK there seems to be no room to modify this filename.

This is the code block for generating the name.

You might consider creating a small script that renames the JSON files after running ansible-runner.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.