Update local vars

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?