-
Notifications
You must be signed in to change notification settings - Fork 656
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
docs: add hint for verify playbook #3222
Conversation
As discussed in ansible#3045, since the `verify.yml` playbook does not run the tested role, the `library` and `module_utils` provided by the tested role are not be available there [1]. Usually, one does not want to re-run the role in the `verify.yml` playbook since it was already run twice before. One workaround suggested by @tadeboro is to add an empty task list to the role and then to restrict tasks of the role to this file when including it in the `verify.yml` playbook. This PR adds a note regarding this to the docs. [1] (the `library` actually *is* currently available, but [this is an oversight](ansible#3045 (comment)); the `module_utils` are not available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am ok to add this even if it is something module developers should already know. In fact it will soon become even more problematic as molecule will stop altering ansible include paths.
While I do think some people would be upset and say testing worked before and now is no longer working, we will say that our goal is to test how this code will run on production. On production we do not expect mounting random folder just to help ansible report an error. Being more strict and will less magic will help molecule provide better testing, like detecting things that are not installed correctly.
Also please fix reported issues. |
docs/getting-started.rst
Outdated
|
||
.. note:: | ||
|
||
If the `verify.yml` playbook does not explicitly `include_role` your role, the `library` and `module_utils` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RST required double backquotes, single ones render as italic instead. See https://molecule--3222.org.readthedocs.build/en/3222/getting-started.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks - yeah, I tried it with the "Edit on Github" feature but in the end writing clean RST that way isn't all too easy...
I now installed the pre-commit hooks locally and built the docs; the issues should be fixed.
As discussed in #3045, if the
verify.yml
playbook does not run the tested role, thelibrary
andmodule_utils
provided by the tested role are not available there [1].Usually, one does not want to re-run the role in the
verify.yml
playbook since it was already run twice before during the converge and idempotence stages, but testing the configuration of the server may well involve some of the modules provided by the role.One workaround suggested by @tadeboro is to add an empty task list to the role and then to restrict tasks of the role to this file when including it in the
verify.yml
playbook.This PR adds a note regarding this to the docs.
[1] The
library
actually is currently available, but this is an oversight; themodule_utils
are not available.PR Type