liuzheng opened a new issue, #45203:
URL: https://github.com/apache/airflow/issues/45203
### Description
Airflow running ansible playbook like AWX, I will create MR, but I need help
to make it more airflow pluginable.
```
@task()
def prepare_data():
return "hello.yaml"
@task()
def prepare_inventory():
return {} # ansible inventory
@task.ansible()
def hello(playbook,inventory): # pylint: disable=unused-argument
"""hello"""
context = get_current_context()
task_log.debug(context["ansible_return"])
return context["ansible_return"]
@dag(
...
)
def main():
"""main"""
playbook_data = prepare_data()
inventory = prepare_inventory()
hello(playbook=playbook_data,inventory=inventory)
```
### Use case/motivation
run ansible playbook
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]