## Problem
* Bug [bsc#1246997](https://bugzilla.suse.com/show_bug.cgi?id=1246997)
To answer questions in advance when using the unattended mode, it is
required to use a pre-script. If you just want Agama to use the default
values, it is kind of straight-forward:
```jsonnet
scripts: {
pre: [
{
name: 'disable-questions',
content: |||
#!/usr/bin/bash
agama questions mode non-interactive
|||
}
]
}
```
However, if you want to answer an specific question (e.g., providing a
password for an existing encrypted file system) it is kind of tricky.
You might need to create a file like this:
```json
{
"answers": [
{
"password": "my-password",
"class": "storage.luks_activation"
},
]
}
```
And the load it using a pre-script:
```jsonnet
scripts: {
pre: [
{
name: 'disable-questions',
content: |||
#!/usr/bin/bash
agama download http://my-server.lan/answers.json answers.json
agama questions answers answers.json
|||
}
]
}
```
## Solution
Allow embedding the answers in the profile.
```json
"questions": {
"policy": "auto",
"answers": [
{ "class": "storage.luks_activation", "password": "nots3cr3t" }
]
```
* `policy`: ask the user (`user`) or choose the default option (`auto`).
* `answers`: list of answers to the given question.
## Testing
- *Added a new unit test*
- *Tested manually*