Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comparison logic in ovirt_initial_validations Ansible role #869

Closed
o0-o opened this issue Jun 25, 2023 · 1 comment
Closed

Fix comparison logic in ovirt_initial_validations Ansible role #869

o0-o opened this issue Jun 25, 2023 · 1 comment
Labels

Comments

@o0-o
Copy link

o0-o commented Jun 25, 2023

Affected version

  • oVirt Engine: ovirt-engine-4.5.4-1.el8.noarch
  • Host OS Variant: oVirt Node 4.5.4
  • VDSM version: vdsm-4.50.3.4-1.el8.x86_64
  • Ansible Core version: 2.15.0
  • Python version: 3.11.2

Describe the bug

If elasticsearch_host or fluentd_elasticsearch_host are undefined, hosted-engine --deploy will fail (timeout waiting for the engine to add the host).

The tasks file is located here on the engine vm:

/usr/share/ansible/roles/oVirt.metrics/roles/ovirt_initial_validations/tasks/check_logging_collectors.yml

The following lines will fail if elasticsearch_host or fluentd_elasticsearch_host are undefined:

elasticsearch_host == None or elasticsearch_host is undefined
fluentd_elasticsearch_host == None or fluentd_elasticsearch_host is undefined
when: (fluentd_elasticsearch_host == "elasticsearch-server.example.com") or (fluentd_elasticsearch_host is undefined)

(Comparing undefined to anything will fail, even if is undefined appears later in the logic)

Possible solution:

elasticsearch_host | default(None) == None
fluentd_elasticsearch_host | default(None) == None
when: (fluentd_elasticsearch_host | default == "elasticsearch-server.example.com")

In the last case, I'm not sure what it's purpose is since it's a hard-coded example... is the role generated dynamically?

To reproduce

  1. hosted-engine --deploy --4

  2. Install pip3.11 and then netaddr on the engine VM immediately after the Python 3.11 is installed (per error on installing a self-hosted engine #867)

Expected behavior

The engine should not fail while adding its host.

Additional context

For anyone looking for a quick fix:

  1. Console into the engine vm from the host node:
virsh -c qemu:///system?authfile=/etc/ovirt-hosted-engine/virsh_auth.conf console HostedEngineLocal
  1. Set the elasticsearch_host and fluentd_elasticsearch_host to None in defaults:
printf '%s\n' 'elasticsearch_host:' 'fluentd_elasticsearch_host:' >> /usr/share/ansible/roles/oVirt.metrics/roles/ovirt_initial_validations/defaults/main.yml
@o0-o o0-o added the bug label Jun 25, 2023
@michalskrivanek
Copy link
Member

This was fixed by oVirt/ovirt-engine-metrics#35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants