View the list of modules supported by the host minion001Sys.list_modules[[email protected] ~]# salt ' minion001 ' sys.list_modulesminion001: - acl - aliases - alternatives - apache - archive - at - blockdev - bridge -
When we study the executable module, we find that many of our modules are well-established, which can help us to do our daily work, and write our own record operation:1, using Salt.clien Invoke interface Operation Example:>>> Import Salt.client>>>
Because the salt component is more dependent on installation, it is best to use the Yum source installation (not recommended for source installation). Because the test environment is limited, the network cannot be used, so the experiment is more
SLS File compilation[[email protected] ~]# vim /etc/salt/master# adds the following in the master profile File_roots: base: - /srv/salt[[email protected] ~]# mkdir -p /srv/salt[[
Bulk Add Users[email protected] init]# cat Useradds.sls{% Set users = [' name1,name2 ']%}{% for user in users%}{{User}}:User.present:-Shell:/bin/bash-Home:/home/{{User}}-Password: ' $1$sbvwg7.v$r/nwds7g0yynb1cvsfupa/'-Groups:-{{User}}-Require:-Group:
I've seen it for a long time. Pillar This component, search a lot, still do not understand the role of this component, probably I understand, pillar this component is more flexible, can define their own minion information, can also combine Jinjia.On-
Job management and runner of SaltstackConfiguration file/etc/salt/masterCachedir:/var/cache/salt/master # cache path keep_jobs:24 # Job Save timeSalt Execution Module Official document
First, salt execution results are returned by default to master side 1, job cacheStorage location# directory to store job and cache data:# This directory may contain sensitive data and should be protected accordingly.##
How to use the Jinja templates:1. File status using template parameter-Template:jinja2, template file inside variable use {{name}}, for example {{PORT}}Variable using grains:{{grains[' FQDN_IP4 '}}Variable using execution module: {{salt[' network.hw_
3. Configuration Managementon the server:vim/etc/salt/master//Search Find File_rootsOpen a comment that reads:file_roots:Base:-/srv/saltMkdir/srv/saltCd/srv/saltVim/srv/salt/top.sls//Add the following:Base:' * ':-ApacheThis means that the Apache
Not all of the options for the master and Minion end profiles are described here, but rather the usual ones.I. Description ofMaster Common configuration optionsCat/etc/salt/master
Interface : Specify the address of bind (default is 0.0.0.0)
That's the 2nd one today. The command execution format is as follows:Salt ' kvm.tiancity.com ' virt.init web20 4 nic=nics Disk=systemHere, we need to be aware that the KVM/QEMU is not allowed to use the profile, we need to change the virt.py code:650
# Salt '*' state. SLS httpd This command will first find httpd in the directory/srv/salt. SLS (written in yml syntax) file. If yes, the content of the Installation File is executed. If not, locate init in the/srv/salt/httpd directory. SLS, find
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.