centos 7 修改主机名

hostnamectl set-hostname myhostname

 

ansible node -m raw -a "if [[ \$(cat /root/.ssh/authorized_keys |grep rsync_cn|wc -l) == 0 ]];then cat /tmp/cn_rsa.pub >>/root/.ssh/authorized_keys;cat /root/.ssh/authorized_keys |grep rsync_cn|wc -l;else cat /root/.ssh/authorized_keys |grep rsync_cn|wc -l;fi"

 

 

ansible node -m raw -a "if [[ \$(ps -ef |grep rsync|grep -v grep|wc -l) == 0 ]];then service 8730 start; ps -ef | grep rsync|grep -v grep;fi"

 

相关文章: