From 5c17cb61d77155e9c59d66990599c8e1e4629d69 Mon Sep 17 00:00:00 2001 From: jonas Date: Thu, 21 Oct 2021 16:29:58 +0200 Subject: [PATCH] . --- salt/states/tlu-harvester/files/images/.gitignore | 4 ---- .../states/tlu-harvester/files/keypair/admin.yaml | 8 -------- .../tlu-harvester/files/keypair/exilio.yaml | 8 -------- .../files/manifests/{images.sls => images.yaml} | 0 .../tlu-harvester/files/manifests/sshkeys.yaml | 15 +++++++++++++++ 5 files changed, 15 insertions(+), 20 deletions(-) delete mode 100644 salt/states/tlu-harvester/files/images/.gitignore delete mode 100644 salt/states/tlu-harvester/files/keypair/admin.yaml delete mode 100644 salt/states/tlu-harvester/files/keypair/exilio.yaml rename salt/states/tlu-harvester/files/manifests/{images.sls => images.yaml} (100%) create mode 100644 salt/states/tlu-harvester/files/manifests/sshkeys.yaml diff --git a/salt/states/tlu-harvester/files/images/.gitignore b/salt/states/tlu-harvester/files/images/.gitignore deleted file mode 100644 index 5e7d273..0000000 --- a/salt/states/tlu-harvester/files/images/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/salt/states/tlu-harvester/files/keypair/admin.yaml b/salt/states/tlu-harvester/files/keypair/admin.yaml deleted file mode 100644 index 12591c1..0000000 --- a/salt/states/tlu-harvester/files/keypair/admin.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: harvesterhci.io/v1beta1 -kind: KeyPair -metadata: - name: admin - namespace: default -spec: - publicKey: | - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILGVNwMC2H+Fn4AhCDIa4MVfEYsVF7Zs2yHc8cGbv40l jonas@admin diff --git a/salt/states/tlu-harvester/files/keypair/exilio.yaml b/salt/states/tlu-harvester/files/keypair/exilio.yaml deleted file mode 100644 index cfa0b8f..0000000 --- a/salt/states/tlu-harvester/files/keypair/exilio.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: harvesterhci.io/v1beta1 -kind: KeyPair -metadata: - name: exilio - namespace: default -spec: - publicKey: | - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDSJ4KrM7iwmUyvOznqNiTaYOIVxpog7Ktfr2xaJgH6O jonas@exsilio diff --git a/salt/states/tlu-harvester/files/manifests/images.sls b/salt/states/tlu-harvester/files/manifests/images.yaml similarity index 100% rename from salt/states/tlu-harvester/files/manifests/images.sls rename to salt/states/tlu-harvester/files/manifests/images.yaml diff --git a/salt/states/tlu-harvester/files/manifests/sshkeys.yaml b/salt/states/tlu-harvester/files/manifests/sshkeys.yaml new file mode 100644 index 0000000..407422d --- /dev/null +++ b/salt/states/tlu-harvester/files/manifests/sshkeys.yaml @@ -0,0 +1,15 @@ +{% for key in pillar['tlu-harvester']['os']['ssh_authorized_keys'] -%} +{% set len = key | length %} +{% set pos = len - key.rfind(' ') - 1 %} +{% set name = key[-pos:].replace('@','-') %} +--- +apiVersion: harvesterhci.io/v1beta1 +kind: KeyPair +metadata: + name: {{ name }} + namespace: default +spec: + publicKey: | + {{ key }} +{% endfor %} +