This repository has been archived on 2023-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
salt-states_old/salt-master/files/srv/reactor/device_reactor.sls
2020-12-25 17:05:06 +01:00

17 lines
460 B
Plaintext

{% 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 -%}