ansible穴埋め1,UNREACHABLE

2346 ワード

今日は穴にぶつかって記録した.
ansibleはcopyを実行するのが遅すぎるため、加速したいと思って、文章を見て長い接続を使って加速することができると言って、配置を修正します
/etc/ansible/ansible.cfg
この行のコメントをキャンセルして、対応する長い接続時間を変更します.
ssh_args = -o ControlMaster=auto -o ControlPersist=4h
テスト環境用、no problem
しかし、生産上はエラーが発生し、構成を復元してもこのエラーを解決できません...どれが憂鬱なのか、
古い方法では、異常な奇抜な間違いが発生したのは、ログをよく分析する古い方法を祭るしかない.
コマンド追加パラメータ-vvv出力詳細デバッグ情報
#ansible all -i html/data/tmp/appcheck-host -m shell 'echo 1' -vvv
ansible 2.4.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Nov 20 2015, 02:00:19) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]
Using /etc/ansible/ansible.cfg as config file
Parsed /nginx/html/data/tmp/appcheck-host inventory source with ini plugin
META: ran handlers
Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py
<10.239.51.139> ESTABLISH SSH CONNECTION FOR USER: ecs
<10.239.51.139> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ecs -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/14e9c7598d 10.239.51.139 '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<10.239.51.139> (255, '', 'Control socket connect(/root/.ansible/cp/14e9c7598d): Connection refused\r
Failed to connect to new control master\r
') app9 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Control socket connect(/root/.ansible/cp/14e9c7598d): Connection refused\r
Failed to connect to new control master\r
", "unreachable": true }

sshのコマンドラインパラメータを複数回分析し検索したところ、
構成ではsshが長い接続を使用する構成を削除しましたが、ansibleは私が復元した構成を認識していません.それとも長い接続を使用していますか.
なぜか生産使用長接続が間違っていた.構成復元が無効な場合はピットです
最後の解決策は/etc/ansible/ansibleを修正することである.cfgファイルのssh_args構成、表示される指定は長接続を使用しません
ssh_args = -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -C