Bug 1270719 - [RFE] Add an option to automatically accept defaults
Summary: [RFE] Add an option to automatically accept defaults
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Setup.Core
Version: 4.0.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ovirt-4.1.0-alpha
: 4.1.0.2
Assignee: Yedidyah Bar David
QA Contact: Aleksei Slaikovskii
URL:
Whiteboard:
: 1270721 1270722 1270723 (view as bug list)
Depends On:
Blocks: RHEV-RHCI 1427746
TreeView+ depends on / blocked
 
Reported: 2015-10-12 09:13 UTC by Yedidyah Bar David
Modified: 2017-03-01 04:03 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
With this update, the option '--accept-defaults' has been added to the engine-setup command. This option causes engine-setup to no longer prompt for answers that have a default. This option saves time for the user as they no longer need to answer the prompts individually if they are planning to accept the defaults and also allows other tools to run engine-setup unattended. If the engine-setup command is run using this option and a weak password is provided the user will be prompted for a stronger password because the default answer to 'Use weak password?' is No. To workaround this add the answer to an answer file.
Clone Of:
Environment:
Last Closed: 2017-02-01 14:56:41 UTC
oVirt Team: Integration
Embargoed:
rule-engine: ovirt-4.1+
lsvaty: testing_plan_complete-
ylavi: planning_ack+
sbonazzo: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1295945 0 unspecified CLOSED oVirt appliance defaults to applicationMode=virt 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1303973 0 unspecified CLOSED ovirt-system-tests: ovirt engine installation fails because of wrong answer in the answer file 2021-02-22 00:41:40 UTC
oVirt gerrit 67493 0 master MERGED packaging: setup: Add an option --accept-defaults 2020-06-28 13:15:30 UTC

Internal Links: 1295945 1303973

Description Yedidyah Bar David 2015-10-12 09:13:08 UTC
Description of problem:

Various places, including CI/QE and the engine appliance, maintain answer files
for engine-setup, in order to achieve unattended setup. This breaks whenever
a new question is added to engine-setup.

It will be helpful if we add an option called '--accept-defaults' which will
make engine-setup prompt only for questions for which it does not supply a
default, accepting the defaults for all of the others.

We should consider doing this change also in related tools - engine-cleanup,
ovirt-engine-rename, hosted-engine setup, etc. We will probably need to
change otopi, perhaps even only otopi.

This is of course also useful for normal interactive use, in case the user
knows that the defaults are ok.

Comment 1 Yedidyah Bar David 2015-10-12 09:24:07 UTC
*** Bug 1270723 has been marked as a duplicate of this bug. ***

Comment 2 Yedidyah Bar David 2015-10-12 09:24:37 UTC
*** Bug 1270722 has been marked as a duplicate of this bug. ***

Comment 3 Yedidyah Bar David 2015-10-12 09:24:43 UTC
*** Bug 1270721 has been marked as a duplicate of this bug. ***

Comment 4 Yaniv Kaul 2015-11-26 16:41:07 UTC
Initially I thought this was a great idea.
Then I actually thgouh I do want the scripts to break, so CI / QE can think if they want:
1. To accept the default
or:
2. Support different options - both the default and the non-default.

This enhancement might hide this.
Perhaps CI should use it and QE not.

Comment 5 Yedidyah Bar David 2015-11-29 07:32:04 UTC
I'd say the criteria isn't if it's in QE or CI but about what we want to test.

Tests that test engine-setup should probably not use this option, for the reasons in comment 4.

Tests that test the engine, or something else which merely needs engine-setup in order to prepare the test, should IMO use this option, as they should fail if something break in what they are supposed to test, not something else.

Comment 6 Yedidyah Bar David 2016-01-13 07:08:49 UTC
Not sure bug 1295945 is really related - it's just that if we solve current, we can supply there a much smaller one. But if we had a reason to pass 'mode=virt', this won't help.

Comment 7 Fabian Deutsch 2016-04-27 07:27:24 UTC
The HE flow is considered to be one of the more important ones now.
This RFE would help to make this flow more robust.
Without this fix we have the risk from release to release that we miss to update the currently hardcoded answerfile.

Comment 8 Yedidyah Bar David 2016-05-01 07:06:02 UTC
A change to otopi to allow this is already merged in master [1].

I didn't link current bug there nor moved to MODIFIED because I didn't add a nice option '--accept-defaults' to engine-setup. To make engine-setup accept defaults, please add this to your answer file:

DIALOG/autoAcceptDefault=bool:True

Or pass on the command line:

--otopi-environment='DIALOG/autoAcceptDefault=bool:True'

Please note that it affects only the human (default) dialect, not the machine one. So it can't be used e.g. for host-deploy (or the new cockpit interface) - it's expected that machine dialect clients can easily do this (accept the default) by themselves.

[1] https://gerrit.ovirt.org/55479

Comment 9 Sandro Bonazzola 2016-08-02 15:04:27 UTC
So, looking at comment #8, shouldn't this move to ON_QA?

Comment 10 Yedidyah Bar David 2016-08-03 08:01:58 UTC
(In reply to Sandro Bonazzola from comment #9)
> So, looking at comment #8, shouldn't this move to ON_QA?

I thought we want to add an engine-setup option '--accept-defaults' that will set env. If we don't, IMO we should at least add this to --help, which is not less work, so better just add the option.

Comment 11 Sandro Bonazzola 2016-08-04 07:16:23 UTC
Ok for adding the option.

Comment 12 Yedidyah Bar David 2016-08-11 13:46:14 UTC
A clarification:

Using this option, you'll never be prompted by questions that have defaults. E.g.:

1. engine-cleanup with only this option, will always fail - because it defaults to 'Cancel' in:
    All the installed ovirt components are about to be removed, data will be lost (OK, Cancel) [Cancel]:

To workaround this, add the answer to above question to the answer file too.

2. If you run engine-setup with only this option, and supply a too-easy admin password, you'll not be prompted 'Use weak password?', because it defaults to 'No'. So you'll be forced to supply a strong one.

To workaround this, add an admin password to the answer file.

Comment 13 Sandro Bonazzola 2016-12-12 14:01:02 UTC
The fix for this issue should be included in oVirt 4.1.0 beta 1 released on December 1st. If not included please move back to modified.

Comment 14 Aleksei Slaikovskii 2016-12-15 10:35:10 UTC
This wont be automated, basic sanity will be sufficient for verification process.

[root@engine /]# engine-setup --help
Usage: /usr/bin/engine-setup
    ...
    --accept-defaults
        Automatically use default answers in questions that have them.

Comment 15 Yedidyah Bar David 2017-02-06 09:53:56 UTC
Megan, sorry for causing a confusion.

engine-cleanup does not have an option '--accept-defaults'.

Comment 12 was a clarification to comment 8, which referred to adding the line 'DIALOG/autoAcceptDefault=bool:True' to the answer file.

Adding it to the answer file for engine-setup is the same as passing '--accept-defaults'.

engine-cleanup does not have '--accept-defaults', but users can still add this line to the answer file for the same effect. If they do, they have to consider comment 12.

Perhaps it's simplest to drop the part about 'engine-cleanup' from the doc text.

Comment 16 Megan Lewis 2017-02-06 11:22:47 UTC
Thanks for clearing that up Didi. I've removed the part about engine-cleanup from the doc text.


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