Can't get node anchoring to work in template

I am trying to reuse some code in my template through a node anchor. I just don’t get it to work. This is the code:

  - sensor:
    - name: "NextHoliday"
      state: "OK"
      attributes: 
        dummy: &order 
          >
            {% set a = states.sensor.new_year_s_day.state | int %}
            {% set b = states.sensor.easter_sunday.state | int %}
            {% set c = states.sensor.easter_monday.state | int %}
            {% set d = states.sensor.labor_day_may_day.state | int %}
            {% set e = states.sensor.ascension_day.state | int %}
            {% set f = states.sensor.whit_sunday.state | int %}
            {% set g = states.sensor.whit_monday.state | int %}
            {% set h = states.sensor.belgian_national_day.state | int %}
            {% set i = states.sensor.assumption_of_mary.state | int %}
            {% set j = states.sensor.armistice_day.state | int %}
            {% set k = states.sensor.christmas_day.state | int %}
            {% set l = states.sensor.boxing_day.state | int %}
            {% set earliest = (a,b,c,d,e,f,g,h,i,j,k,l) | min %}
            {% if a == earliest  %}
              {% set name = state_attr('sensor.new_year_s_day', 'friendly_name') %}
              {% set date = state_attr('sensor.new_year_s_day', 'date') %}
            {% elif b == earliest  %}
             {% set name = state_attr('sensor.easter_sunday', 'friendly_name') %}
             {% set date = state_attr('sensor.easter_sunday', 'date') %}
            {% elif c == earliest  %}
              {% set name = state_attr('sensor.easter_monday', 'friendly_name') %}
              {% set date = state_attr('sensor.easter_monday', 'date') %}
            {% elif d == earliest  %}
              {% set name = state_attr('sensor.labor_day_may_day', 'friendly_name') %}
              {% set date = state_attr('sensor.labor_day_may_day', 'date') %}
            {% elif e == earliest  %}
              {% set name = state_attr('sensor.ascension_day', 'friendly_name') %}
              {% set date = state_attr('sensor.ascension_day', 'date') %}
            {% elif f == earliest  %}
              {% set name = state_attr('sensor.whit_sunday', 'friendly_name') %}
              {% set date = state_attr('sensor.whit_sunday', 'date') %}
            {% elif g == earliest  %}
              {% set name = state_attr('sensor.whit_monday', 'friendly_name') %}
              {% set date = state_attr('sensor.whit_monday', 'date') %}
            {% elif h == earliest  %}
              {% set name = state_attr('sensor.belgian_national_day', 'friendly_name') %}
              {% set date = state_attr('sensor.belgian_national_day', 'date') %}
            {% elif i == earliest  %}
              {% set name = state_attr('sensor.assumption_of_mary', 'friendly_name') %}
              {% set date = state_attr('sensor.assumption_of_mary', 'date') %}
            {% elif j == earliest  %}
              {% set name = state_attr('sensor.armistice_day', 'friendly_name') %}
              {% set date = state_attr('sensor.armistice_day', 'date') %}
            {% elif k == earliest  %}
              {% set name = state_attr('sensor.christmas_day', 'friendly_name') %}
              {% set date = state_attr('sensor.christmas_day', 'date') %}
            {% elif l == earliest  %}
              {% set name = state_attr('sensor.boxing_day', 'friendly_name') %}
              {% set date = state_attr('sensor.boxing_day', 'date') %}
            {% else %}
              n/a
            {% endif %}
            {{ earliest }}
        days: >
          *order 
          {{ earliest }}
        name: > 
          *order
          {{ name }} 
        date: > 
          *order
          {{ date }}

So the result from this is the following senor values:

dummy: 61
days: '*order'
name: '*order'
date: '*order'
friendly_name: NextHoliday

changing the last part of the template to:

       days: *order 
          {{ earliest }}
        name: *order
          {{ name }} 
        date: *order
          {{ date }}

Gives me an error in the configuraiton check:

Error loading /config/configuration.yaml: while parsing a block mapping
  in "/config/configuration.yaml", line 190, column 9
expected <block end>, but found '{'
  in "/config/configuration.yaml", line 246, column 11

Line 190 is line of: dummy: &order
and line 246 is the line of: {{ earliest }}

I am kinda at a loss how to solve this. So how do I call the &order anchor in the next option of the template?

I can’t help with node anchoring, but it’s really not needed when you can use the built-in Jinja filters and the this variable.

  - sensor:
    - name: "NextHoliday"
      state: >
        {% set holidays = expand('sensor.new_year_s_day','sensor.easter_sunday', 'sensor.easter_monday',
        'sensor.labor_day_may_day', 'sensor.ascension_day','sensor.whit_sunday', 
        'sensor.whit_monday', 'sensor.belgian_national_day', 'sensor.assumption_of_mary',
        'sensor.armistice_day', 'sensor.christmas_day', 'sensor.boxing_day') %}
        {% set ent = holidays | map(attribute='state') | map('int') | sort | first %}
        {{ holidays | selectattr('state','eq', (ent | string)) | map(attribute='entity_id') | first }}
      attributes: 
        days: >
          {{ states(this.state) }}
        name: >
          {{ state_attr(this.state, 'friendly_name') }} 
        date: > 
          {{ state_attr(this.state, 'date') }}

Perfect this worked. How node anchoring works in templates is still a mystery. Strictly repeating the template is possible and works, but if you want to add something to the option of the template it fails.