LoginSignup
14
17

More than 5 years have passed since last update.

Ansibleが複数ホストに対して並列に走らない

Posted at

最近の Ansible は複数のホストに対してタスクを実行する際に並列で実行するようになっていて、並列数は forks で指定することができる。
しかし、並列に実行するよう設定しているにも関わらず、並列に動作しない場合があるので注意。

How do I drive Ansible programmatically and concurrently?

Ansibleが ~/.ssh/known_hosts にホストを見つけられない場合に、各タスクの実行毎にグローバルロックを取るようになっているため、このような現象が起こるらしい。
とりあえずの解決策としては、~/.ansible.cfg 等にknown hostsのチェックを無効化する設定を書いておけば良い。

host_key_checking = False
14
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
17