SathiyarajPeriyannan.vsphere

ansible-role-vsphere

这是一个 Ansible 角色,用于在 VMware 虚拟化环境中创建虚拟机。虚拟机的 IP 地址会更新到库存文件中,以便在其他角色/剧本中使用。

要求

在 Ansible 主机上安装 pysphere 包。 配置并可用的 VMware vCenter 环境。 vCenter 中有可供部署的虚拟机模板版本。

角色变量

可用的变量如下所示:

vsphere_vcenter_hostname: "vcenter1"
  vsphere_vcenter_username: "root"
vsphere_vcenter_password: "passwd"

用于连接 vCenter 服务器的服务器名称/IP 地址和凭据。

vsphere_datacenter_name: "datacenter1"
vsphere_esxi_host: "esx1"

创建虚拟机所在的数据中心以及虚拟机所关联的 ESXi 服务器。

vsphere_datastore_name: "datastore1"

虚拟机硬盘存储的存储数据名称。

vsphere_template_name: "centos_template"

将要安装的预装操作系统映像模板。

库存文件中的主机变量如下,包含默认值:

[hosts]

用于收集库存文件中虚拟机名称的分组名称。

<vm name> cpu=2 memory=4096 disk=20

虚拟机的名称、所需的虚拟 CPU 数量、内存大小(MB)、磁盘大小(GB)。

依赖

示例剧本

- hosts: hosts
  connection: local
  vars:
    vsphere_vcenter_hostname: "vcenter1"
    vsphere_vcenter_username: "root"
    vsphere_vcenter_password: "passwd"
    vsphere_datacenter_name: "datacenter1"
    vsphere_esxi_host: "esx1"
    vsphere_datastore_name: "datastore1"
    vsphere_template_name: "centos_template"

  roles:
     - SathiyarajPeriyannan.vsphere 

许可证

BSD

作者信息

该角色由 Sathiyaraj Periyannan 于 2016 年创建。

安装
ansible-galaxy install SathiyarajPeriyannan.vsphere
许可证
Unknown
下载
312
拥有者
HCL ERS DevOps COE - Solutions Architect (DevOps, Docker, Kubernetes,Consulting) at ERS, HCL Technologies.