diff --git a/docs/packstack.rst b/docs/packstack.rst index 1fa1ec9d2..1b51db29f 100644 --- a/docs/packstack.rst +++ b/docs/packstack.rst @@ -14,9 +14,11 @@ Packstack is a utility that uses uses puppet modules to install OpenStack. It ca - packstack - packstack [options] -- packstack --gen-answer-file= / packstack --answer-file= +- packstack --gen-answer-file= [--default-password=] / packstack --answer-file= -The third option allows the user to generate a default answer file, edit the default options and finally run Packstack a second time using this answer file. This is the easiest way to run Packstack and the one that will be documented here. When is created, it will contain the OPTIONS below, which can then be edited by the user. +The third option allows the user to generate a default answer file, edit the default options and finally run Packstack a second time using this answer file. This is the easiest way to run Packstack and the one that will be documented here. Optionally, it is possible to specify a default password when generating the answer file, and this default password will be used for all accounts. + +When is created, it will contain the OPTIONS below, which can then be edited by the user. OPTIONS ======= diff --git a/packstack/installer/run_setup.py b/packstack/installer/run_setup.py index e1058aa6c..22102483e 100644 --- a/packstack/installer/run_setup.py +++ b/packstack/installer/run_setup.py @@ -857,7 +857,7 @@ def countCmdLineFlags(options, flag): counter = 0 # make sure only flag was supplied for key, value in options.__dict__.items(): - if key in (flag, 'debug', 'timeout', 'dry_run'): + if key in (flag, 'debug', 'timeout', 'dry_run', 'default_password'): next # If anything but flag was called, increment elif value: @@ -924,7 +924,12 @@ def main(): if not answerfilepath: _printAdditionalMessages() return - generateAnswerFile(answerfilepath) + # We can also override defaults with command line options + overrides = {} + _set_command_line_values(options) + for key,value in commandLineValues.items(): + overrides[key] = value + generateAnswerFile(answerfilepath,overrides) _handleParams(answerfilepath) generateAnswerFile(options.gen_answer_file) # Are we installing an all in one @@ -942,6 +947,12 @@ def main(): # Make sure only --answer-file was supplied if options.answer_file: validateSingleFlag(options, "answer_file") + # If using an answer file, setting a default password + # does not really make sense + if getattr(options,'default_password',None): + msg = ('Please do not set --default-password ' + 'when specifying an answer file.') + raise FlagValidationError(msg) confFile = os.path.expanduser(options.answer_file) if not os.path.exists(confFile): raise Exception(output_messages.ERR_NO_ANSWER_FILE % confFile)