-
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.
Signed-off-by: Danielle Barda <dbarda@redhat.com>
- Loading branch information
Showing
14 changed files
with
63 additions
and
118 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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
integration: | ||
ansible-test integration --no-temp-workdir security_test | ||
ansible-test integration --no-temp-workdir |
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
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
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
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,2 @@ | ||
pyVim | ||
pyVmomi |
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 |
---|---|---|
@@ -1,69 +1 @@ | ||
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 | ||
------------------ | ||
|
||
- ?? | ||
TBD |
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 |
---|---|---|
@@ -1 +0,0 @@ | ||
--- | ||
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 |
---|---|---|
@@ -1,5 +0,0 @@ | ||
--- | ||
# vm name or vm template | ||
- name: Create VM or template | ||
ansible.builtin.include_tasks: "clone_vm_to_template.yml" | ||
|
||
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
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
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,2 @@ | ||
pyVim | ||
pyVmomi |
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 |
---|---|---|
@@ -1,4 +1,13 @@ | ||
--- | ||
- name: Security role | ||
- name: Provision VM | ||
ansible.builtin.import_role: | ||
name: cloud.vmware_ops.provision_vm | ||
vars: | ||
provision_vm_hostname: "test" | ||
provision_vm_username: "test" | ||
provision_vm_password: "test" | ||
provision_vm_validate_certs: false | ||
provision_vm_cluster: "C0" | ||
provision_vm_datacenter: "DC0" | ||
provision_vm_folder: "folder" | ||
provision_vm_vm_name: "vm-test" |
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