三、salt-ssh
可以独立运行,不需要minion。
用的是sshpass进行密码交互。
以串行模式工作,性能下降。
[root@server2 salt]# systemctl stop salt-minion
[root@server1 ~]# yum install -y salt-ssh
[root@server1 ~]# cd /etc/salt/
[root@server1 salt]# ls
cloud cloud.deploy.d cloud.profiles.d master minion pki proxy.d
cloud.conf.d cloud.maps.d cloud.providers.d master.d minion.d proxy roster
[root@server1 salt]# vim roster
[root@server1 salt]# cat roster
# Sample salt-ssh config file
#web1:
# host: 192.168.42.1 # The IP addr or DNS hostname
# user: fred # Remote executions will be executed as user fred
# passwd: foobarbaz # The password to use for login, if omitted, keys are used
# sudo: True # Whether to sudo to root, not enabled by default
#web2:
# host: 192.168.42.2
server2:
host: 172.25.1.2
user: root
passwd: westos
[root@server1 ~]# salt-ssh server2 test.ping