0
0

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 3 years have passed since last update.

[メモ] AWXで VMware動的インベントリを使用する

0
Posted at

AWXでVMwareの動的インベントリを使用した時のメモ

認証情報を設定する

  1. AWXでリソースから認証情報を選択
  2. 追加ボタンをクリックして、認証情報タイプVMware vCenterにしてホスト情報、ユーザー名、パスワードなど情報を記入して他も適当に記入、保存する

認証情報を設定する

  1. 適当なインベントリにソースを追加して先ほど追加した認証情報を選択、ソース変数でインベントリの構成を設定する。

※ 下記の例では
仮想マシン名をホスト名として設定
タグとOS種別ごとにグループ化
パワーオンになっているマシンのみを対象にする
各ホストにansible変数を設定する

hostnames:
 - 'config.name'
with_tags: True
keyed_groups:
 - key: tags
   separator: ''
 - key: config.guestId
   separator: ''
with_nested_properties: True
filters:
 - summary.runtime.powerState == "poweredOn"
compose:
 ansible_host: 'guest.ipAddress'
 composed_var: 'config.name'
 ansible_user: "'ansible'"
 ansible_connection: "'ssh'"
 ansible_become: yes
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?