# Over riding host in playbook

**URL:** <https://forum.ansible.com/t/over-riding-host-in-playbook/12247>\
**Category:** Ansible Project\
**Created:** [January 24, 2013, 11:24pm UTC](https://forum.ansible.com/t/over-riding-host-in-playbook/12247 "2013-01-24T23:24:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kavin](https://avatars.discourse-cdn.com/v4/letter/k/ba8739/32.png) [@Kavin](https://forum.ansible.com/u/Kavin)\
**Post date:** [January 24, 2013, 11:24pm UTC](https://forum.ansible.com/t/over-riding-host-in-playbook/12247/1 "2013-01-24T23:24:07Z")

</div>

Hi,

I guess i have a relatively simple question, which i could not find a way to do. Currently I always need to edit my playbook file to specify the host group to run it for.

Is it possible to override the host specified in the file, from command line when i call the playbook ? What i am planning to do is publish playbooks internally which everyone can use just override hosts and maybe pass an argument for a file or something which the playbook will take and send it to all hosts.

Thanks for the help !!

---

<div class="post-metadata">

**Author:** ![Jeremiah\_Heller](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Jeremiah\_Heller](https://forum.ansible.com/u/Jeremiah_Heller)\
**Post date:** [January 24, 2013, 11:27pm UTC](https://forum.ansible.com/t/over-riding-host-in-playbook/12247/2 "2013-01-24T23:27:59Z")

</div>

You can pass vars from the command line via --extra-vars=“var1=blah”

[http://ansible.cc/docs/playbooks2.html#passing-variables-on-the-command-line](http://ansible.cc/docs/playbooks2.html#passing-variables-on-the-command-line)

HTH,

- Jeremiah

---

<div class="post-metadata">

**Author:** ![Kavin](https://avatars.discourse-cdn.com/v4/letter/k/ba8739/32.png) [@Kavin](https://forum.ansible.com/u/Kavin)\
**Post date:** [January 24, 2013, 11:59pm UTC](https://forum.ansible.com/t/over-riding-host-in-playbook/12247/3 "2013-01-24T23:59:26Z")

</div>

Awesome!! Thanks, dont know how i missed it, Should read again …

---

<div class="post-metadata">

**Author:** ![Jeremiah\_Heller](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Jeremiah\_Heller](https://forum.ansible.com/u/Jeremiah_Heller)\
**Post date:** [January 25, 2013, 12:02am UTC](https://forum.ansible.com/t/over-riding-host-in-playbook/12247/4 "2013-01-25T00:02:55Z")

</div>

Happy to help! This development on this project is awesomely fast-paced, I find something new every time I come back to it.
