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 environmenthosts: vmstasks:- block:- name: Include oVirt password#no_log: trueinclude_vars: vars.yml- name: Obtain SSO tokenno_log: trueovirt_auth:url: "{{ url }}"username: "{{ username }}"password: "{{ password }}"ca_file: "{{ ca_file }}"- name: Create and run VM from templateovirt_vms:auth: "{{ ovirt_auth }}"name: "{{ vm }}"template: "{{ template }}"cluster: "{{ cluster }}"memory: "{{ memory }}"memory_guaranteed: "{{ memory_guaranteed }}"high_availability: truecpu_cores: "{{ cpu_cores }}"cpu_sockets: "{{ cpu_sockets }}"type: servername: "{{ vm }}"operating_system: other_linuxstate: stoppedwait: yes#- name: Add nic# ovirt_nics:# auth: "{{ ovirt_auth }}"# name: "{{ nic_name }}"# profile: "{{ profile_name }}"# state: plugged# vm: "{{ vm }}"# wait: yesalways:- name: Revoke the SSO tokenovirt_auth:state: absentovirt_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_templat e/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^ hereThe error appears to have been in '/Users/oyarimtepe/test/ovirt-ansible/create_vm_from_templat e/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^ hereI 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