Bug 1849517 - [RFE] Allow passing arbitrary vars to ansible
Summary: [RFE] Allow passing arbitrary vars to ansible
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-hosted-engine-setup
Classification: oVirt
Component: General
Version: 2.4.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.4.2
: 2.4.6
Assignee: Yedidyah Bar David
QA Contact: Nikolai Sednev
URL:
Whiteboard:
Depends On:
Blocks: 1785014
TreeView+ depends on / blocked
 
Reported: 2020-06-22 05:52 UTC by Yedidyah Bar David
Modified: 2020-09-18 09:11 UTC (History)
5 users (show)

Fixed In Version: ovirt-hosted-engine-setup-2.4.6-1.el8ev
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1851677 (view as bug list)
Environment:
Last Closed: 2020-09-18 07:11:51 UTC
oVirt Team: Integration
Embargoed:
sbonazzo: ovirt-4.4?
sbonazzo: planning_ack?
sbonazzo: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1851860 0 medium CLOSED Allow hosted-engine deployment on command line offline 2021-02-22 00:41:40 UTC
oVirt gerrit 109730 0 master MERGED Allow passing extra vars to ansible calls 2021-02-06 17:31:23 UTC

Internal Links: 1851860

Description Yedidyah Bar David 2020-06-22 05:52:27 UTC
Description of problem:

Current ovirt-hosted-engine-setup is a wrapper to several ansible playbooks.

The actual code is in a separate project, ovirt-ansible-hosted-engine-setup, with its own documentation - in particular, allowing passing specific variables to affects its behavior.

IMO it should be possible to allow passing such variables directly from 'hosted-engine --deploy', based on the documentation of ovirt-ansible-hosted-engine-setup, and with the understanding that this can conflict with variables otherwise already set by 'hosted-engine --deploy'.

I am currently opening this bug because we recently fixed bug 1816619, adding a new variable to affect the deploy process, but provide no easy means for the user to use this new functionality. While it can be even more helpful to add to 'hosted-engine --deploy' specific functionality for each such variable (including, perhaps, user interaction, validation, etc.), as we usually do, I do not think this is mandatory.

Version-Release number of selected component (if applicable):
Current master, probably since 4.3

How reproducible:
Always

Steps to Reproduce:
1. Install ovirt-ansible-hosted-engine-setup with a version that includes a fix to bug 1816619. 
2. Deploy hosted-engine with an old appliance and a broken mirror, such that 'dnf update ovirt-engine' on the engine VM fails, 
3.

Actual results:
Fails

Expected results:
Be able to easily pass some option that will cause the ansible code to run with he_offline_deployment=true, so that deploy will succeed

Additional info:
Already pushed a patch to do this, adding a new option:

    --ansible-extra-vars=VARS
        Pass '--extra-vars=VARS' to all ansible calls

This should allow to do (2.) as:

hosted-engine --deploy --ansible-extra-vars=he_offline_deployment=true

Opening this bug currently only on the CLI 'hosted-engine --deploy'. We probably want a similar bug for the cockpit UI - but I do not know the code there well, no idea how hard/easy it is to do.

Comment 1 Yedidyah Bar David 2020-06-22 05:58:42 UTC
This was also reported in ovirt-users mailing list, thread subject was:

[ovirt-users] Hosted engine deployment fails consistently when trying to download files.

Comment 2 Yedidyah Bar David 2020-06-28 05:53:18 UTC
bug 1851677 is a clone for cockpit.

Comment 3 Nikolai Sednev 2020-08-13 14:11:59 UTC
alma03 ~]# hosted-engine --deploy --ansible-extra-vars=he_offline_deployment=true

alma03 ~]# grep "he_offline_deployment"  /var/log/ovirt-hosted-engine-setup/ovirt-hosted-engine-setup-20200813170207-x8q8o7.log
2020-08-13 17:02:07,101+0300 DEBUG otopi.context context.dumpEnvironment:775 ENV OVEHOSTED_CORE/ansibleUserExtraVars=str:'he_offline_deployment=true'
2020-08-13 17:02:07,764+0300 DEBUG otopi.context context.dumpEnvironment:775 ENV OVEHOSTED_CORE/ansibleUserExtraVars=str:'he_offline_deployment=true'
2020-08-13 17:02:18,677+0300 DEBUG otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils.run:194 ansible-playbook: cmd: ['/bin/ansible-playbook', '--module-path=/usr/share/ovirt-hosted-engine-setup/ansible', '--inventory=localhost,', '--extra-vars=@/tmp/tmplys4rby6', '--extra-vars=he_offline_deployment=true', '--tags=get_network_interfaces', '--skip-tags=always', '/usr/share/ovirt-hosted-engine-setup/ansible/trigger_role.yml']
2020-08-13 17:07:46,049+0300 DEBUG otopi.context context.dumpEnvironment:775 ENV OVEHOSTED_CORE/ansibleUserExtraVars=str:'he_offline_deployment=true'
2020-08-13 17:07:49,049+0300 DEBUG otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils.run:194 ansible-playbook: cmd: ['/bin/ansible-playbook', '--module-path=/usr/share/ovirt-hosted-engine-setup/ansible', '--inventory=localhost,nsednev-he-1.qa.lab.tlv.redhat.com', '--extra-vars=@/tmp/tmpri7u02xe', '--extra-vars=he_offline_deployment=true', '--tags=initial_clean', '--skip-tags=always', '/usr/share/ovirt-hosted-engine-setup/ansible/trigger_role.yml']

ovirt-hosted-engine-setup-2.4.6-1.el8ev.noarch
ovirt-hosted-engine-ha-2.4.4-1.el8ev.noarch
vdsm-4.40.25-1.el8ev.x86_64
rhvm-appliance-4.4-20200707.0.el8ev.src.rpm
Linux 4.18.0-193.14.3.el8_2.x86_64 #1 SMP Mon Jul 20 15:02:29 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Red Hat Enterprise Linux release 8.2 (Ootpa)

Comment 4 Nikolai Sednev 2020-08-13 14:13:43 UTC
ansible-extra-vars being passed as expected and deployment continued even with disabled repos and with an old appliance, locally installed on host.

Comment 5 Sandro Bonazzola 2020-09-18 07:11:51 UTC
This bugzilla is included in oVirt 4.4.2 release, published on September 17th 2020.

Since the problem described in this bug report should be resolved in oVirt 4.4.2 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.