Salt installation and use of some notes

Source: Internet
Author: User

Installation Script install_salt.sh:

#!/bin/bash
# # #安装第三方yum源
RPM-UVH http://ftp.linux.ncsu.edu/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# # #更新系统证书模块和python到最新版本
Yum Upgrade Ca-certificates--disablerepo=epel-y
Yum Update python-y
# #服务端安装
# #yum Install Salt-master-y
# #客户端安装
Yum Install Salt-minion-y
# #替换默认的master服务器IP
#sed-i ' s/#master: salt/master:10.100.60.52/g '/etc/salt/minion
#修改id号
#sed-i ' s/#id:/id:lcb-p-wbs02-60.4/g '/etc/salt/minion
#/etc/init.d/salt-minion start

Examples of some common commands used:

Issuance of documents to the development machine (note, download_bag.sh in the root of the salt, the default/srv/salt, can also be changed by itself)
Salt ' * ' Cp.get_file salt://download_bag.sh/home/deployer/scripts/download_bag.sh
Modify file Permissions
Salt ' * ' cmd.run ' cd/home/deployer/scripts; Chown deployer:deployer *;chmod 755 * '

Remote execution of local script, return log (configuration details, Salt-master server/srv/salt directory)
Example: Salt ' lcb-u-touch02-123 ' State.sls touch-webapp/download_bag
TOP.SLS configuration:
Base
‘*‘:
-Touch-webapp/download_bag.init

Download_bag.init Configuration: Vi/srv/salt/touch-webapp/download_bag/init.sls
Shell_download:
Cmd.script:
-source:salt://touch-webapp/download_bag/download_bag.sh
-mode:755
-User:deployer
~

Salt installation and use of some notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.