-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist_resources.yml
57 lines (48 loc) · 1.57 KB
/
list_resources.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
- 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(', ') }}