Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

auth_methods

Christian Stankowic edited this page Mar 17, 2015 · 4 revisions

This toolkit's scripts require access to your management, monitoring and virtualization managemnt systems.

By default those information are prompted interactively - e.g.:

$ ./satprep_snapshot.py
Satellite Username:
Satellite Password:

In case you want to automate one of those scripts (e.g. for cronjobs) you might choose between one of the following options:

#Alternative 1: shell variables The toolkit can use multiple shell variables to automate authorization:

Variable Description
SATELLITE_LOGIN Satellite user name
SATELLITE_PASSWORD the appropriate password
MONITORING_LOGIN Monitoring suite user name
MONITORING_PASSWORD the appropriate password
VIRTUALIZATION_LOGIN Virtualization host/management user name
VIRTUALIZATION_PASSWORD the appropriate password

You might also want to set the HISTFILE variable (depending on your shell) to hide the command including the password in the history:

$ HISTFILE="" SATELLITE_LOGIN=mylogin SATELLITE_PASSWORD=mypass ./satprep_snapshot.py

#Alternative 2: auth file A better possibility is to create a authfile with permisions 0600. Just enter the username in the first line and the password in the second line:

$ cat authfile
admin
password
$ chmod 0600 authfile

Hand the path to the script:

$ ./satprep_snapshot.py -a myauthfile

Other scripts than satprep_snapshot.py might have other parameters for auth files - check-out the help. The scripts will abort if the authfile has insecure permissions (e.g. 0777).

Clone this wiki locally