feat: support SSH private key injection for CI
Use proxmox_ssh_private_key variable when available, otherwise fall back to SSH agent for local development.
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
# =====================================================================
|
# ==========================================================================
|
||||||
# Déclaration des Providers Terraform
|
# Déclaration des Providers Terraform
|
||||||
#
|
#
|
||||||
# Ce fichier indique à Terraform quels "plugins" il doit
|
# Ce fichier indique à Terraform quels "plugins" il doit
|
||||||
# télécharger pour interagir avec les API externes (Proxmox, etc.)
|
# télécharger pour interagir avec les API externes (Proxmox, etc.)
|
||||||
# et comment les configurer.
|
# et comment les configurer.
|
||||||
# =====================================================================
|
# ==========================================================================
|
||||||
|
|
||||||
terraform {
|
terraform {
|
||||||
required_version = ">= 1.5.0"
|
required_version = ">= 1.5.0"
|
||||||
@@ -43,7 +43,8 @@ provider "proxmox" {
|
|||||||
api_token = var.proxmox_api_token
|
api_token = var.proxmox_api_token
|
||||||
insecure = true
|
insecure = true
|
||||||
ssh {
|
ssh {
|
||||||
agent = true
|
agent = var.proxmox_ssh_private_key == "" ? true : false
|
||||||
username = "root"
|
username = "root"
|
||||||
|
private_key = var.proxmox_ssh_private_key != "" ? var.proxmox_ssh_private_key : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user