An example below of changing my sso-admin password on vcenter using Direktiv.
functions:
- id: govc
type: reusable
image: direktiv/govc:v1
description: change password on vcenter using govc
states:
- id: change
type: action
action:
function: govc
secrets: ["USERNAME", "NEWPASSWORD", "PASSWORD"]
input:
username: jq(.secrets.USERNAME)
password: jq(.secrets.PASSWORD)
commands:
- jq("sso.user.update -p=" .secrets.NEWPASSWORD + "-k=true trent")
url: "https://vcsa.vorteil.local"
input:
username: test # Used to login
password: x # Used to login
commands: # commands that fork the govc binary
- test
- test2
url: https://vcsa.vorteil.local #VCenter address to connect to
The output for this action is an array of strings which contains the output of each command executed on the application.
{
"return": [
"execution output of the first command in the commands array",
"execution output of the second command"
]
}
In the case that an error is encountered, it will present in the following format:
{
"errorCode": "com.%s-govc.error",
"errorMsg": "Something went wrong"
}
NOTE: %s indicating where in the container logic the application failed.
Content type
Image
Digest
Size
18.1 MB
Last updated
almost 5 years ago
docker pull trentis/govc