ovirt_nics problem at ansible module

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

On 03/08/2017 03:44 PM, Oğuz Yarımtepe wrote:
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.
If what you are looking for is a way to add a NIC to an existing VM, using a specific vNIC profile, you can use this example: https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/add_vm_ni...

On Wed, Mar 8, 2017 at 3:44 PM, Oğuz Yarımtepe <oguzyarimtepe@gmail.com> wrote:
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.
ovirt_nics module is part of the Ansible 2.3, and I guess you are using Ansible 2.2. That's why it can't find the module.
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 }}"
This is a list of dictionary, so this should be: nics: - name: "{{ nic_name }}" profile_name: "{{ profile_name }}" (no second dash)
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
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

Yes, pip repo has 2.2. will use the add_vm_nic.py for now. On Wed, Mar 8, 2017 at 5:07 PM, Ondra Machacek <omachace@redhat.com> wrote:
On Wed, Mar 8, 2017 at 3:44 PM, Oğuz Yarımtepe <oguzyarimtepe@gmail.com> wrote:
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.
ovirt_nics module is part of the Ansible 2.3, and I guess you are using Ansible 2.2. That's why it can't find the module.
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 }}"
This is a list of dictionary, so this should be:
nics: - name: "{{ nic_name }}" profile_name: "{{ profile_name }}"
(no second dash)
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
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
-- Oğuz Yarımtepe http://about.me/oguzy
participants (3)
-
Juan Hernández
-
Ondra Machacek
-
Oğuz Yarımtepe