ansible 配置了端口在host文件但是還要走22 ip:60001 ansible_ssh_port=60001


fatal: [101.251.194.102]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host 101.251.194.102 port 22: Connection refused\r\n", "unreachable": true}

 

ansible_ssh_port=60001

 

- hosts: zss
  tasks:
    - name: step1 
      ping:
    - name: step2 統計
      shell: egrep KFQX /etc/sudoers|wc -l
      ignore_errors: True
      register: check_value
    - name: step3 
      shell: echo "Cmnd_Alias KFQX =/usr/local/bin/supervisorctl, /usr/bin/supervisorctl, /bin/cat, /bin/ls, /usr/bin/head, /usr/bin/tail, /bin/grep, /usr/local/php/bin/php, /usr/bin/crontab, /usr/bin/python2.7, /usr/bin/python, /usr/bin/python3, /usr/bin/svn" >>/etc/sudoers
      when: check_value.stdout|int < 1

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM