MENU

Catalog

saltstack - 用户和组管理

主机分组

cat /etc/salt/master.d/nodegroups.conf

#主机分组
nodegroups:
   web: 'E@nginx or E@web'
  # mongo: 'E@mongo*'
  # redis_and_mongo: 'E@mongodb and  E@redis'
   tomcat: 'E@data- or E@gateway or E@core- '
   nodejs: 'E@xidianpre or E@sec-'
   apps: ' * and not web-*'
   #salt -N apps test.ping #检测应用虚拟机

   not_centos7: 'G@os:CentOS and not N@centos7'
   centos7: 'G@os:CentOS and G@osmajorrelease:7'
   #salt -N centos6 test.ping #检测centos6组
   # salt   -E "web-1"  grains.ls
   # salt   -E "web-1"  grains.items
   # salt   -E "web-1"  grains.get  "os"
salt -N "zk" test.ping
#测试zk组
Tags: None
Archives QR Code
QR Code for this page
Tipping QR Code
Leave a Comment