On Sun, Oct 21, 2018 at 11:50 PM Brendan Holmes <me@brendanh.com> wrote:

Hi Simone,

 

Sorry for late response, I’ve been unwell.  Attached is the whole log you requested.  I hope it reveals why variable “local_vm_ip.stdout_lines” is not being populated.


Hi,
according to your log file the deployment was successful: 
  2018-10-14 13:06:36,316+0100 INFO otopi.plugins.gr_he_common.core.misc misc._terminate:250 Hosted Engine successfully deployed
 
But  from the logs I see that you introduced custom ansible tasks and you also removed relevant code parts:
2018-10-14 13:04:31,778+0100 INFO otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:100 TASK [Copy local VM disk to shared storage]
2018-10-14 13:04:59,019+0100 INFO otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:100 changed: [localhost]
2018-10-14 13:04:59,721+0100 INFO otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:100 TASK [pause]
2018-10-14 13:05:00,422+0100 INFO otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:100 ok: [localhost]
2018-10-14 13:05:01,124+0100 DEBUG otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:94 TASK [debug]
2018-10-14 13:05:01,725+0100 DEBUG otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:94 local_vm_ip: {'stderr_lines': [], u'changed': True, u'end': u'2018-10-14 12:58:22.193727', u'stdout': u'', u'cmd': u"virsh -r net-dhcp-leases default | grep -i 00:16:3e:31:d3:9e | awk '{ print $5 }' | cut -f1 -d'/'", 'failed': False, u'delta': u'0:00:00.069294', u'stderr': u'', u'rc': 0, 'stdout_lines': [], u'start': u'2018-10-14 12:58:22.124433'}
2018-10-14 13:05:02,426+0100 DEBUG otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:94 TASK [debug]
2018-10-14 13:05:03,127+0100 DEBUG otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:94 local_vm_ip.stdout_lines[0]: VARIABLE IS NOT DEFINED!
2018-10-14 13:05:03,828+0100 INFO otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:100 TASK [write value of local_vm_ip.stdout_lines[0]]
2018-10-14 13:05:04,530+0100 INFO otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:100 ok: [localhost]
2018-10-14 13:05:05,231+0100 INFO otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:100 TASK [write value of FQDN]
2018-10-14 13:05:05,832+0100 INFO otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:100 ok: [localhost]
2018-10-14 13:05:06,434+0100 DEBUG otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils.run:180 ansible-playbook rc: 0
2018-10-14 13:05:06,434+0100 DEBUG otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:94 PLAY RECAP [localhost] : ok: 89 changed: 24 unreachable: 0 skipped: 3 failed: 0
2018-10-14 13:05:06,434+0100 DEBUG otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:94 PLAY RECAP [ovirt-engine.example.com] : ok: 11 changed: 6 unreachable: 0 skipped: 0 failed: 0
2018-10-14 13:05:06,434+0100 DEBUG otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils.run:187 ansible-playbook stdout:
2018-10-14 13:05:06,434+0100 DEBUG otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils.run:189 [pause]

2018-10-14 13:05:06,434+0100 DEBUG otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils.run:189 Pausing because next block will fail miserably:

2018-10-14 13:05:06,434+0100 DEBUG otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils.run:190 ansible-playbook stderr:
2018-10-14 13:05:06,435+0100 ERROR otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils.run:192  [WARNING]: Not waiting for response to prompt as stdin is not interactive


at this point I can only suggest again to simply run the vanilla code without any custom patch.

 

Many thanks,

Brendan

 

From: Simone Tiraboschi <stirabos@redhat.com>
Sent: 15 October 2018 04:49

On Sun, Oct 14, 2018 at 6:08 AM Brendan Holmes <me@brendanh.com> wrote:

Hi Simone,

[ ERROR ] fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: list object has no element 0\n\nThe error appears to have been in '/usr/share/ovirt-hosted-engine-setup/ansible/create_target_vm.yml': line 396, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n    changed_when: True\n  - name: Clean /etc/hosts on the host\n    ^ here\n"}

 

I think that this is just an error in the clean up on failures phase due to something bad before.

Can you please attach the whole deployment log from /var/log/ovirt-hosted-engine/hosted-engine.log ?