• 博客
  • Ansible 社区论坛
  • 文档
Ansible Logo
Ansible Community 文档
Ansible

Ansible 入门

  • Ansible 入门
  • 执行环境入门

安装、升级和配置

  • 安装指南
  • Ansible 移植指南

使用 Ansible

  • 构建 Ansible 清单
  • 使用 Ansible 命令行工具
  • 使用 Ansible 剧本
  • 使用 Ansible Vault 保护敏感数据
  • 使用 Ansible 模块和插件
  • 使用 Ansible 集合
  • 在 Windows 和 BSD 上使用 Ansible
  • Ansible 技巧和诀窍

为 Ansible 做贡献

  • Ansible 社区指南
  • Ansible 集合贡献者指南
  • ansible-core 贡献者指南
  • 高级贡献者指南
  • Ansible 文档风格指南

扩展 Ansible

  • 开发者指南

常见的 Ansible 场景

  • 遗留公有云指南

网络自动化

  • 网络入门
  • 网络高级主题
  • 网络开发者指南

Ansible Galaxy

  • Galaxy 用户指南
  • Galaxy 开发者指南

参考 & 附录

  • 集合索引
    • Amazon 命名空间中的集合
    • Ansible 命名空间中的集合
    • Arista 命名空间中的集合
    • Awx 命名空间中的集合
    • Azure 命名空间中的集合
    • Check_point 命名空间中的集合
    • Chocolatey 命名空间中的集合
    • Cisco 命名空间中的集合
    • Cloud 命名空间中的集合
    • Cloudscale_ch 命名空间中的集合
    • Community 命名空间中的集合
      • Community.Aws
      • Community.Ciscosmb
      • Community.Crypto
      • Community.Digitalocean
      • Community.Dns
      • Community.Docker
      • Community.General
      • Community.Grafana
      • Community.Hashi_Vault
      • Community.Hrobot
      • Community.Library_Inventory_Filtering_V1
      • Community.Libvirt
      • Community.Mongodb
      • Community.Mysql
      • Community.Network
      • Community.Okd
      • Community.Postgresql
      • Community.Proxysql
      • Community.Rabbitmq
      • Community.Routeros
      • Community.Sap_Libs
      • Community.Sops
      • Community.Vmware
        • 描述
        • 开发者指南
        • 插件索引
      • Community.Windows
      • Community.Zabbix
    • Containers 命名空间中的集合
    • Cyberark 命名空间中的集合
    • Dellemc 命名空间中的集合
    • F5networks 命名空间中的集合
    • Fortinet 命名空间中的集合
    • Frr 命名空间中的集合
    • Gluster 命名空间中的集合
    • Google 命名空间中的集合
    • Grafana 命名空间中的集合
    • Hetzner 命名空间中的集合
    • Hpe 命名空间中的集合
    • Ibm 命名空间中的集合
    • Ieisystem 命名空间中的集合
    • Infinidat 命名空间中的集合
    • Infoblox 命名空间中的集合
    • Inspur 命名空间中的集合
    • Junipernetworks 命名空间中的集合
    • Kaytus 命名空间中的集合
    • Kubernetes 命名空间中的集合
    • Kubevirt 命名空间中的集合
    • Lowlydba 命名空间中的集合
    • Mellanox 命名空间中的集合
    • Microsoft 命名空间中的集合
    • Netapp 命名空间中的集合
    • Netapp_eseries 命名空间中的集合
    • Netbox 命名空间中的集合
    • Ngine_io 命名空间中的集合
    • Openstack 命名空间中的集合
    • Openvswitch 命名空间中的集合
    • Ovirt 命名空间中的集合
    • Purestorage 命名空间中的集合
    • Sensu 命名空间中的集合
    • Servicenow 命名空间中的集合
    • Splunk 命名空间中的集合
    • T_systems_mms 命名空间中的集合
    • Telekom_mms 命名空间中的集合
    • Theforeman 命名空间中的集合
    • Vmware 命名空间中的集合
    • Vultr 命名空间中的集合
    • Vyos 命名空间中的集合
    • Wti 命名空间中的集合
  • 所有模块和插件的索引
  • 剧本关键字
  • 返回值
  • Ansible 配置设置
  • 控制 Ansible 的行为方式:优先级规则
  • YAML 语法
  • Python 3 支持
  • 解释器发现
  • 发布和维护
  • 测试策略
  • 健全性测试
  • 常见问题解答
  • 词汇表
  • Ansible 参考:模块实用程序
  • 特殊变量
  • 红帽 Ansible 自动化平台
  • Ansible Automation Hub
  • 记录 Ansible 输出

路线图

  • Ansible 路线图
  • ansible-core 路线图




Ansible
  • 集合索引
  • Community 命名空间中的集合
  • Community.Vmware
  • community.vmware.vmware_vm_config_option 模块 – 返回特定客户机操作系统的支持的客户机 ID 列表和虚拟机建议配置选项


