Project

General

Profile

Actions

action #173935

closed

coordination #169654: [epic] Create test scenarios for Agama

Pass registration code to jsonnet files

Added by JERiveraMoya 18 days ago. Updated 10 days ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
-
Start date:
2024-12-09
Due date:
% Done:

0%

Estimated time:

Description

Motivation

In the same way than for AutoYaST we cannot store the regcode in control version, so we need some mechanism to replace one or more variables, like the registration code in the jsonnet profile

Acceptance criteria

  • AC1: Pass registration code to jsonnet files so we don't store the profiles with secrets in git.
  • AC2: Consider if creating new module or existing module can be reused.

Suggestions

Option 1) The ideal option probably would be to use jsonnet as described in https://jsonnet.org/learning/tutorial.html (External variables), but we need to see availability of jsonnet package in workers, for example:
default_tw.json:

local lib = import 'library-ext.libsonnet';
{
  "product": {
    "id": "Tumbleweed",
    "registrationCode": std.extVar('registrationCode')
  },
  "user": {
    "fullName": "Bernhard M. Wiedemann",
    "password": "nots3cr3t",
    "userName": "bernhard"
  },
  "root": {
    "password": "nots3cr3t"
  }
}

Then we run jsonnet --ext-str registrationCode="111222" default_tw.json > default_tw_with_reg_code.json
Option 2) As a second option we can just do what we do with AutoYaST with regex in Perl to replace.
This is probably good enough given that jsonnet (well actually is in a 'go' package which has the same functionality) can be used in local to create complex structrures and we don't need to submit the package for each architecture (only now is available in x86_64):
https://build.opensuse.org/package/show/openSUSE:Factory/golang-github-google-jsonnet

See conversations:
https://suse.slack.com/archives/C02TLF25571/p1733737967351989
https://suse.slack.com/archives/C02CLB2LB7Z/p1733728788435359


Files

import_profile_status_422.png (5.15 KB) import_profile_status_422.png status 422 lmanfredi, 2024-12-11 08:21
Actions

Also available in: Atom PDF