saltstack-gdlwolf自学总结第二篇:salt常用帮助查找命令
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了saltstack-gdlwolf自学总结第二篇:salt常用帮助查找命令相关的知识,希望对你有一定的参考价值。
书接上回:saltstack-gdlwolf自学总结第一篇:saltstack的安装部署(YUM安装)
连接地址:http://gdlwolf.blog.51cto.com/343866/1786901
此博文主要记录里下载saltstack中常用的帮助命令,当然也可以自行到saltstack的官方查询,官网地址:
salt官方提供的一些方案
https://github.com/saltstack-formulas
了解YAML
http://docs.saltstack.cn/topics/yaml/index.html
salt模块连接
https://docs.saltstack.com/en/latest/ref/states/all/index.html
saltstack 文件操作 state有很多种方法
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html
1、master端-->salt命令帮助查看
[[email protected] salt]#salt -h Usage: salt [options]‘<target>‘ <function> [arguments] Options: --version show program‘s version number andexit --versions-report show program‘s dependencies version numberand exit -h, --help show this help message and exit --saltfile=SALTFILE Specify the path to a Saltfile. If notpassed, one will be searched for inthe current working directory -c CONFIG_DIR, --config-dir=CONFIG_DIR Pass in an alternativeconfiguration directory. Default: /etc/salt -t TIMEOUT, --timeout=TIMEOUT Change the timeout, ifapplicable, for the running command; default=5 --hard-crash Raise any original exception ratherthan exiting gracefully Default:False -s, --static Return the data from minions as agroup after they all return. -p, --progress Display a progress graph. [Requires`progressbar` python package.] #以下省略N多行
2、minion端-->salt-call帮助查看
[[email protected] home]# salt-call-h Usage: salt-call [options]<function> [arguments] Salt call is used to executemodule functions locally on a minion Options: --version show program‘s versionnumber and exit --versions-report show program‘s dependencies version numberand exit -h, --help show this help message and exit --saltfile=SALTFILE Specify the path to a Saltfile. If notpassed, one will be searched for inthe current working directory -c CONFIG_DIR, --config-dir=CONFIG_DIR Pass in an alternativeconfiguration directory. Default: /etc/salt --hard-crash Raise any original exception ratherthan exiting gracefully Default:False -g, --grains Return the information generated bythe salt grains -m MODULE_DIRS, --module-dirs=MODULE_DIRS Specify an additionaldirectory to pull modules from. Multiple directoriescan be provided by passing `-m /--module-dirs`multiple times. -d, --doc, --documentation Return thedocumentation for the specified module or for all modules if noneare specified. --master=MASTER Specify the master to use. The minionmust be authenticated with themaster. If this option is omitted, the masteroptions from the minion config will be used. If multimasters are set up the first #以下省略N多行
3、master端-->查看saltstack内置模块信息
3.1、简单查找,不包含详细信息
salt‘salt02‘ sys.list_modules
3.2、较详细的查看salt模块信息
salt ‘salt02‘ sys.list_functions
3.3、较详细的查看salt某一个模块信息(例如status)
salt ‘salt02‘sys.list_functions status
3.4、详细查看salt内置模块,带样例
salt ‘salt02‘ sys.doc
3.5、详细查看salt内置某一个模块(例如status),带样例
salt ‘salt02‘ sys.doc status
以上是关于saltstack-gdlwolf自学总结第二篇:salt常用帮助查找命令的主要内容,如果未能解决你的问题,请参考以下文章
saltstack-gdlwolf自学总结第一篇:saltstack的安装部署(YUM安装)
saltstack-gdlwolf自学总结第五篇(方法案例): pkg模块初始化安装系统常用软件包