脚本
sudo echo "[mysqlMaster<$1>]" >> /home/admin/hostrecord count=2 while [ $# -ge 2 ];do sudo echo $2 >> /home/admin/hostrecord sudo echo "ansible_ssh_user=root ansible_ssh_pass=123 ansible_su_pass=123" >> /home/admin/hostrecord let count=count+1 shift done
sudo ansible-playbook /setRedisParam.yml --extra-vars "paraname=$1 paravalue=$2"
命令
sh setvar.sh maxmemory-policy volatile-lru
命令中参数用空格隔开