Skip to content

Commit

Permalink
Merge pull request #40 from oracle-samples/Monicashivakumar-patch-1
Browse files Browse the repository at this point in the history
Update and rename ovirt_list_vms_by_cluster.yaml to ovirt_list_resour…
  • Loading branch information
Monicashivakumar authored Jan 23, 2025
2 parents 303f888 + 2602a6c commit 0138100
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 49 deletions.
70 changes: 70 additions & 0 deletions playbooks/OLVM/ovirt_list_resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
#
# Oracle Linux Automation Manager
#
# Copyright (c) 2025 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at
# https://oss.oracle.com/licenses/upl.
#
# Description: Playbook to list VM's by Oracle Linux Virtualization Manager (OLVM) cluster
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.


---
- name: List VMs in OLVM using environment variables
hosts: all
gather_facts: false
tasks:

- name: Login to OLVM manager
ovirt_auth:
url: "{{ lookup('env', 'OVIRT_URL') }}"
username: "{{ lookup('env', 'OVIRT_USERNAME') }}"
password: "{{ lookup('env', 'OVIRT_PASSWORD') }}"
ca_file: "{{ olvm_cafile | default(omit) }}"
insecure: "{{ olvm_insecure | default(true) }}"
tags:
- always

- name: List OLVM VM's
ovirt_vm_info:
auth: "{{ ovirt_auth }}"
register: result

- name: Print out {{ vm_name }} VM information
debug:
msg: "{{ result.ovirt_vms }}"

- name: Get list of storage domains
ovirt_storage_domain_info:
auth: "{{ ovirt_auth }}"
register: storage_domains_info

- name: Print storage domain names
debug:
msg: >-
Storage Domains:
{{ storage_domains_info.ovirt_storage_domains | map(attribute='name') | join(', ') }}
- name: Get list of networks
ovirt.ovirt.ovirt_network_info:
auth: "{{ ovirt_auth }}"
register: networks_info

- name: Print network names
debug:
msg: >-
Networks:
{{ networks_info.ovirt_networks | map(attribute='name') | join(', ') }}
- name: Get list of templates
ovirt.ovirt.ovirt_template_info:
auth: "{{ ovirt_auth }}"
register: templates_info

- name: Print template names
debug:
msg: >-
Templates:
{{ templates_info.ovirt_templates | map(attribute='name') | join(', ') }}
49 changes: 0 additions & 49 deletions playbooks/OLVM/ovirt_list_vms_by_cluster.yaml

This file was deleted.

0 comments on commit 0138100

Please sign in to comment.