-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
610 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: Playbook to provision a new VM on VMware | ||
hosts: all | ||
gather_facts: false | ||
|
||
vars: | ||
clone_from_template: false | ||
clone_from_vm: false | ||
|
||
roles: | ||
- role: redhat_cop.vmware_ops.provisioning_vm |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: Playbook to provision a new VM from template on VMware | ||
hosts: all | ||
gather_facts: false | ||
|
||
vars: | ||
clone_from_template: true | ||
clone_from_vm: false | ||
|
||
roles: | ||
- role: redhat_cop.vmware_ops.provisioning_vm | ||
Check failure on line 11 in playbooks/provision_vm/provisioning_vm_from_template.yml GitHub Actions / ansible-lintsyntax-check[specific]
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
- name: Playbook to provision a new VM from an existing VM on VMware | ||
hosts: all | ||
gather_facts: false | ||
|
||
vars: | ||
clone_from_template: false | ||
clone_from_vm: true | ||
|
||
roles: | ||
- role: redhat_cop.vmware_ops.provisioning_vm | ||
Check failure on line 11 in playbooks/provision_vm/provisioning_vm_from_vm.yml GitHub Actions / ansible-lintsyntax-check[specific]
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
Provision virtual machine | ||
================ | ||
|
||
A role to provision a virtual machine, create associated resources if they don’t exist (subnets, vCPU, memory configuration, storage configuration, etc) | ||
This includes cloning and building from VM templates | ||
Boot a VM from these types: | ||
* Windows Server | ||
* RHEL8 | ||
* RHEL9 | ||
|
||
|
||
Requirements | ||
------------ | ||
|
||
vCenter logged in permission | ||
|
||
Role Variables | ||
-------------- | ||
|
||
* **vcenter_hostname** (str): (Required) | ||
* **vcenter_username** (str): (Required) | ||
* **vcenter_password** (str): (Required) | ||
* **vcenter_validate_certs** (str): (Required) | ||
* **provision_virtual_machine_operation** (str): (Required) Operation to perform. Valid values are: | ||
clone_an_existing_vm, clone_template_to_template, clone_vm_to_template, create_new_vm, create_vm_from_template, | ||
deploy_from_template. | ||
|
||
Dependencies | ||
------------ | ||
|
||
N/A | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
All the variables defined in section [Role Variables](#role-variables) can be defined inside the ``vars.yml`` file. | ||
|
||
Create a ``playbook.yml`` file like this: | ||
|
||
``` | ||
--- | ||
- hosts: localhost | ||
gather_facts: true | ||
tasks: | ||
- name: Provision a VM | ||
ansible.builtin.import_role: | ||
name: cloud.vmware_ops.provision_virtual_machine | ||
vars: | ||
aa: "{{ }}" | ||
``` | ||
|
||
Run the playbook: | ||
|
||
```shell | ||
ansible-playbook playbook.yml -e "@vars.yml" | ||
``` | ||
|
||
License | ||
------- | ||
|
||
GNU General Public License v3.0 or later | ||
|
||
See [LICENCE](https://github.com/ansible-collections/cloud.vmware_ops/blob/main/LICENSE) to see the full text. | ||
|
||
Author Information | ||
------------------ | ||
|
||
- ?? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
# vm name or vm template | ||
- name: Create VM or template | ||
ansible.builtin.include_tasks: "clone_vm_to_template.yml" | ||
|
Oops, something went wrong.