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