This worked for me:
---
- hosts: localhost
connection: local
vars_files:
- ../vars.yml
tasks:
- name: Obtain SSO token
ovirt_auth:
url: "{{ url }}"
username: "{{ username }}"
password: "{{ password }}"
insecure: "{{ insecure }}"
- name: List vms
ovir
Great, it works like a charm!
But how could I obtain a several map display?
For example, I need to display the vm name ; its relative snaphost id
and snaphot description.
I tried to change filter, but notyhing works
msg: "{{ ovirt_snapshots | map(attribute='description') |
map(attribute='id
I am not Ansible expert, this maybe worth asking on Ansible users list,
but one thing which you can do is following:
in tasks/main.yml
- include: "{{ item }}"
with_items: "{{ resources | default('vms') }}.yml"
then have following files:
- tasks/vms.yml
- tasks/clusters.yml
- tasks/disks.yml
Thanks, all works as expected.
Now, I try make roles.
here it is :
*cat /etc/ansible/roles/ovirt_vm_facts/tasks/main.yml*
- name: get vm facts
ovirt_vms_facts:
auth:
url: https://{{ engine }}.v100.abes.fr/ovirt-engine/api
username: "{{ username }}"
password:
On Wed, May 10, 2017 at 12:38 PM, Nathanaël Blanchet
wrote:
> Le 10/05/2017 à 10:29, Ondra Machacek a écrit :
>
> Not sure I understand. You can use Ansible module to list VMs, you
> can use ovirt_vms _facts[1] module.
>
> For example to get only stopped VMs, you can use following:
>
> - name: Ge
Le 10/05/2017 à 10:29, Ondra Machacek a écrit :
Not sure I understand. You can use Ansible module to list VMs, you
can use ovirt_vms _facts[1] module.
For example to get only stopped VMs, you can use following:
- name: Get stopped VMs
ovirt_vms_facts:
auth:
url: https://ovirt.exampl
Not sure I understand. You can use Ansible module to list VMs, you
can use ovirt_vms _facts[1] module.
For example to get only stopped VMs, you can use following:
- name: Get stopped VMs
ovirt_vms_facts:
auth:
url: https://ovirt.example.com/ovirt-engine/api
username: admin@inter
Thanks, I knew this python script, but I believed it was possible to do
the same with an ansible module.
That's mean we need several tools to do different tasks, it is not a
very convergent way to proceed... but it is feasable.
Le 10/05/2017 à 07:56, Ondra Machacek a écrit :
On Tue, May 9
On Tue, May 9, 2017 at 6:52 PM, Nathanaël Blanchet wrote:
> Hello,
>
> I didn't find anyway to easy list all my vms thanks to the ansible
> modules...
> I tried the ovirt4.py script which is able to list the whole facts, so vms
> list, when the number of them is small in a test datacenter, but in
9 matches
Mail list logo