Skip to content

Commit

Permalink
Provisioning VM role
Browse files Browse the repository at this point in the history
Signed-off-by: Danielle Barda <dbarda@redhat.com>
  • Loading branch information
bardielle authored and machacekondra committed Mar 6, 2024
1 parent 8048497 commit 92be62f
Show file tree
Hide file tree
Showing 32 changed files with 1,074 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install requirements
run: ansible-galaxy collection install -r requirements.yml

- name: Run ansible-lint
uses: ansible/ansible-lint@v6.22.0

Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,24 @@ jobs:
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install podman
- name: Checkout repo
uses: actions/checkout@v4
with:
path: ansible_collections/redhat_cop/vmware_ops
path: ansible_collections/cloud/vmware_ops

- name: Install requirements
run: |
ansible-galaxy collection install -r requirements.yml
working-directory: ansible_collections/cloud/vmware_ops

- name: Install python packages from requirements txt file
run: |
pip3 install -r requirements.txt
working-directory: ansible_collections/cloud/vmware_ops

- name: Run
run: |
make integration
working-directory: ansible_collections/redhat_cop/vmware_ops
ANSIBLE_PYTHON_INTERPRETER=/usr/bin/python make integration
working-directory: ansible_collections/cloud/vmware_ops
2 changes: 1 addition & 1 deletion Makefile
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
2 changes: 1 addition & 1 deletion execution-environment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To test the image locally using `ansible-runner` execute the image as follows:

```bash
$ export USER=yourdockerusername
$ ansible-runner run --container-image quay.io/$USER/vmware:mytest runner --inventory localhost, -p redhat_cop.vmware_ops.security
$ ansible-runner run --container-image quay.io/$USER/vmware:mytest runner --inventory localhost, -p cloud.vmware_ops.security
```

This will execute the `security.yml` playbook from playbooks directory. You can test with any playbook from this directory.
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace: redhat_cop
namespace: cloud
name: vmware_ops
version: 1.0.0
readme: README.md
Expand Down
9 changes: 9 additions & 0 deletions playbooks/provision_vm/manage_vm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Playbook to provision a new VM on VMware
hosts: all
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: 9 additions & 0 deletions playbooks/provision_vm/provisioning_vm_from_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Playbook to provision a new VM from template on VMware
hosts: all
gather_facts: false
roles:
- role: cloud.vmware_ops.provision_vm
vars:
provision_vm_clone_from_template: true
provision_vm_clone_from_vm: false
9 changes: 9 additions & 0 deletions playbooks/provision_vm/provisioning_vm_from_vm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Playbook to provision a new VM from an existing VM on VMware
hosts: all
gather_facts: false
roles:
- role: cloud.vmware_ops.provision_vm
vars:
provision_vm_clone_from_template: false
provision_vm_clone_from_vm: true
2 changes: 1 addition & 1 deletion playbooks/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
gather_facts: false

roles:
- role: redhat_cop.vmware_ops.security
- role: cloud.vmware_ops.security
2 changes: 1 addition & 1 deletion playbooks/system_settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
gather_facts: false

roles:
- role: redhat_cop.vmware_ops.system_settings
- role: cloud.vmware_ops.system_settings
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pyVim
pyVmomi>=6.7
podman
4 changes: 4 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
collections:
- name: community.vmware
- name: vmware.vmware_rest
- name: containers.podman
1 change: 1 addition & 0 deletions roles/create_vm_template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TBD
Empty file.
Empty file.
Empty file.
Empty file.
Loading

0 comments on commit 92be62f

Please sign in to comment.