Bug 1507427 - [RFE] To be able to add custom values for engine-setup from hosted-engine-setup answer file.
Summary: [RFE] To be able to add custom values for engine-setup from hosted-engine-set...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-hosted-engine-setup
Classification: oVirt
Component: RFEs
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.2.2
: 2.2.7
Assignee: Simone Tiraboschi
QA Contact: Nikolai Sednev
URL:
Whiteboard:
Depends On:
Blocks: 1458709
TreeView+ depends on / blocked
 
Reported: 2017-10-30 09:03 UTC by Kobi Hakimi
Modified: 2018-03-29 11:01 UTC (History)
5 users (show)

Fixed In Version: ovirt-hosted-engine-setup-2.2.7
Doc Type: Enhancement
Doc Text:
This release introduces a hook mechanism on one of the setup Ansible playbooks, allowing you to add custom values for engine-setup to the hosted-engine-setup answer file. You can place custom .yml files with Ansible tasks under /usr/share/ovirt-hosted-engine-setup/ansible/hooks/enginevm_before_engine_setup/ and /usr/share/ovirt-hosted-engine-setup/ansible/hooks/enginevm_after_engine_setup/. The first set of tasks will be executed on the Manager VM before running engine-setup (example: install custom Manager RPMs or inject something in the answer file for engine-setup); the second set will be executed after engine-setup (example: change a parameter with engine-config). Two examples are available in /usr/share/ovirt-hosted-engine-setup/ansible/hooks/enginevm_before_engine_setup/enginevm_before_engine_setup.yml.example and /usr/share/ovirt-hosted-engine-setup/ansible/hooks/enginevm_after_engine_setup/enginevm_after_engine_setup.yml.example.
Clone Of:
Environment:
Last Closed: 2018-03-29 11:01:09 UTC
oVirt Team: Integration
Embargoed:
rule-engine: ovirt-4.2+
nsednev: testing_plan_complete-
ylavi: planning_ack+
rule-engine: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)
answer file with appliance keys and custom engine-setup keys (2.79 KB, text/plain)
2017-10-30 09:03 UTC, Kobi Hakimi
no flags Details
the answer file that deployed (without the custom engine-setup keys) (3.39 KB, text/plain)
2017-10-30 09:07 UTC, Kobi Hakimi
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1532213 0 unspecified CLOSED [HE] in deploy of Hosted Engine with ansible we should remove the otopi question "generate on-fly a cloud-init ISO image... 2021-02-22 00:41:40 UTC
oVirt gerrit 86549 0 master MERGED ansible: add an hook mechanism for engine VM tasks 2020-12-27 10:48:14 UTC

Internal Links: 1532213

Description Kobi Hakimi 2017-10-30 09:03:41 UTC
Created attachment 1345342 [details]
answer file with appliance keys and custom engine-setup keys

Description of problem:
[RFE] To be able to add custom values for engine-setup from hosted-engine-setup answer file.

Version-Release number of selected component (if applicable):
rhvm-appliance-4.1.20171019.0-1.el7.noarch.rpm

How reproducible:
100%

Steps to Reproduce:
1. Add keys related to engine-setup into the hosted-engine-setup answer file.
for example:
OVESETUP_DWH_DB\*
OVESETUP_REPORTS_DB\*

2. Run the command: hosted-engine --deploy --config-append=<the answer file above> 

Actual results:
The custom keys related to engine-setup would not take effect 

Expected results:
To be able to add keys related to engine-setup to the same answer file and we could do the deploy and custom engine-setup at the same time.
OR
To add one more option to "hosted-engine --deploy" 
like --engine-config-append=<the engine setup answer file> 
and there add the custom configuration for engine-setup.


Additional info:
You can see:
1. Example of the answer file that I tried to deploy with.
2. The answer file that created during hosted-engine --deploy

Comment 1 Kobi Hakimi 2017-10-30 09:07:18 UTC
Created attachment 1345346 [details]
the answer file that deployed (without the custom engine-setup keys)

Comment 2 Kobi Hakimi 2017-10-30 09:08:18 UTC
for now, to be able to create custom engine-setup we create custom cloud-init iso
as you can see in:
https://github.com/fusor/ansible-ovirt/blob/master/roles/self_hosted_first_host/tasks/main.yml#L83

Comment 3 Sandro Bonazzola 2017-11-03 09:58:25 UTC
As far as I know, you can provide a customized cloud init payload while running ovirt-hosted-engine-setup, so you should be able to add whatever you want to the answer file to be passed to the engine.

Simone can you give an hint here on how to do that? I think we can close this as not a bug.

Comment 4 Simone Tiraboschi 2017-11-06 08:40:43 UTC
From hosted-engine-setup currently you can:
- generate a cloud-init ISO image without the capability to inject custom answer files for engine-setup on the engine VM
- pass a a custom cloud-init ISO image where everything (including eventually  back-porting workarounds for cloud-init bugs), non just engine-setup answer-files, will be up to you.

We can add an intermediate option where hosted-engine-setup will still generate cloud-init ISO image for you but it will allow the user to add an additional answer file for engine-setup that will be injected in the cloud-init generate ISO image as well.

Comment 5 Simone Tiraboschi 2018-01-23 10:38:30 UTC
We introduced an hook mechanism on one of the setup ansible playbooks.
The user can place custom files .yml file with ansible tasks under /usr/share/ovirt-hosted-engine-setup/ansible/hooks/enginevm_before_engine_setup/ and /usr/share/ovirt-hosted-engine-setup/ansible/hooks/enginevm_after_engine_setup/

The first set of tasks will be executed on the engine VM before running engine-setup (example: install custom engine rpms or inject something in the answer file for engine-setup), the second set will be executed after engine-setup (example: change some parameter with engine-config).

Two examples are available in /usr/share/ovirt-hosted-engine-setup/ansible/hooks/enginevm_before_engine_setup/enginevm_before_engine_setup.yml.example and /usr/share/ovirt-hosted-engine-setup/ansible/hooks/enginevm_after_engine_setup/enginevm_after_engine_setup.yml.example

Comment 6 Nikolai Sednev 2018-02-18 14:31:51 UTC
Forth to our conversation with Kobi, this is working fine now.
Tested on:
ovirt-hosted-engine-ha-2.2.5-1.el7ev.noarch
ovirt-hosted-engine-setup-2.2.10-1.el7ev.noarch
rhvm-appliance-4.2-20180202.0.el7.noarch
Linux 3.10.0-693.19.1.el7.x86_64 #1 SMP Thu Feb 1 12:34:44 EST 2018 x86_64 x86_64 x86_64 GNU/Linux

Comment 7 Sandro Bonazzola 2018-03-29 11:01:09 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.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.