#### ### ## 域名管理 salt.modules.dnsutil
salt 'minion' dnsutil.A msc.zhonganonline.com #从monion获取指定域名A记录
salt 'minion' network.ping archlinux.org timeout=3
systemd服务管理 salt.modules.systemd_service
salt 'minion' service.disable <service name>
salt 'minion' service.disabled <service name>
salt 'minion' service.enable <service name>
salt 'minion' service.enabled <service name>
salt 'minion' service.start <service name>
salt 'minion' service.stop <service name>
salt 'minion' service.reload <service name>
salt 'minion' service.force_reload <service name>
salt 'minion' service.restart <service name>
salt 'minion' service.show <service name>
salt 'minion' service.status <service name> [service signature]
salt 'minion' service.systemctl_reload
文件处理
salt 'minion' file.find /alidata1/admin/za-warden/extra_conf7/ name=nginx.yml
salt 'minion' file.remove /alidata1/admin/za-warden/extra_conf7/nginx.yml
salt 'minion' file.get_hash /usr/lib64/security/pam_unix.so --out=yaml --out-file=/tmp/hash.txt
salt 'minion' file.comment /etc/resolv.conf '.*10.139.100.165.*' 正则匹配到包含10.139.100.165内容注释
salt 'minion' file.line /etc/ssh/sshd_config mode=replace match="Match Group sftpusers" content='#Match Group sftpusers'
salt 'minion' file.file_exists /etc/passwd #判断文件是否存在
salt 'minion' file.copy /etc/rsyslog.conf /tmp/ recurse=true #从minion拷贝文件到本地
salt 'minion' cp.get_file salt://rsyslog.conf /etc/ #从本地拷贝文件到minion
salt 'minion' cp.get_dir salt://sourceFolder /tmp #从master拷贝目录到minion
salt 'minion' cp.get_url http://www.slashdot.org /tmp/index.html
salt 'minion' cp.list_master #在master上用命令查看有哪些文件资源可供拷贝到minion上
salt 'minion' file.replace /alidata1/admin/za-warden/new_filebeat/filebeat.yml pattern='debug' repl='info' #文本内容debug替换成info
从minion端下载到master 需要修改 file_recv: True才能拉取文件
salt 'minion' cp.push /etc/rc.local #所有拉取的文件都保存在master节点的/var/cache/salt/master/minions/{minion-id}/files/etc/rc.local
salt 'minion' cp.push /etc/system-release keep_symlinks=True #拉取软连接原文件
salt 'minion' cp.push /etc/fstab upload_path='/new/path/fstab'
salt 'minion' cp.push_dir /etc/modprobe.d/ glob='*.conf' #拉取目录 匹配到以.conf结尾的文件