salt reactor 自動完成Minion的證書簽發和根據不同的業務完成不同states配置
阿新 • • 發佈:2017-08-18
salt reactor
cat /etc/salt/master file_roots: base: - /srv/salt/base prod: - /srv/salt/prod interface: 192.168.1.100 reactor: - ‘salt/auth‘: - /srv/reactor/Minion.sls - ‘salt/minion/Minion/start‘: - /srv/reactor/auto.sls
auto.sls run_state: local.state.sls: - tgt: {{ data[‘id‘] }} - arg: - shencan run_init: local.cmd.run: - tgt: {{ data[‘id‘] }} - arg: - echo initsok >>/tmp/cpis Minion.sls {% if ‘act‘ in data and data[‘act‘] == ‘pend‘ %} minion_add: wheel.key.accept: - match: {{ data[‘id‘] }} {% endif %} shencan.sls 這個位置/srv/salt/base /tmp/example: file.managed: - source: salt://example
cat minion master: 192.168.1.100 id: Minion
客戶端啟動後自動簽發
具體看書
http://www.51niux.com/?id=120 SaltStack系列(五)之各種組件
https://docs.saltstack.com/en/latest/topics/reactor/
本文出自 “要有夢想,萬一實現了呢” 博客,請務必保留此出處http://szgb17.blog.51cto.com/340201/1957214
salt reactor 自動完成Minion的證書簽發和根據不同的業務完成不同states配置