I have a YAML file which has several different keys that I want to provide the same value for. Additionally, I want this value to be easily configurable.
See YAML for my specific use-case below:
---
# Options for attribute_value
att_value_1: &att_value_1
att_value_2: &att_value_2
# There could be more options...
# This is where the constant is being set.
attribute_value: &attribute_value *att_value1
items:
- name: item1
attributes:
attribute_for_item1: *attribute_value
- name: item2
attributes:
attribute_for_item2: *attribute_value
Here is a simplified YAML which demonstrates the problem:
---
foo: &foo "Hello World!"
bar: &bar *foo
Error (it's complaining about the first line that has "Hello World!" on it):
(<unknown>): did not find expected key while parsing a block mapping at line 2 column 1
I expect the value to propagate.