oVirt / ovirt-ansible-collection

Ansible collection with official oVirt modules and roles
72 stars 91 forks source link

ovirt.ovirt.hosted_engine_setup: Remote deploy the engine cannot pass "Wait for the local VM" #372

Open drokath opened 3 years ago

drokath commented 3 years ago
SUMMARY

When trying to deploy the engine from an ansible control node different from the hc_nodes, the application of hosted_engine_setup role can not go pass wait_for_connection.

As indicated in https://github.com/ansible/ansible/issues/36519 wait_for_connection can not be delegated for now

COMPONENT NAME

ovirt.ovirt.hosted_engine_setup File: 03_engine_initial_tasks.yml

STEPS TO REPRODUCE
- name: Setup ovirt hosted engine
  hosts: node1.test.local
  tags: engine
  vars:
    he_ansible_host_name: node1.test.local
    he_appliance_password:  # set password here
    he_admin_password: # set password here
    he_bridge_if: "enp1s0"
    he_fqdn: "engine.test.local"
    he_vcpus: 2
    he_vm_mac_addr: # set mac here
    he_domain_type: "gluster"
    he_storage_domain_addr: "node1.test.local"
    he_storage_domain_path: "/gluster_bricks/engine"
    he_network_test: ping
    he_offline_deployment: true # To disable package updates
    he_vm_ip_addr: "192.168.121.50"
    he_vm_ip_prefix: "24"
    he_dns_addr: "192.168.121.2"
    he_default_gateway: "192.168.121.254"
    he_vm_etc_hosts: true
  roles:
    - role: ovirt.ovirt.hosted_engine_setup
EXPECTED RESULTS

Role should proceed to the next tasks. When connecting manually the VM does respond : ssh in node1.test.local then ssh in dhcp-leased ip

ACTUAL RESULTS
wait_for_connection: attempting ping module test
sending connection check: [b'sshpass', b'-d633', b'ssh', b'-C', b'-o', b'ControlMaster=auto', b'-o', b'ControlPersist=60s', b'-o', b'StrictHostKeyChecking=no', b'-o', b'User="root"', b'-o', b'ConnectTimeout=10', b'-o', b'StrictHostKeyChecking=no', b'-o', b'UserKnownHostsFile=/dev/null', b'-o', b'ProxyCommand=ssh -W %h:%p -q  -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null  root@node1.test.local', b'-o', b'ControlPath=/home/<user>/.ansible/cp/efb388ea38', b'-O', b'check', b'192.168.1.199']
No connection to reset: Control socket connect(/home/<user>/.ansible/cp/efb388ea38): No such file or directory
drokath commented 2 years ago

The wait_for_connection in 03_engine_initial_tasks might be useless as all tasks executed with this playbook are delegated to the engine itself. If engine is not up no tasks can be executed. (See full_execution.yml and partial_execution.yml) Does anyone concur ?

arachmani commented 2 years ago

Hi @drokath, makes sense, did you try to remove wait_for_connection in 03_engine_initial_tasks and check if the deployment succeeds?

drokath commented 2 years ago

I did but the wait is necessary as the engine boot can be quite long. If a static IP is provided why not set it directly with cloud-init ?