Skip to content

Commit

Permalink
fix CR commets
Browse files Browse the repository at this point in the history
Signed-off-by: Danielle Barda <dbarda@redhat.com>
  • Loading branch information
bardielle committed Mar 5, 2024
1 parent e68b4c5 commit 3b6a6bc
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 122 deletions.
3 changes: 0 additions & 3 deletions playbooks/provision_vm/manage_vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
gather_facts: false
roles:
- role: cloud.vmware_ops.provision_vm
vars:
provision_vm_clone_from_template: false
provision_vm_clone_from_vm: false
9 changes: 0 additions & 9 deletions playbooks/provision_vm/provisioning_vm_from_template.yml

This file was deleted.

9 changes: 0 additions & 9 deletions playbooks/provision_vm/provisioning_vm_from_vm.yml

This file was deleted.

1 change: 0 additions & 1 deletion roles/create_vm_template/README.md

This file was deleted.

Empty file.
Empty file.
Empty file.
Empty file.
60 changes: 38 additions & 22 deletions roles/provision_vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,28 @@ N/A
- **provision_vm_validate_certs** (boolean)
- Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.

- **provision_vm_port** (integer):
The port number of the vSphere vCenter or ESXi server.
If the value is not specified in the task, the value of environment variable VMWARE_PORT will be used instead.
Default: 443

- **provision_vm_proxy_host** (string):
Address of a proxy that will receive all HTTPS requests and relay them.
The format is a hostname or a IP.
If the value is not specified in the task, the value of environment variable VMWARE_PROXY_HOST will be used instead.

- **provision_vm_proxy_port** (integer):
Port of the HTTP proxy that will receive all HTTPS requests and relay them.
If the value is not specified in the task, the value of environment variable VMWARE_PROXY_PORT will be used instead.

### Provisioning a VM
- **provision_vm_clone_from_vm** (boolean):
Create from an existing VM

- **provision_vm_clone_from_template** (boolean):
Create from template VM

- **provision_vm_vm_name** (string, Required):
- **provision_vm_name** (string, Required):
Name of the virtual machine to work with.
Virtual machine names in vCenter are not necessarily unique, which may be problematic, see O(name_match).
If multiple virtual machines with same name exists, then O(folder) is required parameter to
Expand All @@ -43,28 +57,14 @@ N/A
If virtual machine does not exists, then this parameter is ignored.
Please note that a supplied UUID will be ignored on virtual machine creation, as VMware creates the UUID internally.

- **provision_vm_port** (integer):
The port number of the vSphere vCenter or ESXi server.
If the value is not specified in the task, the value of environment variable VMWARE_PORT will be used instead.
Default: 443

- **provision_vm_proxy_host** (string):
Address of a proxy that will receive all HTTPS requests and relay them.
The format is a hostname or a IP.
If the value is not specified in the task, the value of environment variable VMWARE_PROXY_HOST will be used instead.

- **provision_vm_proxy_port** (integer):
Port of the HTTP proxy that will receive all HTTPS requests and relay them.
If the value is not specified in the task, the value of environment variable VMWARE_PROXY_PORT will be used instead.

- **provision_vm_cluster** (String):
The cluster name where the virtual machine will run.

- **provision_vm_esxi_hostname** (string):
The ESXi hostname where the virtual machine will run.
This is a required parameter, if cluster is not set.
esxi_hostname and cluster are mutually exclusive parameters.
This parameter is case sensitive.
- **provision_vm_esxi_hostname** (string):
The ESXi hostname where the virtual machine will run.
This is a required parameter, if cluster is not set.
esxi_hostname and cluster are mutually exclusive parameters.
This parameter is case sensitive.

- **provision_vm_datacenter** (string):
Destination datacenter for the deploy operation.
Expand Down Expand Up @@ -778,9 +778,25 @@ Create a ``playbook.yml`` file like this:
tasks:
- name: Provision a VM
ansible.builtin.import_role:
name: cloud.vmware_ops.provision_virtual_machine
name: cloud.vmware_ops.provision_vm
vars:
aa: "{{ }}"
provision_vm_hostname: "test"
provision_vm_username: "test"
provision_vm_password: "test"
provision_vm_validate_certs: false
provision_vm_cluster: "DC0_C0"
provision_vm_folder: "/DC0/vm"
provision_vm_datacenter: "DC0"
provision_vm_name: "vm-test"
provision_vm_port: "8989"
provision_vm_disk:
- size_gb: 10
type: thin
datastore: "LocalDS_0"
provision_vm_hardware:
memory_mb: 512
num_cpus: 4
provision_vm_guest_id: "centos64Guest"
```

Run the playbook:
Expand Down
2 changes: 1 addition & 1 deletion roles/provision_vm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
proxy_host: "{{ omit if provision_vm_proxy_host is not defined else provision_vm_proxy_host }}"
proxy_port: "{{ omit if provision_vm_proxy_port is not defined else provision_vm_proxy_port }}"

name: "{{ provision_vm_vm_name }}"
name: "{{ provision_vm_name }}"
uuid: "{{ omit if provision_vm_uuid is not defined else provision_vm_uuid }}"

# compute resource:
Expand Down
64 changes: 0 additions & 64 deletions tests/integration/targets/provision_vm_test/mock.json

This file was deleted.

4 changes: 3 additions & 1 deletion tests/integration/targets/provision_vm_test/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
provision_vm_cluster: "DC0_C0"
provision_vm_folder: "/DC0/vm"
provision_vm_datacenter: "DC0"
provision_vm_vm_name: "vm-test"
provision_vm_name: "vm-test"
provision_vm_port: "8989"
provision_vm_disk:
- size_gb: 10
Expand All @@ -19,3 +19,5 @@
provision_vm_hardware:
memory_mb: 512
num_cpus: 4
provision_vm_guest_id: "centos64Guest"

12 changes: 0 additions & 12 deletions tests/integration/targets/provision_vm_test/vars.yml

This file was deleted.

0 comments on commit 3b6a6bc

Please sign in to comment.