generated from hashicorp/packer-plugin-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from laszlojau/main
Return values from multiple secret fields
- Loading branch information
Showing
4 changed files
with
57 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ packer { | |
required_plugins { | ||
tss = { | ||
version = ">= 0.1.0" | ||
source = "github.com/breed808/packer-plugin-tss" | ||
source = "github.com/breed808/tss" | ||
} | ||
} | ||
} | ||
|
@@ -54,7 +54,8 @@ data "tss" "mock-data" { | |
password = "test123" # TSS password | ||
server_url = "https://my-thycotic-server.example.com/SecretServer" | ||
secret_id = "500" # ID of TSS secret to retrieve | ||
secret_id = 500 # ID of TSS secret to retrieve | ||
secret_fields = ["username", "password"] # Fields to retrieve from the TSS secret | ||
} | ||
``` | ||
|
||
|
@@ -67,7 +68,8 @@ data "tss" "mock-data" { | |
server_url = "https://my-thycotic-server.example.com/SecretServer" | ||
domain = "example.com" # Domain of user. I.E. [email protected] | ||
secret_id = "500" # ID of TSS secret to retrieve | ||
secret_id = 500 # ID of TSS secret to retrieve | ||
secret_fields = ["username", "password"] # Fields to retrieve from the TSS secret | ||
} | ||
``` | ||
|
||
|
@@ -84,7 +86,8 @@ data "tss" "mock-data" { | |
password = "test123" # TSS password | ||
server_url = "https://my-thycotic-server.example.com/SecretServer" | ||
secret_id = "500" # ID of TSS secret to retrieve | ||
secret_id = 500 # ID of TSS secret to retrieve | ||
secret_fields = ["username", "password"] # Fields to retrieve from the TSS secret | ||
} | ||
build { | ||
|
@@ -105,12 +108,21 @@ build { | |
datacenter = "PackerDatacenter" | ||
datastore = "datastore1" | ||
host = "123.45.678.9" | ||
password = data.mock-data.password | ||
username = data.mock-data.username | ||
password = data.mock-data.fields.username | ||
username = data.mock-data.fields.password | ||
} | ||
} | ||
} | ||
``` | ||
|
||
**NOTE:** Packer does not seem to support sensitive values from custom data sources yet. If you are passing the variables to provisioners and wish to keep them sensitive, you can create a sensitive local. | ||
|
||
```hcl | ||
local "my_secret_password" { | ||
expression = "${data.mock-data.fields.password}" | ||
sensitive = true | ||
} | ||
``` | ||
|
||
## Packer Compatibility | ||
This template is compatible with Packer >= v1.7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
data "tss" "mock-data" { | ||
username = "testing" | ||
password = "test123" | ||
username = "testing" | ||
password = "test123" | ||
server_url = "https://my-thycotic-server.example.com/SecretServer" | ||
|
||
secret_id = "500" | ||
secret_fields = [ | ||
"password", | ||
"username", | ||
] | ||
} |