<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 8, 2017 at 3:44 PM, Oğuz Yarımtepe <span dir="ltr"><<a href="mailto:oguzyarimtepe@gmail.com" target="_blank">oguzyarimtepe@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Below is my playbook</div><div><br></div><div><div>---</div><div>- name: Setup oVirt environment</div><div> hosts: vms</div><div> tasks:</div><div> - block:</div><div> - name: Include oVirt password</div><div> #no_log: true</div><div> include_vars: vars.yml</div><div><br></div><div> - name: Obtain SSO token</div><div> no_log: true</div><div> ovirt_auth:</div><div> url: "{{ url }}"</div><div> username: "{{ username }}"</div><div> password: "{{ password }}"</div><div> ca_file: "{{ ca_file }}"</div><div><br></div><div> - name: Create and run VM from template</div><div> ovirt_vms:</div><div> auth: "{{ ovirt_auth }}"</div><div> name: "{{ vm }}"</div><div> template: "{{ template }}"</div><div> cluster: "{{ cluster }}"</div><div> memory: "{{ memory }}"</div><div> memory_guaranteed: "{{ memory_guaranteed }}"</div><div> high_availability: true</div><div> cpu_cores: "{{ cpu_cores }}"</div><div> cpu_sockets: "{{ cpu_sockets }}"</div><div> type: server</div><div> name: "{{ vm }}"</div><div> operating_system: other_linux</div><div> state: stopped</div><div> wait: yes</div><div><br></div><div> #- name: Add nic</div><div> # ovirt_nics:</div><div> # auth: "{{ ovirt_auth }}"</div><div> # name: "{{ nic_name }}"</div><div> # profile: "{{ profile_name }}"</div><div> # state: plugged</div><div> # vm: "{{ vm }}"</div><div> # wait: yes</div><div><br></div><div> always:</div><div> - name: Revoke the SSO token</div><div> ovirt_auth:</div><div> state: absent</div><div> ovirt_auth: "{{ ovirt_auth }}"</div><div><br></div><div>When i remove the commented lines here is what i got:</div><div><br></div><div><div>ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.</div></div></div></div></blockquote><div><br></div><div>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.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><br></div><div>The error appears to have been in '/Users/oyarimtepe/test/ovirt-<wbr>ansible/create_vm_from_<wbr>template/playbook.yml': line 35, column 11, but may</div><div>be elsewhere in the file depending on the exact syntax problem.</div><div><br></div><div>The offending line appears to be:</div><div><br></div><div><br></div><div> - name: Add nic</div><div> ^ here</div><div><br></div><div><br></div><div>The error appears to have been in '/Users/oyarimtepe/test/ovirt-<wbr>ansible/create_vm_from_<wbr>template/playbook.yml': line 35, column 11, but may</div><div>be elsewhere in the file depending on the exact syntax problem.</div><div><br></div><div>The offending line appears to be:</div><div><br></div><div><br></div><div> - name: Add nic</div><div> ^ here</div></div><div><br></div><div>I tried using the nics attribute of ovirt_vms module but this time i got Nic[Name] is required although i defined as below:</div><div><br></div><div>nics:</div><div> - name: "{{ nic_name }}"</div><div> - profile_name: "{{ profile_name }}"</div></div></div></blockquote><div><br><br></div><div>This is a list of dictionary, so this should be:<br><br></div><div>nics:<br></div><div> - name: "{{ nic_name }}"<br> profile_name: "{{ profile_name }}"<br><br></div><div>(no second dash)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div><div>without comments it works. Any idea? Any way to set the nic and profile via SDK? An example will be great.</div><span class="gmail-HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="gmail-m_1139176698101192808gmail_signature">Oğuz Yarımtepe<br><a href="http://about.me/oguzy" target="_blank">http://about.me/oguzy</a></div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a><br>
<br></blockquote></div><br></div></div>