-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
source generic
is not released in Ansible EDA hence rulebook example fails
#494
Comments
Hi @tarilabs, we just added the generic source plugin to the collection a couple of days ago and we need to get a new release up on Galaxy. I'll see if we can get it done this week. In the interim, you can clone the event-driven-ansible collection repo and from there run: |
Hi, there is no need to clone the repo. You can run just
|
duly noted ✍️ thank you for all your feedbacks. I would suggest keeping this issue open until new EDA release, also for Google/SEO purposes in case someone else stumbles on the same issue. |
fyi I have tried per #494 (comment) but it does not work: $ ansible-galaxy collection install git+https://github.com/ansible/event-driven-ansible.git --force
Cloning into '/Users/mmortari/.ansible/tmp/ansible-local-4300uq5kaeu1/tmp_fbly964/event-driven-ansiblerqnade2u'...
remote: Enumerating objects: 125, done.
remote: Counting objects: 100% (125/125), done.
remote: Compressing objects: 100% (104/104), done.
remote: Total 125 (delta 6), reused 70 (delta 2), pack-reused 0
Receiving objects: 100% (125/125), 43.73 KiB | 2.08 MiB/s, done.
Resolving deltas: 100% (6/6), done.
Your branch is up to date with 'origin/main'.
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Installing 'ansible.eda:1.3.5' to '/Users/mmortari/.ansible/collections/ansible_collections/ansible/eda'
Created collection for ansible.eda:1.3.5 at /Users/mmortari/.ansible/collections/ansible_collections/ansible/eda
ansible.eda:1.3.5 was installed successfully
$ cat empirico1.rulebook.yml
- name: empirico1
hosts: all
sources:
- ansible.eda.generic:
payload:
- kind: Pod
apiVersion: v1
metadata:
name: hello-pvdf
namespace: default
uid: 6cd445f4-227d-4e81-957f-88ab08ee0a6c
resourceVersion: '35203'
creationTimestamp: '2023-04-26T14:50:54Z'
labels:
app.kubernetes.io/name: hello-pvdf
app.kubernetes.io/version: 1.47-SNAPSHOT
rules:
- name: r1
condition: event.payload.metadata.name == "hello-pvdf"
action:
debug:
msg: "Received: {{ event.payload.metadata.uid }}"
$ ansible-rulebook -i inventory.yml --rulebook empirico1.rulebook.yml
2023-05-02 09:25:48,744 - ansible_rulebook.engine - ERROR - Source error
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/ansible_rulebook/engine.py", line 93, in start_source
raise Exception(
Exception: Could not find source plugin for ansible.eda.generic
2023-05-02 09:25:48,745 - ansible_rulebook.engine - ERROR - Shutting down source: ansible.eda.generic error : Could not find source plugin for ansible.eda.generic
2023-05-02 09:25:48,765 - ansible_rulebook.app - ERROR - Could not find source plugin for ansible.eda.generic
2023-05-02 09:25:48,766 - ansible_rulebook.cli - ERROR - Unexpected exception
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/ansible_rulebook/cli.py", line 196, in main
asyncio.run(app.run(args))
File "/usr/local/Cellar/[email protected]/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/Cellar/[email protected]/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/usr/local/lib/python3.10/site-packages/ansible_rulebook/app.py", line 122, in run
raise Exception("One of the source plugins failed")
Exception: One of the source plugins failed |
Hitting same issue as @tarilabs while trying to use the |
Please confirm the following
Bug Summary
This source is mentioned in the doc:
ansible-rulebook/docs/conditions.rst
Lines 188 to 190 in 34d60eb
The
generic
source (in my understanding formallyansible.eda.generic
), is not available in the 1.3.3/(galaxy 1.3.4) from EDA:https://github.com/ansible/event-driven-ansible/tree/v1.3.3?search=1
but it's only available from
main
branch: https://github.com/ansible/event-driven-ansible/blob/main/extensions/eda/plugins/event_source/generic.pywhich is NOT yet released.
Hence, a user (like me 😅 ) trying out the example from the documentation fails as described below.
Environment
latests of all collections:
(even if I cannot find it on github 🤔 )
Steps to reproduce
condition: event.request is defined
Actual results
2023-04-27 08:29:42,245 - ansible_rulebook.engine - ERROR - Source error
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/ansible_rulebook/engine.py", line 93, in start_source
raise Exception(
Exception: Could not find source plugin for generic
Expected results
simple example from doc to be working
Additional information
No response
The text was updated successfully, but these errors were encountered: