I’m working on a playbook to deploy an internal application to internal hosts. This application is delivered by development to QA in a *.tar.gz file. The file is staged and deployed to QA (by me) in that *.tar.gz file. What I would like/am thinking of is something like:
Haven’t checked this, but I think you can have multiple sections in a playbook with different hosts. Maybe not.
Try
hosts: localhost
…
hosts: something_else
…
I assume (always dangerous) that if it works at all the hosts sections would be processed in order, so you could rely on the localhost stuff happening first.
I think what you’re looking for is the ‘delegate_to’ task parameter. If you wanted the local action to only run once you can combine this with the ‘run_once’ task parameter – for your example