Skip to content

add function to run ansible playbook#22

Open
g0rgamesh wants to merge 5 commits into
masterfrom
run_playbook
Open

add function to run ansible playbook#22
g0rgamesh wants to merge 5 commits into
masterfrom
run_playbook

Conversation

@g0rgamesh
Copy link
Copy Markdown

@g0rgamesh g0rgamesh commented May 27, 2026

Used in some environments already.

@g0rgamesh g0rgamesh requested a review from a team as a code owner May 27, 2026 08:01
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new --run-ansible-playbook argument to both the create and run commands, allowing users to execute a specified Ansible playbook. However, a security vulnerability was identified in the run_ansible_playbook function: the call to get_path is currently a no-op because its return value is ignored, and passing the unquoted user-provided playbook path directly to a shell-executing function (run_kayobe) poses a command injection risk. It is recommended to resolve the path properly and wrap it with shlex.quote() to prevent shell injection.

Comment thread beokay.py
@jovial
Copy link
Copy Markdown
Contributor

jovial commented May 27, 2026

What is the use case? I'm still wondering why you wouldn't just add a hook on control host bootstrap.

@g0rgamesh
Copy link
Copy Markdown
Author

What is the use case? I'm still wondering why you wouldn't just add a hook on control host bootstrap.

My use case was that I had to run a playbook that added cert paths to venv outside of kayobe.

@jovial
Copy link
Copy Markdown
Contributor

jovial commented May 27, 2026

What is the use case? I'm still wondering why you wouldn't just add a hook on control host bootstrap.

My use case was that I had to run a playbook that added cert paths to venv outside of kayobe.

Would that work with a regular hook? Or was there a particular issue where you needed to use ansible-playbook directly?

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

Successfully merging this pull request may close these issues.

2 participants