external_password - delphix/dxtoolkit GitHub Wiki
Overview
External password support allows users to define a environment variable or script to pass password to dxtoolkit. In such case there is no need to keep password (in plain or encrypted form) in configuration file.
Example with environment variable
Environment variables has to be created to keep a password for Delphix Engines. Variable ENGINE1PASS will be used to find a password for Engine1 Variable ENGINE2PASS will be used to find a password for Engine2
{
"data":[
{
"hostname" : "Engine1",
"ip_address" : "10.10.10.10",
"username" : "admin",
"passwordvar" : "ENGINE1PASS",
"port" : "80",
"default" : "true",
"encrypted" : "false"
},
{
"hostname" : "Engine1",
"ip_address" : "10.10.10.20",
"username" : "admin",
"passwordvar" : "ENGINE2PASS",
"port" : "80",
"default" : "true",
"encrypted" : "false"
}
]
}
Example with external script
The external script will be called to retrieve password for each engine. The following arguments will be passed to the script:
- hostname
- username
- ip_address
- a value of additionalopt configuration parameter
Script has to return a password using stdout.
Example config file:
{
"data":[
{
"hostname" : "Engine1",
"ip_address" : "10.10.10.10",
"username" : "admin",
"passwordscript" : "/home/delphix/givemepass.sh",
"additionalopt" : "engine1safe",
"port" : "80",
"default" : "true",
"encrypted" : "false"
},
{
"hostname" : "Engine1",
"ip_address" : "10.10.10.20",
"username" : "admin",
"passwordscript" : "/home/delphix/givemepass.sh",
"additionalopt" : "engine2safe",
"port" : "80",
"default" : "true",
"encrypted" : "false"
}
]
}
Example script execution for Engine1:
/home/delphix/givemepass.sh Engine1 admin 10.10.10.10 engine1safe
Example script execution for Engine1:
/home/delphix/givemepass.sh Engine2 admin 10.10.10.20 engine2safe
Prevalidate
The prevalidate parameter defines when environment variable check or script execution will happen.
If parameter is not set or if it is set to false, dxtoolkit will check environment variable or will execute a script only if there is no active session. If there is a valid cookie and Delphix Engine session is not expired, password won't be retrieved from variable and script won't be executed.
If parameter is set to true, dxtoolkit will check environment variable or will execute a script every time the command is executed, regardless if session exist or not.