community.general.scaleway 清单 – Scaleway 清单源
注意
此清单插件是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible
包,您可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install community.general
。您需要更多要求才能使用此清单插件,有关详细信息,请参阅要求。
要在剧本中使用它,请指定:community.general.scaleway
。
概要
从 Scaleway 获取清单主机。
要求
在执行此清单的本地控制器节点上需要以下要求。
PyYAML
参数
参数 |
注释 |
---|---|
关于要用作主机名的首选项列表。 选项
默认值: |
|
Scaleway OAuth 令牌。 如果未显式定义或在环境变量中,它将尝试在 scaleway-cli 配置文件( 有关如何生成令牌的更多详细信息。 配置
|
|
确保这是“scaleway”插件的源文件的令牌。 选项
|
|
在特定的 Scaleway 区域上过滤结果。 默认值: |
|
要在配置文件中使用的配置配置文件。 默认情况下,使用配置文件中指定为 |
|
在特定标签上过滤结果。 |
|
设置单个变量:键是变量名称,值是模板。可以使用Scaleway API返回的任何值。 |
示例
# scaleway_inventory.yml file in YAML format
# Example command line: ansible-inventory --list -i scaleway_inventory.yml
# use hostname as inventory_hostname
# use the private IP address to connect to the host
plugin: community.general.scaleway
regions:
- ams1
- par1
tags:
- foobar
hostnames:
- hostname
variables:
ansible_host: private_ip
state: state
# use hostname as inventory_hostname and public IP address to connect to the host
plugin: community.general.scaleway
hostnames:
- hostname
regions:
- par1
variables:
ansible_host: public_ip.address
# Using static strings as variables
plugin: community.general.scaleway
hostnames:
- hostname
variables:
ansible_host: public_ip.address
ansible_connection: "'ssh'"
ansible_user: "'admin'"