Skip to content

Commit

Permalink
Added encryption to template
Browse files Browse the repository at this point in the history
  • Loading branch information
okynos committed Feb 3, 2025
1 parent e79bc06 commit 59b65d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions data/yam/agama/auto/lib/storage.libsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
lvm: {
lvm(encryption=false): {
drives: [
{
alias: 'pvs-disk',
Expand All @@ -12,13 +12,15 @@
{
name: 'system',
physicalVolumes: [
{ generate: ['pvs-disk'] },
{ generate: ['pvs-disk'],
[if encryption == true then 'encryption']: { luks2: { password: "nots3cr3t" } }
},
],
logicalVolumes: [
{ generate: 'default' },
],
},
],
]
},
root_filesystem_ext4: {
drives: [
Expand Down
4 changes: 2 additions & 2 deletions data/yam/agama/auto/template.jsonnet
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
local lib = import 'lib/base.libsonnet';

function(storage='default', product='SLES', scripts='default') {
function(storage='default', product='SLES', scripts='default', encryption=false) {
product: lib.getProduct(product),
user: lib['user'],
root: lib['root'],
[if scripts == 'multipath' then 'scripts']: lib.scripts['multipath'],
[if scripts == 'default' then 'scripts']: lib.scripts['default'],

[if storage == 'lvm' then 'storage']: lib.storage['lvm'],
[if storage == 'lvm' then 'storage']: lib.storage.lvm(encryption),
[if storage == 'root_filesystem_ext4' then 'storage']: lib.storage['root_filesystem_ext4'],
[if storage == 'root_filesystem_xfs' then 'storage']: lib.storage['root_filesystem_xfs'],
}

0 comments on commit 59b65d8

Please sign in to comment.