您的位置 首页 站长运营

yum安装salt

yum-yinstallepel-release主:yuminstall-ysalt-mastersalt-minion奴才:yuminstall-ysalt-minionchkc…

yum-yinstallepel-release主:yuminstall-ysalt-mastersalt-minion奴才:yuminstall-ysalt-minionchkconfigsalt-masteronchkconfigsalt-miniononvim/etc/salt/minionmaster:192.168.106.133(主的ip)servicesalt-masterstartservicesalt-minionstart主:salt-key-a192*测试:[root@localhostmaster]#salt'*'test.ping192.168.106.134:True192.168.106.133:True[root@localhostmaster]#salt'*'cmd.run'df'192.168.106.134:Filesystem1K-blocksUsedAvailableUse%Mountedon/dev/mapper/cl-root178114561394608164168488%/devtmpfs49319204931920%/devtmpfs504196125041841%/dev/shmtmpfs50419669044972922%/runtmpfs50419605041960%/sys/fs/cgroup/dev/sda1103833614174489659214%/boottmpfs10084001008400%/run/user/0192.168.106.133:Filesystem1K-blocksUsedAvailableUse%Mountedon/dev/mapper/cl-root178114561395972164154848%/devtmpfs49319204931920%/devtmpfs504196165041801%/dev/shmtmpfs50419668804973162%/runtmpfs50419605041960%/sys/fs/cgroup/dev/sda1103833614174489659214%/boottmpfs10084001008400%/run/user/0

使用:

vim/etc/salt/masterfile_roots:base:-/srv/saltmkdir-p/srv/saltservicesalt-masterrestartvim/srv/salt/apache.slsapache-install:pkg.installed:-names:-httpd-httpd-develapache-service:service.running:-name:httpd-enable:True-reload:Truesalt'*'state.slsapache192.168.106.134:----------ID:apache-installFunction:pkg.installedName:httpdResult:TrueComment:Packagehttpdisalreadyinstalled.Started:18:00:36.804167Duration:544.478msChanges:----------ID:apache-installFunction:pkg.installedName:httpd-develResult:TrueComment:Packagehttpd-develisalreadyinstalled.Started:18:00:37.348794Duration:0.355msChanges:----------ID:apache-serviceFunction:service.runningName:httpdResult:TrueComment:Servicehttpdisalreadyenabled,andisinthedesiredstateStarted:18:00:37.349596Duration:151.231msChanges:Summary------------Succeeded:3Failed:0------------Totalstatesrun:3192.168.106.133:----------ID:apache-installFunction:pkg.installedName:httpdResult:TrueComment:Packagehttpdisalreadyinstalled.Started:18:00:36.811434Duration:552.655msChanges:----------ID:apache-installFunction:pkg.installedName:httpd-develResult:TrueComment:Packagehttpd-develisalreadyinstalled.Started:18:00:37.364243Duration:0.372msChanges:----------ID:apache-serviceFunction:service.runningName:httpdResult:TrueComment:Servicehttpdisalreadyenabled,andisinthedesiredstateStarted:18:00:37.365119Duration:151.479msChanges:Summary------------Succeeded:3Failed:0------------Totalstatesrun:3[root@localhostsalt]#

本文来自网络,不代表24小时课堂在线立场,转载请注明出处:https://www.24ketang.cn/42637.html

为您推荐

返回顶部