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

参数

参数

注释

主机名

列表 / 元素=字符串

关于要用作主机名的首选项列表。

选项

  • "public_ipv4" ←(默认)

  • "private_ipv4"

  • "public_ipv6"

  • "hostname"

  • "id"

默认值: ["public_ipv4"]

oauth_token

字符串

Scaleway OAuth 令牌。

如果未显式定义或在环境变量中,它将尝试在 scaleway-cli 配置文件($SCW_CONFIG_PATH$XDG_CONFIG_HOME/scw/config.yaml~/.config/scw/config.yaml)中查找。

有关如何生成令牌的更多详细信息。

配置

插件

字符串 / 必需

确保这是“scaleway”插件的源文件的令牌。

选项

  • "scaleway"

  • "community.general.scaleway"

区域

列表 / 元素=字符串

在特定的 Scaleway 区域上过滤结果。

默认值: ["ams1", "par1", "par2", "waw1"]

scw_profile

字符串

在 community.general 4.4.0 中添加

要在配置文件中使用的配置配置文件。

默认情况下,使用配置文件中指定为 active_profile 的配置文件,如果未定义,则回退到 default

标签

列表 / 元素=字符串

在特定标签上过滤结果。

变量

字典

设置单个变量:键是变量名称,值是模板。可以使用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'"

作者

  • Remy Leone (@remyleone)

提示

每个条目类型的配置条目都具有从低到高的优先级顺序。例如,列表中较低的变量将覆盖较高的变量。