LoginSignup
4
4

More than 5 years have passed since last update.

特定ホストに対してのみ踏み台を経由して Ansible を実行する

Posted at

ネットワーク的に踏み台サーバーを経由しないと到達できないサーバーに Ansible を流す

公式ドキュメントに書かれている方法はすべてのサーバーでの作業時に踏み台を踏むような形になるが、外から疎通できない一部のホストだけ踏み台を踏むようにしたい場合は、host_vars に対象ホスト名と同じ名前でファイルを作って、以下のように設定を入れればよい。

---

ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q user@host"'
4
4
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
4
4