Project

General

Profile

action #173935

Updated by JERiveraMoya 18 days ago

#### 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. secrets. 

 #### 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

Back