{% set label = data['path'].split('/')[-1] -%} {% if label in ['rfxtrx433', 'zwave'] -%} {% if data['change'] == 'IN_CREATE' -%} {% set label = label + '=true' -%} {% else %} {% set label = label +'-' -%} {% endif -%} {% set node = data['id'].split('.')[0] -%} label_k3s_node_{{ node }}: local.state.single: - tgt: masters - tgt_type: nodegroup - args: - fun: cmd.run - name: "kubectl label node {{ node }} {{ label }}" {% endif -%}