forked from fediversity/fediversity
pass proxmox user/pw thru env var as well, should fix usage from flake again
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
parent
6522ef8e67
commit
a6a3396211
7 changed files with 30 additions and 83 deletions
|
|
@ -26,8 +26,6 @@ let
|
||||||
sshOpts
|
sshOpts
|
||||||
key-file
|
key-file
|
||||||
httpBackend
|
httpBackend
|
||||||
proxmox-user
|
|
||||||
proxmox-password
|
|
||||||
node-name
|
node-name
|
||||||
bridge
|
bridge
|
||||||
vlanId
|
vlanId
|
||||||
|
|
@ -332,8 +330,6 @@ let
|
||||||
args
|
args
|
||||||
deployment-name
|
deployment-name
|
||||||
httpBackend
|
httpBackend
|
||||||
proxmox-user
|
|
||||||
proxmox-password
|
|
||||||
node-name
|
node-name
|
||||||
bridge
|
bridge
|
||||||
vlanId
|
vlanId
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,6 @@ let
|
||||||
"ProxyCommand=ssh -W %h:%p pve"
|
"ProxyCommand=ssh -W %h:%p pve"
|
||||||
];
|
];
|
||||||
key-file = "/root/.ssh/id_ed25519";
|
key-file = "/root/.ssh/id_ed25519";
|
||||||
proxmox-user = "root@pam";
|
|
||||||
proxmox-password = "mytestpw";
|
|
||||||
node-name = "pve";
|
node-name = "pve";
|
||||||
bridge = "br0";
|
bridge = "br0";
|
||||||
vlanId = 0;
|
vlanId = 0;
|
||||||
|
|
|
||||||
|
|
@ -25,15 +25,6 @@ in
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "";
|
default = "";
|
||||||
};
|
};
|
||||||
proxmox-user = mkOption {
|
|
||||||
description = "The ProxmoX user to use.";
|
|
||||||
type = types.str;
|
|
||||||
default = "root@pam";
|
|
||||||
};
|
|
||||||
proxmox-password = mkOption {
|
|
||||||
description = "The ProxmoX password to use.";
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
node-name = mkOption {
|
node-name = mkOption {
|
||||||
description = "the name of the ProxmoX node to use.";
|
description = "the name of the ProxmoX node to use.";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
|
|
||||||
|
|
@ -311,16 +311,6 @@ let
|
||||||
description = "The path to the root of the repository.";
|
description = "The path to the root of the repository.";
|
||||||
type = types.path;
|
type = types.path;
|
||||||
};
|
};
|
||||||
proxmox-user = mkOption {
|
|
||||||
description = "The ProxmoX user to use.";
|
|
||||||
type = types.str;
|
|
||||||
default = "root@pam";
|
|
||||||
};
|
|
||||||
# TODO: is sensitivity here handled properly?
|
|
||||||
proxmox-password = mkOption {
|
|
||||||
description = "The ProxmoX password to use.";
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
node-name = mkOption {
|
node-name = mkOption {
|
||||||
description = "the name of the ProxmoX node to use.";
|
description = "the name of the ProxmoX node to use.";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
|
@ -388,8 +378,6 @@ let
|
||||||
deployment-name
|
deployment-name
|
||||||
httpBackend
|
httpBackend
|
||||||
root-path
|
root-path
|
||||||
proxmox-user
|
|
||||||
proxmox-password
|
|
||||||
node-name
|
node-name
|
||||||
bridge
|
bridge
|
||||||
vlanId
|
vlanId
|
||||||
|
|
@ -464,8 +452,6 @@ let
|
||||||
bridge
|
bridge
|
||||||
;
|
;
|
||||||
node_name = node-name;
|
node_name = node-name;
|
||||||
proxmox_user = proxmox-user;
|
|
||||||
proxmox_password = proxmox-password;
|
|
||||||
ssh_user = username;
|
ssh_user = username;
|
||||||
vlan_id = vlanId;
|
vlan_id = vlanId;
|
||||||
image_datastore_id = imageDatastoreId;
|
image_datastore_id = imageDatastoreId;
|
||||||
|
|
|
||||||
|
|
@ -31,15 +31,6 @@ provider "proxmox" {
|
||||||
# # port = 22
|
# # port = 22
|
||||||
# }
|
# }
|
||||||
}
|
}
|
||||||
|
|
||||||
# # Choose one authentication method:
|
|
||||||
# api_token = var.virtual_environment_api_token
|
|
||||||
# # OR
|
|
||||||
username = var.proxmox_user
|
|
||||||
password = var.proxmox_password
|
|
||||||
# # OR
|
|
||||||
# auth_ticket = var.virtual_environment_auth_ticket
|
|
||||||
# csrf_prevention_token = var.virtual_environment_csrf_prevention_token
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# # FIXME move to host
|
# # FIXME move to host
|
||||||
|
|
|
||||||
|
|
@ -9,23 +9,6 @@ variable "ssh_user" {
|
||||||
default = "root"
|
default = "root"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "proxmox_user" {
|
|
||||||
description = <<EOT
|
|
||||||
the ProxmoX user to use. needs privileges:
|
|
||||||
- `VM.Monitor`
|
|
||||||
- ...
|
|
||||||
EOT
|
|
||||||
type = string
|
|
||||||
default = "root@pam"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "proxmox_password" {
|
|
||||||
description = "the ProxmoX password to use"
|
|
||||||
type = string
|
|
||||||
sensitive = true
|
|
||||||
default = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "host" {
|
variable "host" {
|
||||||
description = "the host of the ProxmoX Virtual Environment."
|
description = "the host of the ProxmoX Virtual Environment."
|
||||||
type = string
|
type = string
|
||||||
|
|
|
||||||
58
flake.nix
58
flake.nix
|
|
@ -81,35 +81,37 @@
|
||||||
apps.default =
|
apps.default =
|
||||||
let
|
let
|
||||||
inherit (pkgs) system;
|
inherit (pkgs) system;
|
||||||
deployment =
|
deployment = pkgs.writeShellScriptBin "my-app-with-environment" ''
|
||||||
(import ./deployment/check/common/data-model.nix {
|
export PROXMOX_VE_SSH_USERNAME="kiara@ProcoliX"
|
||||||
inherit system;
|
export PROXMOX_VE_SSH_PASSWORD=""
|
||||||
config = {
|
${(import ./deployment/check/common/data-model.nix {
|
||||||
targetSystem = system;
|
inherit system;
|
||||||
nodeName = "192.168.51.81"; # root@fediversity-proxmox
|
config = {
|
||||||
pathToRoot = builtins.path {
|
targetSystem = system;
|
||||||
path = ./.;
|
nodeName = "192.168.51.81"; # root@fediversity-proxmox
|
||||||
name = "root";
|
pathToRoot = builtins.path {
|
||||||
|
path = ./.;
|
||||||
|
name = "root";
|
||||||
|
};
|
||||||
|
sshOpts = [ ];
|
||||||
|
key-file = "";
|
||||||
|
node-name = "node051";
|
||||||
|
bridge = "ovsbr0";
|
||||||
|
vlanId = 1305;
|
||||||
|
imageDatastoreId = "local";
|
||||||
|
vmDatastoreId = "linstor_storage";
|
||||||
|
cdDatastoreId = "local-lvm";
|
||||||
|
ipv4Gateway = "eth0";
|
||||||
|
ipv4Address = "";
|
||||||
|
# ipv4Address = "95.215.187.${vm-id}";
|
||||||
|
ipv6Gateway = "eth0";
|
||||||
|
ipv6Address = "";
|
||||||
|
# ipv6Address = "2a00:51c0:13:1305::${vm-id}";
|
||||||
};
|
};
|
||||||
sshOpts = [ ];
|
# opt not to pass `inputs`, as we could only pass serializable arguments through to its self-call
|
||||||
key-file = "";
|
})."tf-proxmox-deployment".tf-proxmox-host
|
||||||
proxmox-user = "kiara@ProcoliX";
|
}
|
||||||
proxmox-password = "";
|
'';
|
||||||
node-name = "node051";
|
|
||||||
bridge = "ovsbr0";
|
|
||||||
vlanId = 1305;
|
|
||||||
imageDatastoreId = "local";
|
|
||||||
vmDatastoreId = "linstor_storage";
|
|
||||||
cdDatastoreId = "local-lvm";
|
|
||||||
ipv4Gateway = "eth0";
|
|
||||||
ipv4Address = "";
|
|
||||||
# ipv4Address = "95.215.187.${vm-id}";
|
|
||||||
ipv6Gateway = "eth0";
|
|
||||||
ipv6Address = "";
|
|
||||||
# ipv6Address = "2a00:51c0:13:1305::${vm-id}";
|
|
||||||
};
|
|
||||||
# opt not to pass `inputs`, as we could only pass serializable arguments through to its self-call
|
|
||||||
})."tf-proxmox-deployment".tf-proxmox-host;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue