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