-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from oracle-samples/Monicashivakumar-patch-1
Update and rename ovirt_list_vms_by_cluster.yaml to ovirt_list_resour…
- Loading branch information
Showing
2 changed files
with
70 additions
and
49 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,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(', ') }} |
This file was deleted.
Oops, something went wrong.