cloudstack-cloudmonkey icon indicating copy to clipboard operation
cloudstack-cloudmonkey copied to clipboard

Enable passing of profile information in cmk commandline

Open PaulAngus opened this issue 2 years ago • 2 comments

Feature Request

Enable the passing of profile information in cmk command line

Use Case

  • Storing API and Secret Keys in a plain text file presents a large security hole.
  • Also, when using scripting from a central location where multiple profiles are in use, switching between profiles and altering config is cumbersome.
  • Plus cmk cannot be used against multiple environments (profiles) at the same time,

Subsequent Usage

Being able to override these parameters would allow config to be:

prompt     = ߐ
asyncblock = true
timeout    = 1800
output     = json
verifycert = true
profile    = localcloud

[localcloud]
url       = http://localhost:8080/client/api
username  = 
password  = 
domain    = /
apikey    = 
secretkey =

one could then use:

cmk cmk_url=http://acs_host:8080/client/api cmk_apikey=$APIKEY cmk_secretkey=$SECRETKEY cmk_output=csv list hosts

When scripting, APIKEY and SECRETKEY can be stored in a vault

PaulAngus avatar Oct 06 '21 09:10 PaulAngus

With latest v6.2.0 you can now pass the -p and -c options to specify custom config/server profile https://github.com/apache/cloudstack-cloudmonkey/wiki/Getting-Started#getting-help

rohityadavcloud avatar Oct 06 '21 09:10 rohityadavcloud

Hi Rohit.

I want avoid a text file with the endpoint and credentials in it. Using the existing nomenclature there would be

-s secret key -k api key -u api endpoint url -o output

possibly also -a asyncblock -v verifycert ....

PaulAngus avatar Oct 06 '21 11:10 PaulAngus