Closed asmartin closed 10 years ago
@asmartin, you should be able to add options to ansible-playbook
already. For example: assert_playbook_runs -t foo
. That happily passes along any arguments to ansible-playbook
.
Can you provide me with a full example of the second issue? Exact role names and a sample test script if needed, also how you're running it would be a plus too. Thanks.
Thanks, I did not know about that functionality with assert_playbook_runs
.
Regarding the multiple tests issue, I have my tests structured like this:
rootdir/
roles/ - all roles inside of here
tests/ - all tests inside of here
I then run rolespec -r <role>
from within the rootdir. I have several different roles for nginx:
nginx
as a dependent role and also installs and configures php5-fpmnginx
as a dependent role and also installs SSL certificates and configures a virtualhost listening on port 443Thus if I want to create a test for the nginx
role, the grep change in 97cd2d0 prevents it from matching nginx, nginx-php, and nginx-ssl when running rolespec. Without this change, I get this error:
# rolespec -r nginx
Test script not found:
/root/tests/nginx
nginx-php
nginx-ssl/test
Hmm, interesting. We have a few roles with a similar naming convention in DebOps and I haven't ran into that issue.
Can you submit a new PR with just the regex fix? Going to close this one, and I'll merge in your upcoming PR. Thanks for fixing it.
Hello,
This pull request makes the following changes:
ROLESPEC_ANSIBLE_OPTS
which allows you to pass additional options toansible-playbook
. For example, this could be useful to skip certain tags or pass along the vault passwordrolespec -r <role>
Thanks,
Andrew