![](/img/trans.png)
[英]Specifying a subnetwork for Ansible google.cloud.compute_instance
[英]Choose compute node(hypervisor) for instance creation with ansible openstack.cloud.server module
我希望在使用 Openstack ansible 模塊openstack.cloud.server
創建實例時指定要駐留在哪個計算節點上,實際上我想 ansiblealize 以下命令:
$ openstack server create --flavor g2 --image Ubuntu-20.04 --network public2 --security-group default --hypervisor-hostname compute3 --os-compute-api-version 2.74 test
# OR
$ openstack server create --flavor g2 --image Ubuntu-20.04 --network public2 --security-group default --host compute3 --os-compute-api-version 2.74 test
我如何將類似於 Openstack CLI 的--host
或--hypervisor-hostname
傳遞給 ansible 中的openstack.cloud.server
模塊???
嘗試使用meta
。 hostname
定義你的管理程序:
- name: Create a new instance and attaches to a network and passes metadata to the instance
openstack.cloud.server:
......
meta:
hostname: test1
元:
應作為元數據提供給新實例的鍵值對列表
另一種方式,它可以使用availability_zone
參數到select 主機:
- name: launch an instance in specific host
openstack.cloud.server:
......
availability_zone: nova:compute3001
另請參閱此示例。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.