Added salt-master state

and reactor for rfxcom
This commit is contained in:
=
2020-12-25 13:18:47 +01:00
parent ab5a894780
commit 4b9e15a9e5
5 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
reactor:
- 'salt/beacon/*/inotify//dev':
- /srv/reactor/device_reactor.sls

View File

@@ -0,0 +1,16 @@
{% set label = data['path'].split('/')[-1] -%}
{% if label in ['rfxtrx433'] -%}
{% 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 -%}