随笔分类 - saltstack
摘要:我在salt上编写了备份日志的脚本,在/opt/CardServer下的主程序目录只保留当天的日志,/opt/log_del目录会保存7天的日志。salt * state.sls script.log_sevenday#添加计划任务salt * cron.set_job root '00' '4'
阅读全文
摘要:[root@salt-master ~]# salt-master --version salt-master 2015.5.10 (Lithium) #master 的配置文件 [root@salt-master ~]# cat /etc/salt/roster web1: host: 192.168.50.101 user: root passwd: 1234...
阅读全文
摘要:#!/bin/bash for i in $(cat ./host.txt) do echo $i > ./tmp.txt HOSTNAME=$(cut -d ':' -f1 ./tmp.txt) IP=$(cut -d ':' -f2 ./tmp.txt) PASS=$(cut -d ':' -f3 ./tmp.txt) /usr/bin/expect ./tmp.txt h...
阅读全文
摘要:#!/bin/bash #命令 匹配主机 执行模块 脚本路径,必须放在salt目录下 源主机名 修改的主机名 #salt tt_LD_LM_LC_1 cmd.script salt://init/rename.sh 'tt_LD_LM_LC_1 tt_LD_LM_1' echo "network" sed -i "s#${1}#${2}#g" /...
阅读全文
摘要:自定义grains 的方法 1:在客户端配置 在minion 的配置文件夹 /etc/salt/minion.d 下面包含的配置文件 grains.conf [root@python minion.d]# pwd/etc/salt/minion.d[root@python minion.d]# ls
阅读全文