# ansible variables key:value

**URL:** <https://forum.ansible.com/t/ansible-variables-key-value/22212>\
**Category:** Ansible Project\
**Created:** [August 4, 2016, 12:42pm UTC](https://forum.ansible.com/t/ansible-variables-key-value/22212 "2016-08-04T12:42:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GBANE\_FETIGUE](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@GBANE\_FETIGUE](https://forum.ansible.com/u/GBANE_FETIGUE)\
**Post date:** [August 4, 2016, 12:42pm UTC](https://forum.ansible.com/t/ansible-variables-key-value/22212/1 "2016-08-04T12:42:08Z")

</div>

Hi guys,

I am writing a number of yaml playbook to run some JSON curl command. the first part of that JSON once run returned a response which is call versionId and applicationId. something key and value.That part 2 supposed use the value of versionId **“local$43d12cfd-f64a-4fa9-9367-3a0109c1721d” part one in the applications array of part 2. Is it possible rather than use the value** **“versionId”: “local$43d12cfd-f64a-4fa9-9367-3a0109c1721d” on applications. Something like application [“versionId”] so anytime I have a new versionId applications will pick that new value. I don’t if it makes sens. all I want to do is to make that more configurable**  
1- upload

 
**- local\_action: shell curl --basic -u admin:admin -F file=@/etc/ansible/playbooks/ms3-test-app-1.0.0-SNAPSHOT.zip -F name=ms3-test-app -F version=2.0 --header “Content-Type:multipart/form-data” “[http://52.73.56.141:8080/mmc-console-3.6.2/api/repository](http://52.73.56.141:8080/mmc-console-3.6.2/api/repository)”**

 

register: upload

 - **name: what got saved**

**and here is the response :**

 

{

“applicationId”: “local$4199473f-3106-4a13-bf4a-ae546413b689”,

“versionId”: “local$43d12cfd-f64a-4fa9-9367-3a0109c1721d”

}

**2- deploy**

**- uri:**  
**url=http://{{ mmc\_hostname}}:{{ http\_port }}/{{ mmc\_version }}/api/deployments**  
**method=POST**  
**force\_basic\_auth=yes**  
**user=admin**  
**password=admin**  
**body\_format=json**  
**status\_code=302**  
**body=‘{“name”:“ms3-simple-hello-world-app”,“servers”:[“local$d50bdc24-ff04-4327-9284-7bb708e21c25”],“applications”:[“versionId”]}’**  
**headers=Content-Type=application/json**  
**register: deployment**  
**ignore\_errors: true**  
**- name: what got saved after deployement**  
**debug: var=deployment**
