mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-07-01 02:52:58 +00:00
chore(docs): minor improvements around SSH private key usage (#1091)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
parent
85705fdd51
commit
171dd2f234
@ -121,22 +121,24 @@ The SSH agent authentication takes precedence over the `private_key` and `passwo
|
|||||||
In some cases where SSH agent is not available, for example when running Terraform from a Windows machine, or when using a CI/CD pipeline that does not support SSH agent forwarding,
|
In some cases where SSH agent is not available, for example when running Terraform from a Windows machine, or when using a CI/CD pipeline that does not support SSH agent forwarding,
|
||||||
you can use the `private_key` argument in the `ssh` block (or alternatively `PROXMOX_VE_SSH_PRIVATE_KEY` environment variable) to provide the private key for the SSH connection.
|
you can use the `private_key` argument in the `ssh` block (or alternatively `PROXMOX_VE_SSH_PRIVATE_KEY` environment variable) to provide the private key for the SSH connection.
|
||||||
|
|
||||||
The private key must be in PEM format, and can be loaded from a file:
|
The private key mut not be encrypted, and must be in PEM format.
|
||||||
|
|
||||||
|
You can provide the private key from a file:
|
||||||
```terraform
|
```terraform
|
||||||
provider "proxmox" {
|
provider "proxmox" {
|
||||||
...
|
// ...
|
||||||
|
|
||||||
ssh {
|
ssh {
|
||||||
agent = false
|
agent = false
|
||||||
private_key = file("~/.ssh/id_rsa")
|
private_key = file("~/.ssh/id_rsa")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
Not recommended, but you can also use a heredoc syntax to provide the private key as a string (note that the private key content must not be indented):
|
|
||||||
|
Alternatively, although not recommended due to the increased risk of exposing an unprotected key, heredoc syntax can be used to supply the private key as a string.
|
||||||
|
Note that the content of the private key must not be indented:
|
||||||
```terraform
|
```terraform
|
||||||
provider "proxmox" {
|
provider "proxmox" {
|
||||||
...
|
// ...
|
||||||
|
|
||||||
ssh {
|
ssh {
|
||||||
agent = false
|
agent = false
|
||||||
@ -146,6 +148,7 @@ b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
|||||||
<SKIPPED>
|
<SKIPPED>
|
||||||
DMUWUEaH7yMCKl7uCZ9xAAAAAAECAwQF
|
DMUWUEaH7yMCKl7uCZ9xAAAAAAECAwQF
|
||||||
-----END OPENSSH PRIVATE KEY-----
|
-----END OPENSSH PRIVATE KEY-----
|
||||||
|
EOF
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -157,7 +160,7 @@ This can be overridden by specifying the `username` argument in the `ssh` block
|
|||||||
|
|
||||||
```terraform
|
```terraform
|
||||||
provider "proxmox" {
|
provider "proxmox" {
|
||||||
...
|
// ...
|
||||||
|
|
||||||
ssh {
|
ssh {
|
||||||
agent = true
|
agent = true
|
||||||
|
Loading…
Reference in New Issue
Block a user