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

ansible operator support #45203

Open
2 tasks done
liuzheng opened this issue Dec 25, 2024 · 1 comment
Open
2 tasks done

ansible operator support #45203

liuzheng opened this issue Dec 25, 2024 · 1 comment
Labels
area:plugins kind:feature Feature Requests needs-triage label for new issues that we didn't triage yet

Comments

@liuzheng
Copy link

liuzheng commented Dec 25, 2024

Description

Airflow running ansible playbook like AWX, I will create PR, but I need help to make it more airflow pluginable.

If you think it is a good job, I can provide more example dags and documents

@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?

  • Yes I am willing to submit a PR!

Code of Conduct

@liuzheng liuzheng added kind:feature Feature Requests needs-triage label for new issues that we didn't triage yet labels Dec 25, 2024
Copy link

boring-cyborg bot commented Dec 25, 2024

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:plugins kind:feature Feature Requests needs-triage label for new issues that we didn't triage yet
Projects
None yet
Development

No branches or pull requests

1 participant