question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing property "key_value" with Ansible Set_Fact

See original GitHub issue

Right now while using ansible for example you will get an error of MIssing Property “key_value” when using any format of the set_fact module in yaml. You can reproduce this by taking any example from https://docs.ansible.com/ansible/latest/modules/set_fact_module.html for example:

- set_fact:
    one_fact: something
    other_fact: "{{ local_var * 2 }}"
    cacheable: yes

it shouldn’t be throwing that error especially since the syntax is correct.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:20
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
JPinkneycommented, Nov 17, 2020

could you please clarify what you mean by it’s a bug in schemastore

The ansible schema in the schemastore just isn’t totally correct as far as I can tell. Since we pull in schemas from the schemastore automatically if a schema is wrong there then it will be wrong inside of VSCode as well.

I’m not sure which specific ansible schema is being used in the original issue but the schemas for ansible are located here in the repo: https://github.com/SchemaStore/schemastore/tree/master/src/schemas/json. It looks like it contains schemas for ansible 2.0 to 2.9

If you open a bug on the schema store and they end up fixing it then the changes will automatically be propagated to the extension once you restart VSCode

Read more comments on GitHub >

github_iconTop Results From Across the Web

set_fact - Missing property "key_value" · Issue #261
VS Code wrongly shows an error where set_fact is properly formatted and it doesn't need a "key_value" property. Reproduce steps. - name: Load...
Read more >
Ansible - How to keep appending new keys to a dictionary ...
I want a single dictionary with all the keys. Code: --- - hosts: localhost connection: local vars: some_value: 12345 dict: {} tasks: -...
Read more >
ansible.builtin.set_fact module – Set host variable(s) and ...
The set_fact module takes key=value pairs or key: value (YAML notation) as variables to set in the playbook scope. The 'key' is the...
Read more >
Changing a deeply-nested dict variable in an Ansible ...
- name: Change animals.birds.cardinals.feathers to "red". set_fact: animals: "{{ animals|combine({'birds': {'cardinals ...
Read more >
Is there a way to check that a dictionary key is not defined ...
The error was: error while evaluating conditional (me.cool): 'dict object' has no attribute 'cool'. ansible · ansible-playbook · conditional.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found