# Passing yaml to tower-cli --source-vars flag

**URL:** <https://forum.ansible.com/t/passing-yaml-to-tower-cli-source-vars-flag/28240>\
**Category:** AWX Project\
**Created:** [August 2, 2018, 5:22pm UTC](https://forum.ansible.com/t/passing-yaml-to-tower-cli-source-vars-flag/28240 "2018-08-02T17:22:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![creisor](https://avatars.discourse-cdn.com/v4/letter/c/ecc23a/32.png) [@creisor](https://forum.ansible.com/u/creisor)\
**Post date:** [August 2, 2018, 5:22pm UTC](https://forum.ansible.com/t/passing-yaml-to-tower-cli-source-vars-flag/28240/1 "2018-08-02T17:22:27Z")

</div>

I am attempting to pass this yaml to the tower-cli --source-vars flag:

---

<div class="post-metadata">

**Author:** ![creisor](https://avatars.discourse-cdn.com/v4/letter/c/ecc23a/32.png) [@creisor](https://forum.ansible.com/u/creisor)\
**Post date:** [August 2, 2018, 5:52pm UTC](https://forum.ansible.com/t/passing-yaml-to-tower-cli-source-vars-flag/28240/2 "2018-08-02T17:52:01Z")

</div>

I answered my own question: don’t use YAML, use JSON. E.g.:

`  
tower-cli inventory\_source modify -n OlympusInventory.py -i BER1 --source scm --source-vars=“{"INVENTORY\_SAFEGUARD": "disabled","INVENTORY\_QUERY":"datacenter.name=ber1 AND os=centos","INVENTORY\_LIMIT":"0"}” --overwrite true --update-on-launch true --update-cache-timeout 300 --source-project olympus\_inventory --source-path ‘OlympusInventory.py’

`

---

<div class="post-metadata">

**Author:** ![creisor](https://avatars.discourse-cdn.com/v4/letter/c/ecc23a/32.png) [@creisor](https://forum.ansible.com/u/creisor)\
**Post date:** [August 2, 2018, 6:19pm UTC](https://forum.ansible.com/t/passing-yaml-to-tower-cli-source-vars-flag/28240/3 "2018-08-02T18:19:06Z")

</div>

Sorry for the churn, but that should be single-quoted:

`tower-cli inventory_source modify -n OlympusInventory.py -i BER1 --source scm --source-vars='{\"INVENTORY_SAFEGUARD\": \"disabled\",\"INVENTORY_QUERY\":\"datacenter.name=ber1 AND os=centos\",\"INVENTORY_LIMIT\":\"0\"}' --overwrite true --update-on-launch true --update-cache-timeout 300 --source-project olympus_inventory --source-path 'OlympusInventory.py'`
