master 192.168.23.50
client 192.168.20.208
##start
第一 添加RPM源
#6系列
rpm -ivh http://mirrors.aliyun.com/epel/6/x86_64/epel-release-6-8.noarch.rpm
#rpm -ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
#7
rpm -ivh http://mirrors.aliyun.com/epel/7/x86_64/e/epel-release-7-7.noarch.rpm
#5系列
wget http://mirrors.sohu.com/fedora-epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -ivh epel-release-5-4.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL #导入密钥
yum info salt
*******************************************
第二 on master
useradd salt
yum install salt-master -y
vi /etc/salt/master
# The address of the interface to bind to
interface: masterip #前面要有两个空格
# The tcp port used by the publisher
publish_port: 4505#前面要有两个空格
#自动认证
auto_accept: True
# The user to run the salt-master as. Salt will update all permissions to
# allow the specified user to run the master. If the modified files cause
# conflicts set verify_env to False.
user: root
# interface used for the file server, authentication, job returnes, etc.
ret_port: 4506#前面要有两个空格
*******************************************
CentOS5.6配置salt节点minion
http://zhoulg.blog.51cto.com/48455/1140186
第三 client
useradd salt
yum install salt-minion -y
vi /etc/salt/minion
#编辑11行:#master: salt
master: masterip
master: 192.168.23.50
配置key 和试用
在master端通过salt-key -L查看Keys如下:
[root@vm1 test]# salt-key -L
Accepted Keys:
Unaccepted Keys:
test1
Rejected Keys:
[root@vm1 test]# salt-key -A
Key for minion test1 accepted.
[root@vm1 test]# salt 'test1' test.ping
test1:
True
常用命令
1)检查master与minion的连接状态:salt '*' test.ping or salt 'test1' test.ping
2)远程执行命令:salt '*' cmd.run 'ls /root'
test1:
anaconda-ks.cfg
bootstrap-salt.sh
install.log
install.log.syslog
vm2
3)从master上传文件至minion:
salt-cp nodeid source_file target_file
例子:salt-cp 'vm01' /root/test/bootstrap-salt.sh /root
4)master同步命令:
salt '*' state.highstate
To have the Minion start automatically at boot time:
chkconfig salt-minion on
#7
systemctl enable salt-minion.service
to start the Minion:
#7
systemctl start salt-minion.service
https://docs.saltstack.com/en/latest/topics/installation/rhel.html
#所有内置模块
http://docs.saltstack.com/ref/modules/all/index.html
http://wiki.saltstack.cn/modules/all
常用内置模块
[root@vm3 ~]# salt 'vm0' pkg.install w3m
vm0:
———-
gpg-pubkey:
———-
new:
217521f6-45e8a532,e8562897-459f07a4
old:
217521f6-45e8a532
w3m:
———-
new:
0.5.1-18.el5
old:
问题1
[root@localhost soft]# yum install python-jinja2
Loaded plugins: fastestmirror, security
Determining fastest mirrors
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
编辑/etc/yum.repos.d/epel.repo和/etc/yum.repos.d/epel-testing.repo
将mirrorlist注释,将baseurl打开
问题2:
file /usr/lib64/python2.6/zipfile.pyo from install of python-libs-2.6.6-64.el6.x86_64 conflicts with file from package python-2.6.6-29.el6_2.2.x86_64
64 conflicts with file from package python-2.6.6-36.el6.x86_64
Error Summary
升级下python版本
yum update python or yum install python
saltstack学习—快速安装
http://www.diyoms.com/automation/1690.html
官方文档
install
http://docs.saltstack.com/topics/installation/rhel.html
##总的
http://docs.saltstack.com/topics/installation/index.html
configure
http://docs.saltstack.com/topics/configuration.html
SaltStack installation on Centos 7
更加详细的配置
Configuring the Salt Master
http://docs.saltstack.com/ref/configuration/master.html
Configuring the Salt Minion
http://docs.saltstack.com/ref/configuration/minion.html
CentOS7.2系统环境中安装saltstack详细配置过程讲解
Python自动化运维 ,这个不错,从用fabric 批量 salt开始呢
http://opython.com/?cat=4
http://blog.sina.com.cn/s/blog_7f1737720101ebzg.html
深入SaltStack(转)
http://blog.sina.com.cn/s/blog_7f1737720101ebz9.html
http://blog.halfss.com/blog/2013/06/15/saltxiang-guan-shi-yong/
Salt stack first sls 文件
http://blog.csdn.net/qingchn/article/details/8752004
Salt实战之自动安装部署MooseFS
http://blog.csdn.net/shanliangliuxing/article/details/8986731
Centos 6.4安装SaltStack 有酷酷的防火墙写法
参考资料
salt的安装部署
http://zhengbin.blog.51cto.com/2989505/1229884
salt基础命令
http://zhengbin.blog.51cto.com/2989505/1229891
salt-minion,salt-master,multi master
http://www.cnblogs.com/taosim/articles/3598919.html