community.general.lxd 清单 - 从 lxd 主机返回 Ansible 清单
注意
此清单插件是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible
软件包,您可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install community.general
。您需要进一步的要求才能使用此清单插件,请参阅 要求 了解详细信息。
要在剧本中使用它,请指定:community.general.lxd
。
community.general 3.0.0 中的新增功能
概要
从 lxd 获取清单。
使用以“lxd.(yml|yaml)”结尾的 YAML 配置文件。
要求
在执行此清单的本地控制器节点上需要以下要求。
ipaddress
lxd >= 4.0
参数
参数 |
注释 |
---|---|
客户端证书文件路径。 默认值: |
|
客户端证书密钥文件路径。 默认值: |
|
通过以下关键字创建组 请参阅示例了解语法。 |
|
确保这是“lxd”插件的源文件的令牌。 选项
|
|
如果一个实例有多个网络接口,哪个是按系列首选的接口。 指定 选项
|
|
如果一个实例有多个网络接口,请选择哪个接口是首选的模式。 与可以找到的第一个数字组合,例如“eth”+ 0。 该选项已从 默认值: |
|
根据给定的项目筛选实例。 默认值: |
|
服务器证书文件路径。 |
|
此选项控制是否将服务器的主机名作为 HTTPS 连接验证的一部分进行检查。如果例如提供的服务器证书(请参阅 选项
|
|
根据当前状态筛选实例。 选项
|
|
客户端信任密码。 在使用此模块之前,您需要在 lxd 服务器上设置此密码,使用以下命令: 如果设置了 |
|
按类型过滤实例,可选值为 inventory 的第一个版本仅支持容器。 选项
|
|
lxd 服务器的 unix 域套接字路径或 https URL。 文件系统中的套接字必须以 通常是 默认值: |
示例
# simple lxd.yml
plugin: community.general.lxd
url: unix:/var/snap/lxd/common/lxd/unix.socket
# simple lxd.yml including filter
plugin: community.general.lxd
url: unix:/var/snap/lxd/common/lxd/unix.socket
state: RUNNING
# simple lxd.yml including virtual machines and containers
plugin: community.general.lxd
url: unix:/var/snap/lxd/common/lxd/unix.socket
type_filter: both
# grouping lxd.yml
groupby:
locationBerlin:
type: location
attribute: Berlin
netRangeIPv4:
type: network_range
attribute: 10.98.143.0/24
netRangeIPv6:
type: network_range
attribute: fd42:bd00:7b11:2167:216:3eff::/24
osUbuntu:
type: os
attribute: ubuntu
testpattern:
type: pattern
attribute: test
profileDefault:
type: profile
attribute: default
profileX11:
type: profile
attribute: x11
releaseFocal:
type: release
attribute: focal
releaseBionic:
type: release
attribute: bionic
typeVM:
type: type
attribute: virtual-machine
typeContainer:
type: type
attribute: container
vlan666:
type: vlanid
attribute: 666
projectInternals:
type: project
attribute: internals