-
Notifications
You must be signed in to change notification settings - Fork 3
Add documentation forscripts.retry questions
#134
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
Open
imobachgs
wants to merge
4
commits into
main
Choose a base branch
from
add-scripts-retry
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| --- | ||
| sidebar_position: 15 | ||
| --- | ||
|
|
||
| # Questions | ||
|
|
||
| Agama allows you to automate the process of answering questions during an unattended installation. | ||
| This feature is crucial for creating truly hands-off Agama profiles, as it eliminates the need for | ||
| user interaction when the installer encounters a choice or requires specific input. | ||
|
|
||
| This section explains how to define policies for answering questions and provides a list of the | ||
| question classes you can configure. | ||
|
|
||
| --- | ||
|
|
||
| ## Configuring automatic answers | ||
|
|
||
| Automatic answers are configured within the `questions` key of your Agama profile. This object has | ||
| two main properties: `policy` and `answers`. | ||
|
|
||
| ```json | ||
| { | ||
| "questions": { | ||
| "policy": "auto", | ||
| "answers": [ | ||
| { | ||
| "class": "storage.activate_multipath", | ||
| "answer": "yes", | ||
| }, | ||
| { | ||
| "class": "storage.luks_activation", | ||
| "answer": "decrypt", | ||
| "password": "my-secret-password" | ||
| "data": { | ||
| "device": "/dev/sda22" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## The `policy` property | ||
|
|
||
| The `policy` property determines the default behavior for questions the installer encounters. It's a | ||
| string with two possible values: | ||
|
|
||
| - **`"user"`** (default): The installer will use any pre-defined answers from the `answers` list. If | ||
| a question is encountered that does not have a matching answer, the installer will ask the user | ||
| for a response. | ||
| - **`"auto"`**: The installer will use any pre-defined answers from the `answers` list. If a | ||
| question is encountered that does not have a matching answer, the installer will automatically | ||
| select the default value for that question. If there's no default, the installation will fail. | ||
|
|
||
| ## The `answers` property | ||
|
|
||
| The `answers` property is an array of objects, where each object represents a pre-defined answer for | ||
| a specific question. | ||
|
|
||
| Each answer object can have the following properties: | ||
|
|
||
| - `class`: a unique identifier for the question (e.g., `"storage.activate_multipath"`). | ||
| - `text`: the full text of the question. | ||
| - `answer`: the value to be used as the answer. | ||
| - `password`: an additional field that is required for questions that also need a password, such as | ||
| `storage.luks_activation` with `decrypt` answer. | ||
| - `data`: an optional object with additional key-value pairs to match the question. | ||
|
|
||
| The installer will attempt to match a question to an answer by checking the `class`, `text`, and | ||
| `data` properties. | ||
|
|
||
| :::note Partial data matching | ||
|
|
||
| The installer performs a **partial match** on the `data` object. If your answer's `data` entry | ||
| contains a subset of the properties in the question's data, it will still be considered a match if | ||
| the values for the specified properties are identical. For example, a question might contain | ||
| `{ "id": "123", "checksum": "abc", "name": "file.txt" }`, but you only need to specify | ||
| `{ "checksum": "abc" }` to match it. | ||
|
|
||
| ::: | ||
|
|
||
| :::warning | ||
|
|
||
| The `Retry` value for the `answer` property could get the installation into an infinity loop. Avoid | ||
| using `Retry` if you are not totally sure that the question is going to success at some point. In | ||
| the future, this problem could be overcome by defining a maximum number of attempts. | ||
|
|
||
| ::: | ||
|
|
||
| --- | ||
|
|
||
| ## Supported question classes | ||
|
|
||
| The following table lists the possible question classes, their descriptions, and the data you can | ||
| use to match them. | ||
|
|
||
| | Class | Description | Possible Answers | Available Data | | ||
| | :------------------------------------- | :----------------------------------------------------------------------------------------------------------------------- | :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| | `autoyast.unsupported` | When there are unsupported elements in an AutoYaST profile. | `Abort`, `Continue` | `planned`: elements to be supported in the future.<br />`unsupported`: unsupported elements. | | ||
| | `scripts.retry` | When a user script fails | `yes`, `no` | `name`: script's name.<br />`stderr`: standard error (limited to 512 bytes at most).<br />`exit_status`: exit status code. | | ||
| | `software.medium_error` | When there is an issue accessing the software medium. | `Retry`, `Skip` | `url`: The URL where the access failed. | | ||
| | `software.unsigned_file` | When a file from a repository is not digitally signed. | `Yes`, `No` | `filename`: The name of the file. | | ||
| | `software.import_gpg` | When a signature is signed with an unknown GPG key. | `Trust`, `Skip` | `id`, `name`, `fingerprint`: Details of the unknown key. | | ||
| | `software.unknown_gpg` | When a file is signed by an unknown key. | `Trust`, `Skip` | `id`: The key ID.<br />`filename`: The name of the signed file. | | ||
| | `software.digest.no_digest` | When a file is in a signed repository, but is not listed in the list of checksums. | `Yes`, `No` | | | ||
| | `software.digest.unknown_digest` | When a file has a checksum, but the expected checksum is not known. This question type is also used for wrong checksums. | `Yes`, `No` | | | ||
| | `software.package_error.medium_error` | When a package failed to be downloaded from the medium. | `Retry`, `Continue` | `url`: The URL of the package. | | ||
| | `software.package_error.provide_error` | When a package failed to be provided, e.g., due to an IO error. | `Retry`, `Continue` | | | ||
| | `software.script_error` | When a package script failed. | `Retry`, `Continue` | `details`: The details of the failure. | | ||
| | `storage.activate_multipath` | When it looks like the system has multipath and if it should be activated. | `yes`, `no` | | | ||
| | `storage.commit_error` | When some storage actions failed and if it should continue. | `yes`, `no` | | | ||
| | `storage.luks_activation` | When a LUKS encrypted device is detected and requires a password to probe it. | `skip`, `decrypt` | `device`: The device name.<br />`label`: The device label.<br />`size`: The device size.<br />`attempt`: The number of the current attempt. | | ||
| | `load.retry` | Asks the user to retry loading the profile. | `Yes`, `No` | `error`: The text of the error message. | | ||
| | `registration.certificate` | When the registration server uses an unknown certificate. | `trust`, `reject` | `url`: The server URL.<br />`issuer_name`, `issue_date`, `expiration_date`: Certificate details.<br />`sha1_fingerprint`, `sha256_fingerprint`: Certificate fingerprints. | | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, this is new type for 16.1, right? I think we really need some way how to indicate to user what works where. Also if I get code the data is not always available if script failed due to different reason than non-zero exit code. So maybe some warning that data is not available always?