community.vmware.vmware_vm_config_option 模块 – 返回特定客户机操作系统的支持的客户机 ID 列表和虚拟机建议配置选项

注意

此模块是 community.vmware 集合 (版本 5.2.0) 的一部分。

如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。

要安装它,请使用:ansible-galaxy collection install community.vmware。

要在剧本中使用它,请指定:community.vmware.vmware_vm_config_option。

  • 概要

  • 参数

  • 注释

  • 示例

  • 返回值

概要

  • 此模块用于获取创建时支持的硬件版本、ESXi 主机支持的最新虚拟硬件或指定硬件版本的客户机 ID 列表、指定客户机操作系统 ID 的虚拟机建议配置选项。

参数

参数

注释

cluster_name

字符串

集群的名称。

如果未提供 esxi_hostname,则此参数是必需的。

datacenter

字符串

用于获取指定集群或主机的数据中心名称。

默认值: "ha-datacenter"

esxi_hostname

字符串

ESXi 主机名。

在此 ESXi 主机上获取虚拟机配置选项。

如果未提供 cluster_name,则此参数是必需的。

get_config_options

布尔值

返回由 guest_id 指定的客户机 ID 的虚拟机建议配置选项的字典,其中硬件版本由 hardware_version 指定或默认硬件版本。

当设置为 true 时,必须设置 guest_id。

选择

  • false ←(默认)

  • true

get_guest_os_ids

布尔值

返回指定实体上支持的客户机操作系统 ID 列表。

如果设置了 hardware_version,则将返回支持的相应客户机操作系统 ID 列表,否则将返回默认硬件版本的客户机操作系统 ID 列表。

选择

  • false ←(默认)

  • true

get_hardware_versions

布尔值

返回支持创建的虚拟机硬件版本列表以及指定实体上的默认硬件版本。

选择

  • false ←(默认)

  • true

guest_id

字符串

当 get_guest_os_ids=true 时,从返回的列表中获取客户机操作系统 ID,例如 ‘rhel8_64Guest’。

当 get_config_options=true 时,必须设置此参数。

hardware_version

字符串

当 get_hardware_versions=true 时,从返回的列表中获取硬件版本,例如 ‘vmx-19’。

hostname

字符串

vSphere vCenter 或 ESXi 服务器的主机名或 IP 地址。

如果未在任务中指定该值,则将使用环境变量 VMWARE_HOST 的值。

password

别名:pass, pwd

字符串

vSphere vCenter 或 ESXi 服务器的密码。

如果未在任务中指定该值,则将使用环境变量 VMWARE_PASSWORD 的值。

port

整数

vSphere vCenter 或 ESXi 服务器的端口号。

如果未在任务中指定该值,则将使用环境变量 VMWARE_PORT 的值。

默认值: 443

proxy_host

字符串

将接收所有 HTTPS 请求并转发它们的代理地址。

格式是主机名或 IP。

如果任务中未指定该值,则将使用环境变量 VMWARE_PROXY_HOST 的值。

proxy_port

整数

将接收所有 HTTPS 请求并转发它们的 HTTP 代理的端口。

如果任务中未指定该值,则将使用环境变量 VMWARE_PROXY_PORT 的值。

username

别名:admin, user

字符串

vSphere vCenter 或 ESXi 服务器的用户名。

如果任务中未指定该值,则将使用环境变量 VMWARE_USER 的值。

validate_certs

布尔值

允许在 SSL 证书无效时进行连接。当证书不受信任时,设置为 false。

如果任务中未指定该值,则将使用环境变量 VMWARE_VALIDATE_CERTS 的值。

选择

  • false

  • true ← (默认)

注意

注意

  • vSphere 7.0 上的已知问题 (https://github.com/vmware/pyvmomi/issues/915)

  • 所有模块都需要 API 写入权限,因此在免费的 ESXi 许可证上不受支持。

  • 所有变量和 VMware 对象名称都区分大小写。

示例

- name: Get supported guest ID list on given ESXi host for with default hardware version
  community.vmware.vmware_vm_config_option:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    esxi_hostname: "{{ esxi_hostname }}"
    get_guest_os_ids: true
  delegate_to: localhost

- name: Get VM recommended config option for Windows 10 guest OS on given ESXi host
  community.vmware.vmware_vm_config_option:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    esxi_hostname: "{{ esxi_hostname }}"
    get_config_options: true
    guest_id: "windows9_64Guest"
  delegate_to: localhost

返回值

通用返回值记录在这里,以下是此模块独有的字段

键

描述

实例

字典

关于 VM 建议配置的元数据

返回: 总是

示例: "None"

作者

  • Diane Wang (@Tomorrow9)

集合链接

  • 问题跟踪器
  • 主页
  • 存储库 (源代码)
上一个 下一个

© 版权归 Ansible 项目贡献者所有。 最后更新于 2024 年 12 月 19 日。