Scenario: The company has 10 servers need to install lamp test environment, using Saltstack to write state files for batch deployment, can improve work efficiency, reduce the possibility of human error, to ensure the consistency of the environment.Saltstack's configuration Management lamp actual case:1. Modify the master configuration file to specify the dev environment.4 ^file/etc/salt/master file_roots: base: -/srv/salt/base Dev: -/srv/salt
, then please use pillar, if it is very fixed, not changeable, please use grains . Grain and Pillar differences1.grains stores static, infrequently changing content, pillar the opposite2.grains is stored locally on Minion, while Pillar is stored in master local3.minion has permissions to manipulate its own grains values, such as additions, deletions, but Minion can only view its own pillar, not authorized to modifyRelated commands:Salt ' * ' Grains.ls # lists all keys for grainsSalt '*' grains.i
PillarPillar and grains are not the same, they are defined on the server and are some information that is defined for minion. Like some of the more important data (passwords) can exist in pillar, you can also define variables and so on.View the pillar value for the specified minion (the version I tested is empty):Salt ' client.wyp.com ' pillar.itemsConfigure custom pillar on serverVim/etc/salt/msterLocate the following configuration:Pillar_roots:Base: #空两个空格-/srv/pillar #继续空两个空格, YAML format. Fi
Saltstack study 5: the usage of return and return in the database is too much information on the internet. using return to save the result to the database online, there are already:
1. create a database on the master:
CREATE DATABASE `salt`DEFAULT CHARACTER SET utf8DEFAULT COLLATE utf8_general_ci;USE `salt`;---- Table structure for table `jids`--DROP TABLE IF EXISTS `jids`;CREATE TABLE `jids` (`jid` varchar(255) NOT NULL,`load` mediumtext NOT NULL,UN
authentication operations with the Salt-key command, as follows:
SALT-KEY-L displays an already or uncertified controlled end id,accepted keys as a certified list, unaccpetd keys as an uncertified list;
Salt-key-d Remove all authentication host ID certificates
salt-key-d ID Delete a single ID certificate
SALT-KEY-A Accept All ID certificate requests
SALT-KEY-A ID accepts a single ID certificate request
If there is a problem, you can use Salt-master-l Debug or salt-
can be used to manage, but this function method implementation needs your app directory in the tasks.py file to manually write, format reference other methods. Task scheduling is similar to Linux system crontab. The celery is used.
Add a task.When you have finished writing your task, the system automatically discovers your task name and adds it to the Discover task list. You can also add interval and crontabyourself. A task can only select one of the scheduling types interval and cro
Install saltstack install EPEL third-party software source wget-c http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmrpm-ivh epel-release-6-8.noarch.rpm install yum install salt-master-y // masteryum install salt-minion // clients chkconfig -- list | grep salt // The master listens to two ports by default, 4505 (publish_port) is the message publishing system of salt, and 4506 (ret_port) is the port on which the salt client commun
python Dynamic Variable name import Syscreatevar = locals () listtemp = range (1,10 for i in range (1 Span style= "color: #0000ff;" >print Sys.argv[i] A, b = Sys.argv[i].split ( = ) Createvar[a] = b print get= ", Get," put= ", put It is worth noting that, with the python dynamic variable name This function, the external incoming parameters can not be the same as the variable name defined inside the code, otherwise it will cause the variable cross-read error, resulting in a
Configuration Management installation ApacheOn *server:Vim/etc/salt/master #搜索找到file_roots* Open the following comment:File_roots: #总配置入口路径Base-/srv/salt/Mkdir/srv/salt;cd/srv/salt*vim/srv/salt/top.sls #加入以下内容, top for the total entrance file, the name is fixed.Base‘*‘:-Apache* means that the Apache module is executed on all clients.* Restart/etc/init.d/salt-master Restart*vim/srv/salt/apache.sls #加入以下内容, this is the contents of the Apache moduleApache-service: #只是一个名字Pkg.installed: #pkg是模块名, fo
Background requirements:Random business development, server data is also more and more, developers, operators are more and more. At this time if a large number of people need to log on to the server, then it is necessary for us to manage the user. The traditional way is to log on to each server to create a user, the work is too repetitive, if there are 1000 units to do? Even some company users do not create directly for everyone to log in as root, so that more dangerous!!!, then the smarter oper
Configuration Management Remote ScriptingVim/srv/salt/shelltest.slsShell_test:Cmd.script: #模块和函数-Source:salt://test/1.sh #脚本源路径-User:root #客户端执行者身份, can be other usersvim/srv/salt/test/1.sh#!/bin/bashTouch/tmp/111.txtif [-d/tmp/1233]Thenrm-rf/tmp/1233Elsemkdir/tmp/1233FiVim/srv/salt/top.slsBase‘*‘:-ShelltestExecute command: Salt ' client.wyp.com ' state.highstate process is a bit slow, because the script is first synchronized to the client before the client executes the script.2.8-
The McAfee Update log directory is located in C:\Program Files\Common Files\mcafee\engine\amcoreupdater\amupdate.dat
So you can execute DOS commands
CD C:\Program Files\Common Files\mcafee\engine\amcoreupdaterdir
Returned as follows:
Volume in drive C are Windows
Volume serial number is da32-cde1
Directory of C:\Program Files\Common Files\mcafee\e Ngine\amcoreupdater
2018/01/18 12:17
Can see
2018/01/18 12:17 395,164 amupdate.datIs the latest update
Saltstack execution results are saved to MySQL for command security auditsMust be an environment above python2.7Install related modulesUbuntu System InstallationApt-get install-y Python-mysqldbCentOS System InstallationYum Install-y Mysql-pythondatabase, related table creation, and account creation authorizationOfficial website: https://docs.saltstack.com/en/latest/ref/returners/all/salt.returners.mysql.html#module-salt.returners.mysqlcreate DATABASE
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.