Headless Ansible

I think I have a possible reliable way to get this working! I got Ansible Rulebook installed. I have to say, from the seemingly missing pieces in the documentation and lack of results when I Google error messages, it seems like not nearly as many people are using Rulebook? Anyway, I have a basic rulebook made for testing that was inspired by what I found here.

charlespick@ansible:~$ cat rulebook.yml
---
- name: Hello Events
  hosts: all
  sources:
    - ansible.eda.webhook:
        host: 127.0.0.1
        port: 6000
  rules:
    - name: Say Hello
      condition: event.payload.cmd == 'start'
      action:
        run_playbook:
          name: playbook.yml
charlespick@ansible:~$ cat inventory.yml
servers:
  hosts:
    10.3.6.133
charlespick@ansible:~$ cat playbook.yml
- name: ping
  hosts: all

  tasks:
  - name: Ping
    ansible.builtin.ping:

I figure I should be able to call the webhook with curl from NUT and have Ansible Rulebook respond in it’s own account with it’s own SSH keys etc. However this only seems to work once for some reason:


Ignoring the first try where I assume it wasn’t fully initialized, it only seems to run once, then either needs to cool off for an amount of time I haven’t figured out yet or I need to restart the OS.
The full error is

2023-10-29 18:46:29,916 - ansible_rulebook.rule_set_runner - ERROR - Error calling action run_playbook, err [('/home/charlespick/.ansible/cp/47aa5da64f', '/tmp/edach48wb7s/project/.ansible/cp/47aa5da64f', "[Errno 6] No such device or address: '/home/charlespick/.ansible/cp/47aa5da64f'")]