# vscode syntax highlighting

**URL:** <https://forum.ansible.com/t/vscode-syntax-highlighting/34960>\
**Category:** Ansible Project\
**Created:** [April 11, 2021, 7:20pm UTC](https://forum.ansible.com/t/vscode-syntax-highlighting/34960 "2021-04-11T19:20:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Warren](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@Matt\_Warren](https://forum.ansible.com/u/Matt_Warren)\
**Post date:** [April 11, 2021, 7:20pm UTC](https://forum.ansible.com/t/vscode-syntax-highlighting/34960/1 "2021-04-11T19:20:04Z")

</div>

I recently got around to uninstalling the old [MS ansible extension](https://marketplace.visualstudio.com/items?itemName=vscoss.vscode-ansible) and installing the [new one](https://marketplace.visualstudio.com/items?itemName=zbr.vscode-ansible). First thing I noticed is the syntax highlighting seems weaker. I’ve had all sorts of ansible and yaml extensions installed, so I’m not sure if it’s me and my config or features yet to be implemented.

Is there schema config I’m missing?

The old one:

 ![ms-ansible.png](https://us1.discourse-cdn.com/ansible/original/2X/3/3746436e4a0d83120c31fc52e2ef9df6a81dee26.png)

the new one:

 ![new-ansible.png](https://us1.discourse-cdn.com/ansible/original/2X/e/e7a1850e58750dd7c5b4850767abefa1c3a10afc.png)

---

<div class="post-metadata">

**Author:** ![Govind\_C](https://avatars.discourse-cdn.com/v4/letter/g/ed8c4c/32.png) [@Govind\_C](https://forum.ansible.com/u/Govind_C)\
**Post date:** [April 12, 2021, 2:58am UTC](https://forum.ansible.com/t/vscode-syntax-highlighting/34960/2 "2021-04-12T02:58:20Z")

</div>

I am trying to do the following.  
I have a variable yaml

eg:  
group\_vars.yml  
G1:

- groupname: A  
G2:
- groupname: B  
G3:
- groupname: C  
G4:
- groupname: D

I have this task and I want to pass just the G1 and G2 as extra\_vars to the “groups\_name” from the command line. How do I go about doing it?

- include\_vars: group\_vars.yml
- name: Create Group(s)

group:

name: “{{ item.groupname }}”

state: present

with\_items:

- “{{groups\_name}}”

Cheers

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [April 12, 2021, 3:52am UTC](https://forum.ansible.com/t/vscode-syntax-highlighting/34960/3 "2021-04-12T03:52:21Z")

</div>

> group\_vars.yml  
> G1:  
> - groupname: A  
> G2:  
> &nbsp;&nbsp;- groupname: B  
> G3:  
> - groupname: C  
> G4:  
> - groupname: D
> 
> ... pass just the G1 and G2 as extra\_vars to "groups\_name" from the command line.  
> - include\_vars: group\_vars.yml  
> - name: Create Group(s)  
> &nbsp;&nbsp;group:  
> &nbsp;&nbsp;&nbsp;&nbsp;name: "{{ item.groupname }}"  
> &nbsp;&nbsp;&nbsp;&nbsp;state: present  
> &nbsp;&nbsp;with\_items:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- "{{groups\_name}}"

Put the data into dictionaries, e.g.

&nbsp;&nbsp;\> cat group\_vars.yml  
&nbsp;&nbsp;G1:  
&nbsp;&nbsp;&nbsp;&nbsp;groupname: A  
&nbsp;&nbsp;G2:  
&nbsp;&nbsp;&nbsp;&nbsp;groupname: B  
&nbsp;&nbsp;G3:  
&nbsp;&nbsp;&nbsp;&nbsp;groupname: C  
&nbsp;&nbsp;G4:  
&nbsp;&nbsp;&nbsp;&nbsp;groupname: D

Include the variables into a dictionary and extract the keys, e.g.

&nbsp;&nbsp;&nbsp;&nbsp;- include\_vars:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file: group\_vars.yml  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: d1  
&nbsp;&nbsp;&nbsp;&nbsp;- debug:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg: "{{ item.groupname }}"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loop: "{{ groups\_name|  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default()|  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;map('extract', d1)|  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list }}"

The command

&nbsp;&nbsp;\> ansible-playbook pb.yml -e '{"groups\_name": ["G1","G2"]}'

should give

&nbsp;&nbsp;msg: A  
&nbsp;&nbsp;msg: B

If you have to keep the data in the lists select the the first item

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg: "{{ item.0.groupname }}"
