<div dir="ltr">Many thanks Juan, now works fine, i spend 3 days on this reading docs.<div><br></div><div><br></div><div>Norman</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 23, 2017 at 2:26 PM, Juan Hernández <span dir="ltr"><<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 02/23/2017 01:58 PM, Norman Lamponi wrote:<br>
> Hello all,<br>
><br>
> i'm trying to implement automatic deploy of vm on a rhevm/ovirt platform<br>
> using ansible and ovirt_vms module.<br>
><br>
> I take rhel 7.3 kvm guest with cloud init like template, i can deploy vm<br>
> with no problem but when i try using ansible to power up and configure<br>
> it with cloud init the process fail.<br>
><br>
> My playbook is this:<br>
> ---<br>
> - hosts: ovirt<br>
> tasks:<br>
> - name: Parti e configura<br>
> ovirt_vms:<br>
> auth:<br>
> username: admin@internal<br>
> password: xxxxxxxx<br>
> url: <a href="https://webaddress/ovirt-engine" rel="noreferrer" target="_blank">https://webaddress/ovirt-<wbr>engine</a><br>
<br>
</span>Try to add /api to the 'url' parameter.<br>
<div><div class="h5"><br>
> ca_file: /etc/pki/ovirt-engine/ca.pem<br>
> name: rh7conf<br>
> cluster: Sviluppo<br>
> high_availability: true<br>
> cloud_init:<br>
> nic_boot_protocol: static<br>
> nic_ip_address: 10.x.xx.xxx<br>
> nic_netmask: 255.255.252.0<br>
> nic_gateway: 10.x.xx.xxx<br>
> nic_name: eth0<br>
> nic_on_boot: true<br>
> host_name: sticameca<br>
> user_name: root<br>
> root_password: stapera<br>
><br>
> my host file is:<br>
> [ovirt]<br>
> webaddress ansible_user=root<br>
><br>
> and error is:<br>
><br>
> nsible-playbook -i ~/ansible/ovirt_hosts orig.testovirt_vms.yml -vvvv<br>
> Using /etc/ansible/ansible.cfg as config file<br>
> Loading callback plugin default of type stdout, v2.0 from<br>
> /usr/lib/python2.7/dist-<wbr>packages/ansible/plugins/<wbr>callback/__init__.pyc<br>
><br>
> PLAYBOOK: orig.testovirt_vms.yml<br>
> ******************************<wbr>*****************<br>
> 1 plays in orig.testovirt_vms.yml<br>
><br>
> PLAY [ovirt]<br>
> ******************************<wbr>******************************<wbr>*******<br>
><br>
> TASK [setup]<br>
> ******************************<wbr>******************************<wbr>*******<br>
> Using module file<br>
> /usr/lib/python2.7/dist-<wbr>packages/ansible/modules/core/<wbr>system/setup.py<br>
> <webaddress> ESTABLISH SSH CONNECTION FOR USER: root<br>
> <webaddress> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o<br>
> ControlPersist=60s -o KbdInteractiveAuthentication=<wbr>no -o<br>
> PreferredAuthentications=<wbr>gssapi-with-mic,gssapi-keyex,<wbr>hostbased,publickey -o<br>
> PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o<br>
> ControlPath=/home/lamponin/.<wbr>ansible/cp/ansible-ssh-%h-%p-%<wbr>r<br>
> webaddress'/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo<br>
> ~/.ansible/tmp/ansible-tmp-<wbr>1487853056.88-81930174841084 `" && echo<br>
> ansible-tmp-1487853056.88-<wbr>81930174841084="` echo<br>
> ~/.ansible/tmp/ansible-tmp-<wbr>1487853056.88-81930174841084 `" ) && sleep<br>
> 0'"'"''<br>
> <webaddress> PUT /tmp/tmp0wuXiN TO<br>
> /root/.ansible/tmp/ansible-<wbr>tmp-1487853056.88-<wbr>81930174841084/setup.py<br>
> <webaddress> SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o<br>
> ControlPersist=60s -o KbdInteractiveAuthentication=<wbr>no -o<br>
> PreferredAuthentications=<wbr>gssapi-with-mic,gssapi-keyex,<wbr>hostbased,publickey -o<br>
> PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o<br>
> ControlPath=/home/lamponin/.<wbr>ansible/cp/ansible-ssh-%h-%p-%<wbr>r '[webaddress]'<br>
> <webaddress> ESTABLISH SSH CONNECTION FOR USER: root<br>
> <webaddress> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o<br>
> ControlPersist=60s -o KbdInteractiveAuthentication=<wbr>no -o<br>
> PreferredAuthentications=<wbr>gssapi-with-mic,gssapi-keyex,<wbr>hostbased,publickey -o<br>
> PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o<br>
> ControlPath=/home/lamponin/.<wbr>ansible/cp/ansible-ssh-%h-%p-%<wbr>r<br>
> webaddress'/bin/sh -c '"'"'chmod u+x<br>
> /root/.ansible/tmp/ansible-<wbr>tmp-1487853056.88-<wbr>81930174841084/<br>
> /root/.ansible/tmp/ansible-<wbr>tmp-1487853056.88-<wbr>81930174841084/setup.py &&<br>
> sleep 0'"'"''<br>
> <webaddress> ESTABLISH SSH CONNECTION FOR USER: root<br>
> <webaddress> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o<br>
> ControlPersist=60s -o KbdInteractiveAuthentication=<wbr>no -o<br>
> PreferredAuthentications=<wbr>gssapi-with-mic,gssapi-keyex,<wbr>hostbased,publickey -o<br>
> PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o<br>
> ControlPath=/home/lamponin/.<wbr>ansible/cp/ansible-ssh-%h-%p-%<wbr>r -tt<br>
> webaddress'/bin/sh -c '"'"'/usr/bin/python<br>
> /root/.ansible/tmp/ansible-<wbr>tmp-1487853056.88-<wbr>81930174841084/setup.py; rm<br>
> -rf "/root/.ansible/tmp/ansible-<wbr>tmp-1487853056.88-<wbr>81930174841084/" ><br>
> /dev/null 2>&1 && sleep 0'"'"''<br>
> ok: [webaddress]<br>
><br>
> TASK [Parti e configura]<br>
> ******************************<wbr>*************************<br>
> task path: /home/lamponin/ansible/<wbr>playbook/orig.testovirt_vms.<wbr>yml:4<br>
> Using module file<br>
> /usr/lib/python2.7/dist-<wbr>packages/ansible/modules/<wbr>extras/cloud/ovirt/ovirt_vms.<wbr>py<br>
> <webaddress> ESTABLISH SSH CONNECTION FOR USER: root<br>
> <webaddress> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o<br>
> ControlPersist=60s -o KbdInteractiveAuthentication=<wbr>no -o<br>
> PreferredAuthentications=<wbr>gssapi-with-mic,gssapi-keyex,<wbr>hostbased,publickey -o<br>
> PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o<br>
> ControlPath=/home/lamponin/.<wbr>ansible/cp/ansible-ssh-%h-%p-%<wbr>r<br>
> webaddress'/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo<br>
> ~/.ansible/tmp/ansible-tmp-<wbr>1487853058.27-257942678666870 `" && echo<br>
> ansible-tmp-1487853058.27-<wbr>257942678666870="` echo<br>
> ~/.ansible/tmp/ansible-tmp-<wbr>1487853058.27-257942678666870 `" ) && sleep<br>
> 0'"'"''<br>
> <webaddress> PUT /tmp/tmphQzpox TO<br>
> /root/.ansible/tmp/ansible-<wbr>tmp-1487853058.27-<wbr>257942678666870/ovirt_vms.py<br>
> <webaddress> SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o<br>
> ControlPersist=60s -o KbdInteractiveAuthentication=<wbr>no -o<br>
> PreferredAuthentications=<wbr>gssapi-with-mic,gssapi-keyex,<wbr>hostbased,publickey -o<br>
> PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o<br>
> ControlPath=/home/utente/.<wbr>ansible/cp/ansible-ssh-%h-%p-%<wbr>r '[webaddress]'<br>
> <webaddress> ESTABLISH SSH CONNECTION FOR USER: root<br>
> <webaddress> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o<br>
> ControlPersist=60s -o KbdInteractiveAuthentication=<wbr>no -o<br>
> PreferredAuthentications=<wbr>gssapi-with-mic,gssapi-keyex,<wbr>hostbased,publickey -o<br>
> PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o<br>
> ControlPath=/home/utente/.<wbr>ansible/cp/ansible-ssh-%h-%p-%<wbr>r<br>
> webaddress'/bin/sh -c '"'"'chmod u+x<br>
> /root/.ansible/tmp/ansible-<wbr>tmp-1487853058.27-<wbr>257942678666870/<br>
> /root/.ansible/tmp/ansible-<wbr>tmp-1487853058.27-<wbr>257942678666870/ovirt_vms.py &&<br>
> sleep 0'"'"''<br>
> <webaddress> ESTABLISH SSH CONNECTION FOR USER: root<br>
> <webaddress> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o<br>
> ControlPersist=60s -o KbdInteractiveAuthentication=<wbr>no -o<br>
> PreferredAuthentications=<wbr>gssapi-with-mic,gssapi-keyex,<wbr>hostbased,publickey -o<br>
> PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o<br>
> ControlPath=/home/utente/.<wbr>ansible/cp/ansible-ssh-%h-%p-%<wbr>r -tt<br>
> webaddress'/bin/sh -c '"'"'/usr/bin/python<br>
> /root/.ansible/tmp/ansible-<wbr>tmp-1487853058.27-<wbr>257942678666870/ovirt_vms.py;<br>
> rm -rf "/root/.ansible/tmp/ansible-<wbr>tmp-1487853058.27-<wbr>257942678666870/" ><br>
> /dev/null 2>&1 && sleep 0'"'"''<br>
> fatal: [webaddress]: FAILED! => {<br>
> "changed": false,<br>
> "failed": true,<br>
> "invocation": {<br>
> "module_args": {<br>
> "boot_devices": null,<br>
> "cd_iso": null,<br>
> "clone": false,<br>
> "clone_permissions": false,<br>
> "cloud_init": {<br>
> "host_name": "sticameca",<br>
> "nic_boot_protocol": "static",<br>
> "nic_gateway": "10.x.xx.xxx",<br>
> "nic_ip_address": "10.x.xx.xxx",<br>
> "nic_name": "eth0",<br>
> "nic_netmask": "255.255.252.0",<br>
> "nic_on_boot": true,<br>
> "root_password": "stapera",<br>
> "user_name": "root"<br>
> },<br>
> "cluster": "Sviluppo",<br>
> "cpu_cores": null,<br>
> "cpu_shares": null,<br>
> "cpu_sockets": null,<br>
> "delete_protected": null,<br>
> "disks": [],<br>
> "force": false,<br>
> "high_availability": true,<br>
> "host": null,<br>
> "id": null,<br>
> "memory": "1GiB",<br>
> "memory_guaranteed": null,<br>
> "name": "rh7conf",<br>
> "nics": [],<br>
> "operating_system": null,<br>
> "poll_interval": 3,<br>
> "state": "present",<br>
> "stateless": null,<br>
> "sysprep": null,<br>
> "template": "kvm73cloudinit",<br>
> "timeout": 180,<br>
> "type": null,<br>
> "wait": true<br>
> },<br>
> "module_name": "ovirt_vms"<br>
> },<br>
> "msg": "Can't move to the next element"<br>
> }<br>
> to retry, use: --limit @/home/xxxx/ansible/playbook/<wbr>orig.testovirt_vms.retry<br>
><br>
> PLAY RECAP<br>
> ******************************<wbr>******************************<wbr>*********<br>
> webaddress : ok=1 changed=0 unreachable=0 failed=1<br>
><br>
> My cm is an ubuntu server (but test centos and rhel too)<br>
> Description:Ubuntu 16.10<br>
> Release:16.10<br>
> Codename:yakkety<br>
><br>
> lamponin@ubuntu:~/ansible/<wbr>playbook$ pip list | grep ovirt<br>
> DEPRECATION: The default format will switch to columns in the future.<br>
> You can use --format=(legacy|columns) (or define a<br>
> format=(legacy|columns) in your pip.conf under the [list] section) to<br>
> disable this warning.<br>
> ovirt-engine-sdk-python (4.1.0)<br>
> lamponin@ubuntu:~/ansible/<wbr>playbook$ dpkg -l | grep python2<br>
> ii idle-python2.7 2.7.12-3build1<br>
> all IDE for Python (v2.7) using Tkinter<br>
> ii libpython2.7:amd64 2.7.12-3build1<br>
> amd64 Shared Python runtime library<br>
> (version 2.7)<br>
> ii libpython2.7-dev:amd64 2.7.12-3build1<br>
> amd64 Header files and a static library<br>
> for Python (v2.7)<br>
> ii libpython2.7-minimal:amd64 2.7.12-3build1<br>
> amd64 Minimal subset of the Python<br>
> language (version 2.7)<br>
> ii libpython2.7-stdlib:amd64 2.7.12-3build1<br>
> amd64 Interactive high-level<br>
> object-oriented language (standard library, version 2.7)<br>
> ii python2.7 2.7.12-3build1<br>
> amd64 Interactive high-level<br>
> object-oriented language (version 2.7)<br>
> ii python2.7-dev 2.7.12-3build1<br>
> amd64 Header files and a static library<br>
> for Python (v2.7)<br>
> ii python2.7-minimal 2.7.12-3build1<br>
> amd64 Minimal subset of the Python lan<br>
><br>
><br>
><br>
> Best regards Norman<br>
><br>
><br>
</div></div>> ______________________________<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>
<br>
</blockquote></div><br></div>