On Fri, 17 Aug 2012, Michael DeHaan wrote:
>>
>>
>> If anyone wants to work on enhancing this - I'd love for it to take a
>> playbooks path and look for any other playbook referencing this playbook
>> and traversing those for hosts as well.
>
>
> I actually don't think that should be in core that way, but could be
> another script on top that calls this as is, yeah.
I agree.
> You could list the playbook files in the git diff, find all the playbook
> files in the diff, and run ansible-playbook --list-hosts on all of them,
> I'd think.
>
> You would want to make sure something was a playbook and not a task list
> or it might not work great though. This might need be a bit of a fuzzy
> match, unless you have the convention of putting all your tasks and
> handler file includes in a "tasks/" directory or something (which is a
> good idea anyway).
>
I was thinking of parsing the playbook into 'plays' then saying 'if this
play has no hosts: section then it is only included by other playbooks'
and then go looking for that filename in a tree of playbooks.
I think that would work.... not sure.
-sv