├── .DS_Store ├── .gitattributes ├── Deploy-VCSA.yml ├── README.md ├── vcenter-properties.yml └── vcsa_vars.yml /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madlabber/Deploy-VCSA-Ansible/7006c42309e5bd5975ec677db9b6bf1455db806b/.DS_Store -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Deploy-VCSA.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: localhost 3 | name: Deploy the VCSA to an ESXi Host 4 | gather_facts: false 5 | vars_files: 6 | vcsa_vars.yml 7 | tasks: 8 | - vmware_deploy_ovf: 9 | hostname: '{{ esxi_address }}' 10 | username: '{{ esxi_username }}' 11 | password: '{{ esxi_password }}' 12 | name: '{{ vcenter_hostname }}' # shortname, not FQDN 13 | ovf: '{{ vcsa_ova_file }}' 14 | wait_for_ip_address: true 15 | validate_certs: no 16 | inject_ovf_env: true 17 | properties: 18 | DeploymentOption.value: '{{ vcsa_size }}' # vCenter t-shirt size: tiny,small,medium,large, or infrastructure 19 | guestinfo.cis.appliance.net.addr.family: 'ipv4' # ipv4 or ipv6 20 | guestinfo.cis.appliance.net.mode: 'static' # static or dhcp 21 | guestinfo.cis.appliance.net.addr: '{{ vcenter_address }}' 22 | guestinfo.cis.appliance.net.pnid: "{{ vcenter_hostname }}.{{ domain }}" # FQDN of vcenter server 23 | guestinfo.cis.appliance.net.prefix: '{{ net_prefix }}' # netmask length, CIDR notation, i.e. '24' 24 | guestinfo.cis.appliance.net.gateway: '{{ net_gateway }}' 25 | guestinfo.cis.appliance.net.dns.servers: '{{ dns_servers }}' # Comma separated list of IP addresses of DNS servers. 26 | guestinfo.cis.appliance.root.passwd: '{{ vcenter_password }}' 27 | guestinfo.cis.ceip_enabled: "False" 28 | guestinfo.cis.deployment.autoconfig: 'True' # Auto-configure after deployment 29 | guestinfo.cis.vmdir.password: '{{ vcenter_password }}' # SSO Password for administrator@vsphere.local 30 | domain: '{{ domain }}' 31 | searchpath: '{{ searchpath }}' 32 | delegate_to: localhost 33 | - name: Wait for vCenter 34 | vmware_about_facts: 35 | hostname: '{{ vcenter_address }}' 36 | username: 'administrator@vsphere.local' 37 | password: '{{ vcenter_password }}' 38 | validate_certs: no 39 | delegate_to: localhost 40 | retries: 20 41 | delay: 60 42 | register: result 43 | until: result is succeeded -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Deploy-VCSA-Ansible 2 | 3 | This is an Ansible playbook for deploying the VMware vCenter Server Appliance (VCSA) to a standalone ESXi host. 4 | Tested on VCSA 6.7u1 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /vcenter-properties.yml: -------------------------------------------------------------------------------- 1 | ## This is the deployment Options section of the VCSA OVF file 2 | ## Reformatted in YAML 3 | DeploymentOption.value: 'tiny' # tiny,small,medium,large,management-tiny,management-small,management-medium,management-large,infrastructure 4 | 5 | ## This is the Properties section of the VCSA OVF file 6 | ## Reformatted in YAML 7 | 8 | # Category: Networking Configuration 9 | #################################### 10 | 11 | ## Host Network IP Address Family. 12 | #type="string" userConfigurable="true" value="" 13 | # Network IP address family (i.e., "ipv4" or "ipv6") 14 | guestinfo.cis.appliance.net.addr.family: "" 15 | 16 | ## Host Network Mode 17 | #type="string" userConfigurable="true" value="" 18 | #Network mode (i.e., "static", "dhcp", or "autoconf" (IPv6 only)) 19 | guestinfo.cis.appliance.net.mode: "" 20 | 21 | # Host Network IP Address 22 | # type="string" userConfigurable="true" value="" 23 | # Network IP address. Only provide this when mode is "static". Can be IPv4 or IPv6 based on specified address family. 24 | guestinfo.cis.appliance.net.addr: "" 25 | 26 | ## Host Network Prefix 27 | # type="string" userConfigurable="true" value="" 28 | #Network prefix length. Only provide this when mode is 'static'. 0-32 for IPv4. 0-128 for IPv6. 29 | guestinfo.cis.appliance.net.prefix: "" 30 | 31 | # Host Network Default Gateway 32 | # IP address of default gateway. Can be 'default' when using IPv6. 33 | # type="string" userConfigurable="true" value="" 34 | guestinfo.cis.appliance.net.gateway: "" 35 | 36 | # Host Network DNS Servers 37 | # Comma separated list of IP addresses of DNS servers. 38 | # type="string" userConfigurable="true" value="" 39 | guestinfo.cis.appliance.net.dns.servers: "" 40 | 41 | # Host Network Identity 42 | # Network identity (IP address or fully-qualified domain name) services should use when advertising themselves. 43 | # type="string" userConfigurable="true" value="" 44 | guestinfo.cis.appliance.net.pnid: "" 45 | 46 | # Custom Network Ports 47 | # A string encoding a JSON object mapping port names to port numbers. 48 | # type="string" userConfigurable="false" value="{}" 49 | #guestinfo.cis.appliance.net.ports: "{}" 50 | 51 | # Category: SSO Configuration 52 | ############################# 53 | 54 | # Directory Username 55 | # For the first instance of the identity domain, this is the username with Administrator privileges. Otherwise, this is the username of the replication partner. 56 | # type="string" userConfigurable="false" value="administrator@vsphere.local" 57 | #guestinfo.cis.vmdir.username: "administrator@vsphere.local" 58 | 59 | # Directory Password 60 | # For the first instance of the identity domain, this is the password given to the Administrator account. Otherwise, this is the password of the Administrator account of the replication partner. 61 | # password="true" type="string" userConfigurable="true" 62 | guestinfo.cis.vmdir.password: "" 63 | 64 | # Directory Domain Name 65 | # For the first instance of the identity domain, this is the name of the newly created domain. 66 | # type="string" userConfigurable="false" value="vsphere.local" 67 | #guestinfo.cis.vmdir.domain-name: "vsphere.local" 68 | 69 | # Site Name 70 | # Name of site. Use 'Default-First-Site' to define a new site. 71 | # type="string" userConfigurable="false" value="Default-First-Site" 72 | #guestinfo.cis.vmdir.site-name: "Default-First-Site" 73 | 74 | # New Identity Domain 75 | # If this parameter is set to True, the VMware directory instance is setup as the first instance of a new identity domain. Otherwise, the instance is setup as a replication partner. 76 | # type="boolean: userConfigurable="false" value="True" 77 | #guestinfo.cis.vmdir.first-instance: "True" 78 | 79 | # Directory Replication Partner 80 | # The hostname of the VMware directory replication partner. This value is ignored for the first instance of the identity domain. 81 | # type="string" userConfigurable="false" value="" 82 | #guestinfo.cis.vmdir.replication-partner-hostname: "" 83 | 84 | # Category: Database Configuration 85 | # Database Type 86 | # String indicating whether the database is 'embedded' or 'external'. 87 | # type="string" userConfigurable="false" value="embedded" 88 | #guestinfo.cis.db.type: "embedded" 89 | 90 | # Database User 91 | # String naming the account to use when connecting to external database (ignored when db.type is 'embedded'). 92 | # type="string" userConfigurable="false" value="" 93 | #guestinfo.cis.db.user: "" 94 | 95 | # Database Password 96 | # String providing the password to use when connecting to external database (ignored when db.type is 'embedded'). 97 | # password="true" type="string" userConfigurable="false" value="" 98 | #guestinfo.cis.db.password: "" 99 | 100 | # Database Server 101 | # String naming the the hostname of the server on which the external database is running (ignored when db.type is 'embedded'). 102 | # type="string" userConfigurable="false" value="" 103 | #guestinfo.cis.db.servername: "" 104 | 105 | # Database Port 106 | # String describing the port on the host on which the external database is running (ignored when db.type is 'embedded'). 107 | # type="string" userConfigurable="false" value="" 108 | #guestinfo.cis.db.serverport: "" 109 | 110 | # Database Provider 111 | # String describing the external database provider. The only supported value is 'oracle' (ignored when the db.type is 'embedded'). 112 | # type="string" userConfigurable="false" value="" 113 | #guestinfo.cis.db.provider: "" 114 | 115 | # Database Instance 116 | # String describing the external database instance. Values could be anything depending on what the database instance name the DBA creates in the external db. (ignored when the db.type is 'embedded'). 117 | # type="string" userConfigurable="false" value="" 118 | #guestinfo.cis.db.instance: "" 119 | 120 | # Category: System Configuration 121 | 122 | # Root Password 123 | # Password to assign to root account. If blank, password can be set on the console. 124 | # password="true" type="string" userConfigurable="true" 125 | guestinfo.cis.appliance.root.passwd: "" 126 | 127 | # Root Shell 128 | # This property is not changeable. 129 | # type="string" userConfigurable="false" value="" 130 | #guestinfo.cis.appliance.root.shell: 131 | 132 | 133 | # SSH Enabled 134 | # Set whether SSH-based remote login is enabled. This configuration can be changed after deployment. 135 | # type="boolean: userConfigurable="false" value="False" 136 | #guestinfo.cis.appliance.ssh.enabled: "False" 137 | 138 | # Tools-based Time Synchronization Enabled 139 | # Set whether VMware tools based time synchronization should be used. This parameter is ignored if appliance.ntp.servers is not empty. 140 | # type="boolean: userConfigurable="false" value="False" 141 | #guestinfo.cis.appliance.time.tools-sync: "False" 142 | 143 | # NTP Servers 144 | # A comma-seperated list of hostnames or IP addresses of NTP Servers 145 | # type="string" userConfigurable="false" value="" 146 | #guestinfo.cis.appliance.ntp.servers: "" 147 | 148 | # Deployment Type 149 | # type="string" userConfigurable="false" value="embedded" 150 | # Type of appliance to deploy (i.e. 'embedded', 'infrastructure' or 'management'). 151 | #guestinfo.cis.deployment.node.type: "embedded" 152 | # if configuration="management-xlarge: value="management" 153 | # if configuration="management-large: value="management" 154 | # if configuration="management-medium: value="management" 155 | # if configuration="management-small: value="management" 156 | # if configuration="management-tiny: value="management" 157 | # if configuration="management-xlarge-lstorage: value="management" 158 | # if configuration="management-large-lstorage: value="management" 159 | # if configuration="management-medium-lstorage: value="management" 160 | # if configuration="management-small-lstorage: value="management" 161 | # if configuration="management-tiny-lstorage: value="management" 162 | # if configuration="management-xlarge-xlstorage: value="management" 163 | # if configuration="management-large-xlstorage: value="management" 164 | # if configuration="management-medium-xlstorage: value="management" 165 | # if configuration="management-small-xlstorage: value="management" 166 | # if configuration="management-tiny-xlstorage: value="management" 167 | # if configuration="infrastructure: value="infrastructure" 168 | 169 | # Platform Services Controller 170 | # When deploying a vCenter Server Node, please provide the FQDN or IP address of a Platform Services Controller (leave blank otherwise). The choice of FQDN versus IP address is decided based on the Platform Services Controller's own notion of its network identity. 171 | # type="string" userConfigurable="false" value="" 172 | #guestinfo.cis.system.vm0.hostname: "" 173 | 174 | # HTTPS Port on Platform Services Controller 175 | # When deploying a vCenter Server pointing to an external platform services controller, please provide the HTTPS port of the external platform services controller if a custom port number is being used. The default HTTPS port number is 443. 176 | # type="string" userConfigurable="false" value="443" 177 | #guestinfo.cis.system.vm0.port: "443" 178 | 179 | # Category: Upgrade Configuration 180 | ################################# 181 | 182 | # Upgrade Source Hostname 183 | # IP/hostname of the appliance to upgrade. Set only for upgrade. 184 | # type="string" userConfigurable="false" value="" 185 | #guestinfo.cis.upgrade.source.vpxd.ip: "" 186 | 187 | # Migration Assistant Port 188 | # Port used by Migration Assistant on source vCenter Server. 189 | # type="string" userConfigurable="false" value="9123" 190 | #guestinfo.cis.upgrade.source.ma.port: "9123" 191 | 192 | # Upgrade Source vCenter Username 193 | # vCenter username for the appliance to upgrade. Set only for upgrade. 194 | # type="string" userConfigurable="false" value="" 195 | #guestinfo.cis.upgrade.source.vpxd.user: "" 196 | 197 | # Upgrade Source vCenter Password 198 | # vCenter password for the appliance to upgrade. Set only for upgrade. 199 | # password="true" type="string" userConfigurable="false" value="" 200 | #guestinfo.cis.upgrade.source.vpxd.password: "" 201 | 202 | # Upgrade Source OS Username 203 | # Username for the appliance operating system to upgrade. Usually root. Set only for upgrade. 204 | # type="string" userConfigurable="false" value="" 205 | #guestinfo.cis.upgrade.source.guest.user: "" 206 | 207 | # Upgrade Source OS Password 208 | # Password for the appliance operating system to upgrade. Set only for upgrade. 209 | # password="true" type="string" userConfigurable="false" value="" 210 | #guestinfo.cis.upgrade.source.guest.password: "" 211 | 212 | # Upgrade Management Host Hostname 213 | # URL that consists of the IP address or FQDN and https port of the vCenter Server instance or ESXi host that manages the appliance to upgrade. Https port is an optional parameter which by default is 443. Example: 10.10.10.10, //10.10.10.10:444, //[2001:db8:a0b:12f0::1]:444. Set only for upgrade. 214 | # type="string" userConfigurable="false" value="" 215 | #guestinfo.cis.upgrade.source.guestops.host.addr: "" 216 | 217 | # Upgrade Management Host Username 218 | # Username for the host that manages appliance to upgrade. Can be either vCenter or ESX host. Set only for upgrade. 219 | # type="string" userConfigurable="false" value="" 220 | #guestinfo.cis.upgrade.source.guestops.host.user: "" 221 | 222 | # Upgrade Management Host Password 223 | # Password for the host that manages appliance to upgrade. Can be either vCenter or ESX host. Set only for upgrade. 224 | # password="true" type="string" userConfigurable="false" value="" 225 | #guestinfo.cis.upgrade.source.guestops.host.password: "" 226 | 227 | # Upgrade Management Host Thumbprint 228 | # Thumbprint for the SSL certificate of the host that manages the appliance to upgrade. Set only for upgrade. 229 | # type="string" userConfigurable="false" value="" 230 | #guestinfo.cis.upgrade.source.ssl.thumbprint: "" 231 | 232 | # Upgrade Source Platform 233 | # Source host platform. Optional. Set only for upgrade 234 | # type="string" userConfigurable="false" value="linux" 235 | #guestinfo.cis.upgrade.source.platform: "linux" 236 | 237 | # Upgrade Source Export Folder 238 | # Folder on the source appliance, where to store migrate data. Optional. Set only for upgrade 239 | # type="string" userConfigurable="false" value="/var/tmp" 240 | #guestinfo.cis.upgrade.source.export.directory: "/var/tmp" 241 | 242 | # Upgrade Destination Export Folder 243 | # Folder where exported source data will be stored in the appliance. Optional. Set only for upgrade 244 | # type="string" userConfigurable="false" value="/storage/seat/cis-export-folder" 245 | #guestinfo.cis.upgrade.import.directory: "/storage/seat/cis-export-folder" 246 | 247 | # Upgrade Advanced Options 248 | # Advanced upgrade settings specified in json format. Optional. Set only for upgrade 249 | # type="string" userConfigurable="false" value="" 250 | #guestinfo.cis.upgrade.user.options: "" 251 | 252 | # Active Directory domain name 253 | # Active Directory domain to join. 254 | # type="string" userConfigurable="false" value="" 255 | #guestinfo.cis.ad.domain-name: "" 256 | 257 | # Active Directory domain admin user 258 | # Active Directory domain admin user. This username will be used to join the machine to the domain. 259 | # type="string" userConfigurable="false" value="" 260 | #guestinfo.cis.ad.domain.username: "" 261 | 262 | # Active Directory domain admin user password 263 | # Active Directory domain admin user password. This password will be used to join the machine to the domain. 264 | # password="true" type="string" userConfigurable="false" value="" 265 | #guestinfo.cis.ad.domain.password: "" 266 | 267 | # vCenter Server managing target appliance 268 | # FQDN or IP address of the vCenter Server managing that target appliance. Used when upgrading a source appliance in VCHA cluster. 269 | # type="string" userConfigurable="true" value="" 270 | #guestinfo.cis.vpxd.ha.management.addr: "" 271 | 272 | # Port of the vCenter Server managing target appliance 273 | # Https port of the vCenter Server managing that target appliance. Used when upgrading a source appliance in VCHA cluster. If not specified, port 443 will be used by default. 274 | # type="string" userConfigurable="true" value="443" 275 | #guestinfo.cis.vpxd.ha.management.port: "443" 276 | 277 | # Username for the vCenter Server managing target appliance 278 | # User able to authenticate in vCenter Server managing that target appliance. The user must have the privilege Global.VCServer. Used when upgrading a source appliance in VCHA cluster. 279 | # type="string" userConfigurable="true" value="" 280 | #guestinfo.cis.vpxd.ha.management.user: "" 281 | 282 | # Password for the vCenter Server managing target appliance 283 | # Password for administrator user authenticating to the vCenter Server managing target appliance. Used when upgrading a source appliance in VCHA cluster. 284 | # password="true" type="string" userConfigurable="true" value="" 285 | #guestinfo.cis.vpxd.ha.management.password: "" 286 | 287 | # Thumbprint for the SSL certificate of the vCenter Server managing target appliance 288 | # Thumbprint for the SSL certificate of the host that manages the appliance to upgrade. Used when upgrading a source appliance in VCHA cluster. 289 | # type="string" userConfigurable="true" value="" 290 | #guestinfo.cis.vpxd.ha.management.thumbprint: "" 291 | 292 | # Path to the compute resource where target appliance will be deployed on management vCenter Server 293 | # Path to host/cluster/resource pool where target appliance will be deployed on management vCenter Server. Used when upgrading a source appliance in VCHA cluster. Example: /my_datacenter/my_folder/my_host_or_cluster/my_resource_pool 294 | # type="string" userConfigurable="true" value="" 295 | #guestinfo.cis.vpxd.ha.placement: "" 296 | 297 | # Category: Miscellaneous 298 | ######################### 299 | 300 | # ESXi Dump Collector Enabled 301 | # Set whether ESXi Dump Collector service is enabled. This configuration can be changed after deployment. 302 | # type="boolean: userConfigurable="false" value="True" 303 | #guestinfo.cis.netdump.enabled: "True" 304 | 305 | # Do Silent Install 306 | # If this parameter is set to True, no questions will be posted during install or upgrade. Otherwise, the install process will wait for a reply if there is a pending question. 307 | # type="boolean: userConfigurable="false" value="False" 308 | #guestinfo.cis.silentinstall: "False" 309 | 310 | # The Client Locale 311 | # This parameter specifies the client locale. Supported locales are en, fr, ja, ko, zh_CN and zh_TW. English is assumed if locale is unknown. 312 | # type="string" userConfigurable="false" value="en" 313 | #guestinfo.cis.clientlocale: "en" 314 | 315 | # Feature switch states 316 | # Specify feature switch states which need to be added or modified in feature switch state config file. Format: key1=value1, key2=value2 317 | # type="string" userConfigurable="false" value="" 318 | #guestinfo.cis.feature.states: 319 | 320 | # CEIP enabled 321 | # VMware’s Customer Experience Improvement Program ("CEIP") provides VMware with information that enables VMware to improve its products and services, to fix problems, and to advise you on how best to deploy and use our products. As part of the CEIP, VMware collects technical information about your organization’s use of VMware products and services on a regular basis in association with your organization’s VMware license key(s). This information does not personally identify any individual. For more details about the Program and how VMware uses the information it collects through CEIP, please see the product documentation at http://www.vmware.com/info?id=1399. If you want to participate in VMware’s CEIP for this product, set this property to True. You may join or leave VMware’s CEIP for this product at any time. 322 | # type="boolean: userConfigurable="true" value="False" 323 | guestinfo.cis.ceip_enabled: "False" 324 | 325 | # Auto Start Services 326 | # If this parameter is set to True, the appliance will be configured after deployment using the specified OVF configuration parameters. If set to False, the appliance should be configured post-deployment using the VMware Appliance Management Interface. 327 | # type="boolean: userConfigurable="false" value="False" 328 | #guestinfo.cis.deployment.autoconfig: "False" 329 | 330 | # MAC address allocation scheme prefix 331 | # If a valid MAC address prefix is provided, then all MAC addresses assigned by vCenter Server will begin with this prefix instead of the VMware OUI. This property cannot co-exist with mac-allocation-scheme.ranges 332 | # type="string" userConfigurable="false" value="" 333 | #guestinfo.cis.vpxd.mac-allocation-scheme.prefix: "" 334 | 335 | # MAC address allocation scheme prefix length 336 | # This property is mandatory whenever a custom MAC prefix is provided. 337 | # type="uint8: userConfigurable="false" value="0" 338 | #guestinfo.cis.vpxd.mac-allocation-scheme.prefix-length: 0 339 | 340 | # MAC address allocation scheme ranges 341 | # If valid MAC address range is provided, then vCenter Server will assign MAC addresses from this range instead of allocating VMware OUI based MAC address. The address range must be provided in the format "BeginAddress1-EndAddress1,...,BeginAddressN-EndAddressN". This property cannot co-exist with mac-allocation-scheme.prefix. 342 | # type="string" userConfigurable="false" value="" 343 | #guestinfo.cis.vpxd.mac-allocation-scheme.ranges: "" 344 | 345 | # Category: Networking Properties 346 | ####################### 347 | 348 | # Domain Name 349 | # The domain name of this VM. Leave blank if DHCP is desired. 350 | # type="string" userConfigurable="true" 351 | domain: "" 352 | 353 | # Domain Search Path 354 | # The domain search path (comma or space separated domain names) for this VM. Leave blank if DHCP is desired. 355 | # type="string" userConfigurable="true" 356 | searchpath: "" 357 | -------------------------------------------------------------------------------- /vcsa_vars.yml: -------------------------------------------------------------------------------- 1 | esxi_address: '172.16.108.20' 2 | esxi_username: 'root' 3 | esxi_password: 'VMware1!' 4 | vcenter_password: 'VMware1!' 5 | vcenter_hostname: 'vcsa' 6 | vcenter_address: '172.16.108.22' 7 | net_prefix: '24' 8 | net_gateway: '172.16.108.2' 9 | dns_servers: '172.16.108.21' 10 | domain: 'demo.lab' 11 | searchpath: "" 12 | vcsa_size: 'tiny' 13 | vcsa_ova_file: '/Users/madlabber/Downloads/VMware-vCenter-Server-Appliance-6.7.0.20000-10244745_OVF10.ova' 14 | --------------------------------------------------------------------------------