SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
10.
Azure Resource Explorer の活用例
実際にあった例:名前が RG1 のリソースグループに入っている名前が VM1 の VM に
くっついてる最初の NIC にくっついている NSG のルールに OpenVPN ポート (1194) の
受信許可がなければ追加するのを Ansible でやりたい
○ 最初の VM 以外のリソース名・リソースグループ名は 不明なことが多い
(Azure CLI などのツールは勝手に名前をつけて作るため )
○ 関連リソースは各リソース内に リソースID で記録されており、
その記録場所は Azure Resource Explorer を使って容易に調べられる
11.
ステップ 1
● VM のリソース情報を azure_rm_resource_info で取得して r に保存
- name: VM リソース情報取得
azure_rm_resource_info:
resource_group: RG1
provider: Compute
resource_type: virtualMachines
resource_name: VM1
register: r
ARM階層構造による
リソース指定
12.
ステップ 2
● NIC のリソースIDを調べて azure_rm_resource_info で取得して r に保存
- name: NIC リソース情報取得
azure_rm_resource_info:
url: "{{r.response[0].properties.networkProfile.networkInterfaces[0].id}}"
register: r
リソースID 指定
Azure Resource Explorer で
VM にくっついている NIC の
リソースID の保存場所を調査