Открыл для себя циклические зависимости в ансибле! Можно смело уходить на выходные.
В общем, если сделать так:
node:
unit:
name: node-01
service: "{{ node.unit.name }}.service"
path: /etc/systemd/system/
full: "{{ node.unit.path }}/{{ node.unit.service }}"
drop-in:
name: 10-drop-in.conf
path: "{{ node.unit.path }}/{{ node.unit.name }}.d"
full: "{{ node.drop-in.path }}/{{ node.drop-in.name }}"
мы получим:
Error was a <class 'ansible.errors.AnsibleError'>, original message: recursive loop detected in template string: {{ victoria_single_node.unit.name }}.service. maximum
recursion depth exceeded while calling a Python object
В итоге, пришлось разбивать на два словаря. Не так красиво как изначально, но хотя бы работает.