You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that ansible-rulebook is open source software provided for free and that I might not receive a timely response.
Bug Summary
Hi, I would like to ask if ansible.eda.alertmanager can successfully trigger ‘run_playbook’?
Because when we use ansible.eda.alertmanager to send alert to EDA, EDA can receive the alert message and find the action's run_playbook. but the subsequent playbook cannot be executed. 、
Environment
Enviroment:
1:AAP2.5
2:ansible-rulebook --version
1.1.1
Executable location = /usr/bin/ansible-rulebook
Drools_jpy version = 0.3.9
Java home = /usr/lib/jvm/java-17-openjdk-17.0.13.0.11-3.el9.x86_64
Java version = 17.0.13
Python version = 3.11.7 (main, Aug 23 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)]
3:
Steps to reproduce
when we use ansible.eda.alertmanager to send alert to EDA, EDA can receive the alert message and find the action's run_playbook. but the subsequent playbook cannot be executed. The alert error message is shown below:
024-11-12 15:27:32,290 - ansible_rulebook.action.run_playbook - DEBUG - ruleset: Automatic Remediation of a server, rule: CPU full on server
2024-11-12 15:27:32,290 - ansible_rulebook.action.run_playbook - DEBUG - private data dir /tmp/eda1j9oxmh6
2024-11-12 15:27:32,293 - ansible_rulebook.action.run_playbook - DEBUG - project_data_file: None
2024-11-12 15:27:32,295 - ansible_rulebook.action.run_playbook - DEBUG - Calling Ansible runner
[WARNING]: Could not match supplied host pattern, ignoring: 10.71.19.192
ERROR! Specified inventory, host pattern and/or --limit leaves us with no hosts to target.
2024-11-12 15:27:32,888 - ansible_rulebook.action.runner - DEBUG - Cancel Queue reading task
2024-11-12 15:27:32,889 - ansible_rulebook.action.runner - INFO - Ansible runner Queue task cancelled
2024-11-12 15:27:32,890 - ansible_rulebook.action.run_playbook - INFO - Ansible runner rc: 1, status: failed
2024-11-12 15:27:32,891 - ansible_rulebook.action.run_playbook - ERROR - [WARNING]: Could not match supplied host pattern, ignoring: 10.71.19.192
ERROR! Specified inventory, host pattern and/or --limit leaves us with no hosts to target.
Then I switched things up and put this playbook in the Automation Controller template. Using
And it worked.
So back to my question: Why does ansible.eda.alertmanager CAN'T successfully trigger ‘run_playbook’?
Actual results
when we use ansible.eda.alertmanager to send alert to EDA, EDA can receive the alert message and find the action's run_playbook. but the subsequent playbook cannot be executed. The alert error message is shown below:
024-11-12 15:27:32,290 - ansible_rulebook.action.run_playbook - DEBUG - ruleset: Automatic Remediation of a server, rule: CPU full on server
2024-11-12 15:27:32,290 - ansible_rulebook.action.run_playbook - DEBUG - private data dir /tmp/eda1j9oxmh6
2024-11-12 15:27:32,293 - ansible_rulebook.action.run_playbook - DEBUG - project_data_file: None
2024-11-12 15:27:32,295 - ansible_rulebook.action.run_playbook - DEBUG - Calling Ansible runner
[WARNING]: Could not match supplied host pattern, ignoring: 10.71.19.192
ERROR! Specified inventory, host pattern and/or --limit leaves us with no hosts to target.
2024-11-12 15:27:32,888 - ansible_rulebook.action.runner - DEBUG - Cancel Queue reading task
2024-11-12 15:27:32,889 - ansible_rulebook.action.runner - INFO - Ansible runner Queue task cancelled
2024-11-12 15:27:32,890 - ansible_rulebook.action.run_playbook - INFO - Ansible runner rc: 1, status: failed
2024-11-12 15:27:32,891 - ansible_rulebook.action.run_playbook - ERROR - [WARNING]: Could not match supplied host pattern, ignoring: 10.71.19.192
ERROR! Specified inventory, host pattern and/or --limit leaves us with no hosts to target.
Expected results
we expected the EDA could run the playbook
Additional information
N/A
The text was updated successfully, but these errors were encountered:
Hello @adiooooos
The plugin attempts to parse the host from the alert and pass it to the --limit option. The error occurs because the host does not match any value in your inventory, causing the ansible-playbook command to fail. When running the rulebook to trigger a local playbook with the run_playbook action, your inventory must define the host referenced in the alert.
Alternatively, you can configure the option data_host_path option in ansible.eda.alertmanager to either disable the host or specify a new location. You can also override the content of event.meta.hosts using insert_hosts_to_meta filter, as described here.
Please confirm the following
Bug Summary
Hi, I would like to ask if ansible.eda.alertmanager can successfully trigger ‘run_playbook’?
Because when we use ansible.eda.alertmanager to send alert to EDA, EDA can receive the alert message and find the action's run_playbook. but the subsequent playbook cannot be executed. 、
Environment
Enviroment:
1:AAP2.5
2:ansible-rulebook --version
1.1.1
Executable location = /usr/bin/ansible-rulebook
Drools_jpy version = 0.3.9
Java home = /usr/lib/jvm/java-17-openjdk-17.0.13.0.11-3.el9.x86_64
Java version = 17.0.13
Python version = 3.11.7 (main, Aug 23 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)]
3:
Steps to reproduce
when we use ansible.eda.alertmanager to send alert to EDA, EDA can receive the alert message and find the action's run_playbook. but the subsequent playbook cannot be executed. The alert error message is shown below:
024-11-12 15:27:32,290 - ansible_rulebook.action.run_playbook - DEBUG - ruleset: Automatic Remediation of a server, rule: CPU full on server
2024-11-12 15:27:32,290 - ansible_rulebook.action.run_playbook - DEBUG - private data dir /tmp/eda1j9oxmh6
2024-11-12 15:27:32,293 - ansible_rulebook.action.run_playbook - DEBUG - project_data_file: None
2024-11-12 15:27:32,295 - ansible_rulebook.action.run_playbook - DEBUG - Calling Ansible runner
[WARNING]: Could not match supplied host pattern, ignoring: 10.71.19.192
ERROR! Specified inventory, host pattern and/or --limit leaves us with no hosts to target.
2024-11-12 15:27:32,888 - ansible_rulebook.action.runner - DEBUG - Cancel Queue reading task
2024-11-12 15:27:32,889 - ansible_rulebook.action.runner - INFO - Ansible runner Queue task cancelled
2024-11-12 15:27:32,890 - ansible_rulebook.action.run_playbook - INFO - Ansible runner rc: 1, status: failed
2024-11-12 15:27:32,891 - ansible_rulebook.action.run_playbook - ERROR - [WARNING]: Could not match supplied host pattern, ignoring: 10.71.19.192
ERROR! Specified inventory, host pattern and/or --limit leaves us with no hosts to target.
Then I switched things up and put this playbook in the Automation Controller template. Using
ansible-rulebook --rulebook prometheus. yml --controller-url https://10.71.18.35 --controller-username admin --controller-password redhat --controller-ssl-verify no --print-event -v
And it worked.
So back to my question: Why does ansible.eda.alertmanager CAN'T successfully trigger ‘run_playbook’?
Actual results
when we use ansible.eda.alertmanager to send alert to EDA, EDA can receive the alert message and find the action's run_playbook. but the subsequent playbook cannot be executed. The alert error message is shown below:
024-11-12 15:27:32,290 - ansible_rulebook.action.run_playbook - DEBUG - ruleset: Automatic Remediation of a server, rule: CPU full on server
2024-11-12 15:27:32,290 - ansible_rulebook.action.run_playbook - DEBUG - private data dir /tmp/eda1j9oxmh6
2024-11-12 15:27:32,293 - ansible_rulebook.action.run_playbook - DEBUG - project_data_file: None
2024-11-12 15:27:32,295 - ansible_rulebook.action.run_playbook - DEBUG - Calling Ansible runner
[WARNING]: Could not match supplied host pattern, ignoring: 10.71.19.192
ERROR! Specified inventory, host pattern and/or --limit leaves us with no hosts to target.
2024-11-12 15:27:32,888 - ansible_rulebook.action.runner - DEBUG - Cancel Queue reading task
2024-11-12 15:27:32,889 - ansible_rulebook.action.runner - INFO - Ansible runner Queue task cancelled
2024-11-12 15:27:32,890 - ansible_rulebook.action.run_playbook - INFO - Ansible runner rc: 1, status: failed
2024-11-12 15:27:32,891 - ansible_rulebook.action.run_playbook - ERROR - [WARNING]: Could not match supplied host pattern, ignoring: 10.71.19.192
ERROR! Specified inventory, host pattern and/or --limit leaves us with no hosts to target.
Expected results
we expected the EDA could run the playbook
Additional information
N/A
The text was updated successfully, but these errors were encountered: