# How to make global variables for a short playbook?

**URL:** <https://forum.ansible.com/t/how-to-make-global-variables-for-a-short-playbook/22353>\
**Category:** Ansible Project\
**Created:** [August 23, 2016, 5:56am UTC](https://forum.ansible.com/t/how-to-make-global-variables-for-a-short-playbook/22353 "2016-08-23T05:56:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mcnilla](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@Mcnilla](https://forum.ansible.com/u/Mcnilla)\
**Post date:** [August 23, 2016, 5:56am UTC](https://forum.ansible.com/t/how-to-make-global-variables-for-a-short-playbook/22353/1 "2016-08-23T05:56:40Z")

</div>

Hi, I want to share global variables for a short playbook. The problem is, I need to run some commands on all hosts, then some commands on one node, then some commands on all nodes again. I don’t want to repeat with\_vars for every play, like I did here (code below) and I don’t want to create a role for a short task. How do I avoid repeating “kubernetes\_from\_version” and “kubernetes\_to\_version”?
