ansible
作者:
HaoDongZ | 来源:发表于
2019-01-04 14:45 被阅读0次[test@l-t.ops.prod.aws.dm ~]$ cat ip.txt 配置免密码登录 并且推送文件到远程主机
[ip]
10.24.61.16
10.24.61.29
[ip:vars]
ansible_ssh_user=
ansible_ssh_pass=
ansible_sudo_user=
ansible_sudo_pass=
ansible_ssh_port=22
ansible -i ip.txt ip -m copy -a "src=/home/ansible/ansible-sh.sh dest=/root" 推送文件
ansible -i ip.txt ip -m shell -a "echo "spBxxx1212" | passwd --stdin root" 批量修改密码
-m script
ansible -i /etc/ansible/jhn.txt jhn -m shell -a 'echo " nohup /usr/bin/node_exporter & >/dev/null" >> /etc/rc.local'
ansible -i /etc/ansible/fwzx.txt fwzx -m authorized_key -a "user=root key='{{ lookup('file', '/root/.ssh/id_rsa.pub')}}' path='/root/.ssh/authorized_keys' manage_dir=no" --ask-pass -c paramiko 批量推送key
ansible -i /etc/ansible/tyb.txt tyb -m copy -a "src=node_exporter dest=/usr/bin/ mode=777" 推送文件授权777
本文标题:ansible
本文链接:https://www.haomeiwen.com/subject/rcahrqtx.html
网友评论