Skip to content
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

Reserved keywords can be overridden by action_args gives the error "got multiple values for keyword argument 'facts'" #102

Open
mkanoor opened this issue Jul 12, 2022 · 0 comments

Comments

@mkanoor
Copy link
Contributor

mkanoor commented Jul 12, 2022

  • ansible-events version: 0.4.0
  • Python version: 3.9.13
  • Operating System: Mac OS

Description

If an action has attribute names that conflict with the arguments being passed to the action we get an error

ERROR:root:Error calling run_playbook: ansible_events.builtin.run_playbook() got multiple values for keyword argument 'facts'

What I Did

Create a playbook with the following contents
---
- name: Demo rules multiple conditions reference assignment
  hosts: localhost
  sources:
    - benthomasson.eda.range:
        limit: 5
  rules:
    - name: multiple conditions
      condition:
        all:
          - event.i == 0
          - event.i == 1
      action:
        run_playbook:
          name: hello_playbook.yml
          post_events: true
          events: 12345
          facts: 789
          hello: "world"

The facts is being redefined by the user. We might have to protect the variables that we use when we call the action
https://github.com/benthomasson/ansible-events/blob/42102e2ecc1178c5243171fc7afa9bc8c3b754a2/ansible_events/engine.py#L198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant