# Guidance on developing a custom ansible-rulebook action plugin (e.g., run\_kubernetes\_job)

**URL:** <https://forum.ansible.com/t/guidance-on-developing-a-custom-ansible-rulebook-action-plugin-e-g-run-kubernetes-job/44290>\
**Category:** Get Help\
**Tags:** kubernetes, ansible-rulebook\
**Created:** [August 13, 2025, 4:23pm UTC](https://forum.ansible.com/t/guidance-on-developing-a-custom-ansible-rulebook-action-plugin-e-g-run-kubernetes-job/44290 "2025-08-13T16:23:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sstagnaro](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sstagnaro/32/9274_2.png) [@sstagnaro](https://forum.ansible.com/u/sstagnaro)\
**Post date:** [August 13, 2025, 4:23pm UTC](https://forum.ansible.com/t/guidance-on-developing-a-custom-ansible-rulebook-action-plugin-e-g-run-kubernetes-job/44290/1 "2025-08-13T16:23:34Z")

</div>

Hello Ansible Community,

I’m exploring how to extend `ansible-rulebook` by creating a custom action plugin, and I would appreciate some guidance on the best practices for doing so.

My goal is to create a new, native action called `run_kubernetes_job`. I envision this action doing more than just creating a Kubernetes Job from a manifest. I would like the action itself to:

1. **Create** the Kubernetes Job.

2. **Monitor** its execution until it completes (succeeds or fails).

3. **Implement a retry mechanism** if the job fails a certain number of times.

I am aware that I could achieve this by using the existing `run_playbook` action and putting all the logic inside a playbook. However, a native `run_kubernetes_job` action feels more intuitive and would encapsulate the logic cleanly, making the rulebook more declarative. From the rulebook’s perspective, the action would be a single, synchronous unit that only finishes when the job’s lifecycle is complete.

I apologize if any of my assumptions are technically incorrect or if this isn’t a feasible approach. Any guidance, examples, or pointers to the right resources would be greatly appreciated.

Thank you for your time and help!
