Created
September 8, 2016 15:35
-
-
Save xjoker/b010a1e0c262345425342fe3ef56e1a1 to your computer and use it in GitHub Desktop.
一键安装SaltStack并配置好SaltAPI的脚本 for CentOS 6.8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Install SaltStack " | |
yum install -y https://repo.saltstack.com/yum/redhat/salt-repo-latest-1.el6.noarch.rpm | |
yum install -y gcc python-pip python-devel openssl-devel libffi-devel | |
yum install -y salt-master salt-minion salt-api | |
pip install pyopenssl | |
echo "Create User: saltapi password: saltapi" | |
useradd -M -s /sbin/nologin saltapi | |
echo 'saltapi' | passwd --stdin saltapi | |
echo "Config..." | |
echo "id: SaltMaster" >> /etc/salt/minion | |
echo "master: 127.0.0.1" >> /etc/salt/minion | |
service salt-master start | |
service salt-minion start | |
yes | salt-key -A | |
salt-call tls.create_self_signed_cert | |
cat master_config >> /etc/salt/master | |
service salt-master restart | |
service salt-api start | |
echo "Test API" | |
sleep 5s | |
curl -k https://127.0.0.1:15599 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment