mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
6d645c127f
The vmware test roles do a lot of similar operation to prepare the environment. This role will be used to reduce the amount of duplicated code. The role can prepare an environment on a baremetal environment, this in addition to vcsim. Original PR: https://github.com/ansible/ansible/pull/54882
38 lines
954 B
YAML
38 lines
954 B
YAML
---
|
|
- name: Create a VM folder on given Datacenter
|
|
vcenter_folder:
|
|
hostname: '{{ vcenter_hostname }}'
|
|
username: '{{ vcenter_username }}'
|
|
password: '{{ vcenter_password }}'
|
|
datacenter: '{{ dc1 }}'
|
|
folder_name: '{{ f0 }}'
|
|
folder_type: vm
|
|
state: present
|
|
validate_certs: no
|
|
|
|
- name: Create VMs
|
|
vmware_guest:
|
|
hostname: "{{ vcenter_hostname }}"
|
|
username: "{{ vcenter_username }}"
|
|
password: "{{ vcenter_password }}"
|
|
datacenter: "{{ dc1 }}"
|
|
validate_certs: no
|
|
folder: '{{ f0 }}'
|
|
cluster: '{{ ccr1 }}'
|
|
name: '{{ item }}'
|
|
state: poweredon
|
|
guest_id: debian8_64Guest
|
|
disk:
|
|
- size_gb: 1
|
|
type: thin
|
|
datastore: '{{ ds2 }}'
|
|
hardware:
|
|
memory_mb: 128
|
|
num_cpus: 1
|
|
scsi: paravirtual
|
|
cdrom:
|
|
type: iso
|
|
iso_path: "[{{ ds1 }}] Fedora-Workstation-Live-x86_64-29-1.2.iso"
|
|
networks:
|
|
- name: VM Network
|
|
with_items: '{{ infra.vm_list }}'
|