0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[自分用メモ] ansibleでtarget hostのIPアドレスを取得する

Posted at

ただのメモです。

変数 ansible_default_ipv4.address で取得できる。
ansible_eth0.ipv4.address で取得できる場合も多いが、targetのIPアドレスが必ずしもeth0に設定されているとは限らないので前者が良さそう。

https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html

0
2
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
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?