agama/service
Imobach González Sosa 777852293d
feat: embed questions configuration in the profile (#2612)
## 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*
2025-07-31 15:10:17 +01:00
..
bin storage: inhibit storage subsystems 2025-07-10 12:04:50 +01:00
conf.d changes from review 2023-10-31 16:36:20 +01:00
etc adapt tests and in some case also prepare code 2023-10-26 21:53:22 +02:00
lib feat: embed questions configuration in the profile (#2612) 2025-07-31 15:10:17 +01:00
package changes 2025-07-31 09:44:51 +02:00
po Update service PO files 2025-06-15 03:41:35 +00:00
share update autoyast compat 2025-07-14 12:30:07 +02:00
test feat: embed questions configuration in the profile (#2612) 2025-07-31 15:10:17 +01:00
.editorconfig More D-Installer -> Agama renames 2023-04-18 17:56:43 +02:00
.gitignore rpm spec for the files independent of Ruby version 2024-11-05 17:28:36 +01:00
.rspec Add an RSpec configuration to simplify running tests 2022-04-22 16:48:00 +01:00
.rubocop.yml Use the DUD repository for installing packages (#2543) 2025-07-14 13:51:52 +02:00
agama-yast.gemspec chore: update spec files 2025-06-09 14:46:23 +01:00
agama-yast.spec.in chore: update spec files 2025-06-09 14:46:23 +01:00
Gemfile profile_itest: use a webrick http server 2025-05-22 10:00:09 +02:00
Gemfile.lock chore: bump version 2025-07-21 16:06:40 +01:00
install.sh test/integration/profile_itest.rb: add agama autoyast 2025-04-01 13:23:37 +02:00
README.md docs: Fix broken links after moving content to web site 2024-12-02 16:07:05 -05:00
run_tests_in_container.sh Implement initial question to import certificate 2025-04-15 16:16:41 +02:00
TEXTDOMAIN Missing textdomain (#2415) 2025-05-28 16:32:43 +02:00

Agama YaST

According to Agama's architecture this project implements the following components:

  • The Agama YaST, the layer build on top of YaST functionality.

Testing Changes

The easiest way to test changes done to Ruby code on Agama live media is to build the gem with modified sources with gem build agama-yast. Then copy the resulting file to Agama live image. Then run this sequence of commands:

# ensure that only modified sources are installed
gem uninstall agama-yast
# install modified sources including proper binary names
gem install --no-doc --no-format-executable <path to gem>

If the changes modify the D-Bus part, then restart related D-Bus services.