less than 1 minute read

エラー発生まで

  • WSL(Fedora)において、systemd上で動作するdocker + containerに対してansibleを実行しようとすると表題のエラー
$ ansible -i hosts docker -m file -a "path=/var/tmp/test state=touch" -u root -k
SSH password: 
172.17.0.2 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: muxclient: master hello exchange failed\r\nFailed to connect to new control master",
    "unreachable": true
}

暫定対応

  • ansible実行時に、-e 'ansible_ssh_args="-o ControlMaster=no"を指定する
    $ ansible -i hosts docker -m file -a "path=/var/tmp/test state=touch" -u root -k -e 'ansible_ssh_args="-o ControlMaster=no"'