Table of Contents
Ansible Development
Module
Testing
Test single role
I'm using a combination of tags and –limit. I tag roles at the play level:
- hosts: db
roles:
- {name: common, tags: common}
- {name: postgresql, tags: postgresql}
And then use “ansible-playbook -i staging/inv -l db –tags postgresql” to only run that one role.
On the other hand, do you really want to run only that new role, and whole of it? It might be enough to just use –limit, or you might want to use more tags inside role (I'm using “bbb” for trying only some tasks when debugging).