我是以ip地址作为minion的id,这样在master上管理的时候,一目了然的知道是哪台minion。要是有dns的支持就更好了,直接规范主机名。
编辑master的配置文件:
加入一行:default_include: include/group.conf
编辑default_include: include/group.conf:
nodegroups:
lvs: ‘L@192.168.122.102,192.168.122.103‘
dns: ‘L@192.168.122.100‘
之后在命令行可以这样执行:
salt -N lvs test.ping
salt -N lvs test.ping
salt-cp -N lvs /var/www/html/soft/lvs/install_lvs.sh /tmp/install_lvs.sh
interface: 0.0.0.0
publish_port: 4505
user: root
worker_threads: 5
ret_port: 4506
root_dir: /
pki_dir: /etc/salt/pki/master
keep_jobs: 24
timeout: 5
state_top: top.sls
file_roots:
base:
– /srv/salt
pillar_roots:
base:
– /srv/pillar
log_file: /var/log/salt/master
log_level: warning
default_include: include/group.conf
nodegroups:
lvs: ‘L@192.168.122.102,192.168.122.103‘
dnsmasq: ‘L@192.168.122.100,192.168.122.101,192.168.122.102,192.168.122.103‘
————
dnsmasq mypkgs myscript top.sls
base:
‘dnsmasq‘:
– match: nodegroup
– dnsmasq
‘lvs‘:
– match: nodegroup
– myscript.lvs
—
本文出自 “创者思” 博客,请务必保留此出处http://strongit.blog.51cto.com/10020534/1736302
原文地址:http://strongit.blog.51cto.com/10020534/1736302