# Update local vars

**URL:** <https://forum.ansible.com/t/update-local-vars/23126>\
**Category:** Ansible Project\
**Created:** [November 29, 2016, 3:37pm UTC](https://forum.ansible.com/t/update-local-vars/23126 "2016-11-29T15:37:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aleksey\_Ezhov](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Aleksey\_Ezhov](https://forum.ansible.com/u/Aleksey_Ezhov)\
**Post date:** [November 29, 2016, 3:37pm UTC](https://forum.ansible.com/t/update-local-vars/23126/1 "2016-11-29T15:37:34Z")

</div>

Hello.  
how to update the local vars, after receiving the input parameter  
example:

roles/new/vars/main.yaml  
list:

- name: service1  
pckg: namepckg  
version: trunk

- name: service2  
pckg: namepckg  
version: trunk

run playbook start.yaml

- hosts: somehost  
remote\_user: ansible  
connection: ssh  
become: yes  
gather\_facts: nj  
vars:  
revision: “tags-2.6”  
roles:
- new

I want to update vars pckg for service2 and/or service1 (use with\_subelements) to a value revision

should get

- name: service1  
pckg: namepckg  
version: tags-2.6

- name: service2  
pckg: namepckg  
version: tags-2.6

how to do it?
