# Running a master playbook against different hosts

**URL:** <https://forum.ansible.com/t/running-a-master-playbook-against-different-hosts/34299>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [December 8, 2020, 1:40pm UTC](https://forum.ansible.com/t/running-a-master-playbook-against-different-hosts/34299 "2020-12-08T13:40:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcpetro](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jcpetro](https://forum.ansible.com/u/jcpetro)\
**Post date:** [December 8, 2020, 1:40pm UTC](https://forum.ansible.com/t/running-a-master-playbook-against-different-hosts/34299/1 "2020-12-08T13:40:07Z")

</div>

Hey everyone. We are having a weird problem trying to get something to work, so I thought I might ask the question. We have two playbooks, one that deploys a virtual machine in vmware, using the vsphere\_guest module. This playbook, is run using connect\_local. We then have a second playbook, that does all the initial setup stuff we need for teh host that was just deployed.

What we would like to do, is have something like a main.yml that calls both playbooks. Is there a way to do this, and pass the newly created hostname to the second host so that it runs against that host?

Basically, the goal, is to run a single playbook, that creates the VM, then performs all the host specific tasks to the new host.

We have tried setting the hostname as a variable over to the setup playbook, but ansible doesn’t seem to be happy with that one.

Any thoughts here would be greatly appreciated.

–John
