修改 UseDNS
[root@test1 ~]# vim /etc/ssh/sshd_config
......
#UseDNS yes
UseDNS no
......
[root@test1 ~]#
[root@test1 ~]# systemctl restart sshd
[root@test1 ~]#
ansible 批量修改 UseDNS
[root@test1 tidb]# ansible -i hosts.ini all -m shell -a "sed -i 's/\#UseDNS yes/UseDNS no/g' /etc/ssh/sshd_config" -b
[root@test1 tidb]# ansible -i hosts.ini all -m shell -a "systemctl restart sshd" -b