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

propose iterative dev tips #513

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,8 @@ ENV/
.vscode/
.idea/

# local system
.DS_Store

# awx provision
tests/e2e/utils/awx/artifacts
13 changes: 13 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,16 @@ To run `ansible-rulebook` with worker mode enabled the `--worker` option can be
The `--project-tarball` option can also be useful during development.

The `-v` or `-vv` options can be added to any of the above commands to increase the logging output.

Iterative development tips
**************************

When developing iteratively rulebooks, you might want to consider using just the generic source plugin and automatic reload from the command line on rulebook file changes, for instance using the `watchmedo <https://pypi.org/project/watchdog>`_ utility.

For example:

.. code-block:: console

watchmedo shell-command -p "playground.rulebook.yml" -c "ansible-rulebook -i inventory.yml --rulebook playground.rulebook.yml -v" -W .

Using just generic source plugin will automatically terminate the rulebook after all rules have been evaluated for the specified payloads, so the above command will retrigger it automatically after each saved changes in the rulebook file.