[ovirt-users] ovirt_nics problem at ansible module

Oğuz Yarımtepe oguzyarimtepe at gmail.com
Wed Mar 8 14:44:25 UTC 2017


Hi,

Below is my playbook

---
- name: Setup oVirt environment
  hosts: vms
  tasks:
    - block:
        - name: Include oVirt password
          #no_log: true
          include_vars: vars.yml

        - name: Obtain SSO token
          no_log: true
          ovirt_auth:
            url: "{{ url }}"
            username: "{{ username }}"
            password: "{{ password }}"
            ca_file: "{{ ca_file }}"

        - name: Create and run VM from template
          ovirt_vms:
            auth: "{{ ovirt_auth }}"
            name: "{{ vm }}"
            template: "{{ template }}"
            cluster: "{{ cluster }}"
            memory: "{{ memory }}"
            memory_guaranteed: "{{ memory_guaranteed }}"
            high_availability: true
            cpu_cores: "{{ cpu_cores }}"
            cpu_sockets: "{{ cpu_sockets }}"
            type: server
            name: "{{ vm }}"
            operating_system: other_linux
            state: stopped
            wait: yes

        #- name: Add nic
        #  ovirt_nics:
        #    auth: "{{ ovirt_auth }}"
        #    name: "{{ nic_name }}"
        #    profile: "{{ profile_name }}"
        #    state: plugged
        #    vm: "{{ vm }}"
        #    wait: yes

      always:
        - name: Revoke the SSO token
          ovirt_auth:
            state: absent
            ovirt_auth: "{{ ovirt_auth }}"

When i remove the commented lines here is what i got:

ERROR! no action detected in task. This often indicates a misspelled module
name, or incorrect module path.

The error appears to have been in
'/Users/oyarimtepe/test/ovirt-ansible/create_vm_from_template/playbook.yml':
line 35, column 11, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


        - name: Add nic
          ^ here


The error appears to have been in
'/Users/oyarimtepe/test/ovirt-ansible/create_vm_from_template/playbook.yml':
line 35, column 11, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


        - name: Add nic
          ^ here

I tried using the nics attribute of ovirt_vms module but this time i got
Nic[Name] is required although i defined as below:

nics:
  - name: "{{ nic_name }}"
  - profile_name: "{{ profile_name }}"

without comments it works. Any idea? Any way to set the nic and profile via
SDK? An example will be great.

-- 
Oğuz Yarımtepe
http://about.me/oguzy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20170308/24507820/attachment.html>


More information about the Users mailing list