The YAML anchors to name a reusable section are defined by &name
and then to use them to replace the value of something you do *name
, if you want to “unsplat”/merge a dictionary/object then use <<: *name
and then it’ll insert it at that point.
world: &world World
example: &example-anchor
HELLO: *world
There: Yo
my-values:
<<: *example-anchor
foo: bar
becomes
---
example:
HELLO: World
There: Yo
my-values:
HELLO: World
There: Yo
foo: bar