diff --git a/tripleoclient/v1/tripleo_deploy.py b/tripleoclient/v1/tripleo_deploy.py index c9b118929..2a5ee9783 100644 --- a/tripleoclient/v1/tripleo_deploy.py +++ b/tripleoclient/v1/tripleo_deploy.py @@ -1314,7 +1314,8 @@ class Deploy(command.Command): extra_args=extra_args) if rc != 0: raise exceptions.DeploymentError('Upgrade failed') - rc = self._launch_ansible(self.ansible_dir) + rc = self._launch_ansible(self.ansible_dir, + extra_args=extra_args) if rc != 0: raise exceptions.DeploymentError('Deployment failed') if parsed_args.upgrade: diff --git a/tripleoclient/v1/undercloud.py b/tripleoclient/v1/undercloud.py index cbf5b1584..41674049e 100644 --- a/tripleoclient/v1/undercloud.py +++ b/tripleoclient/v1/undercloud.py @@ -100,6 +100,16 @@ class InstallUndercloud(command.Command): default=False, help=_("Do not perform undercloud configuration validations"), ) + parser.add_argument( + '--inflight-validations', + dest='inflight', + action='store_true', + default=False, + help=_('Activate in-flight validations during the deploy. ' + 'In-flight validations provide a robust way to ensure ' + 'deployed services are running right after their ' + 'activation. Defaults to False.') + ) parser.add_argument( '--dry-run', dest='dry_run', @@ -121,11 +131,14 @@ class InstallUndercloud(command.Command): utils.ensure_run_as_normal_user() no_validations = parsed_args.dry_run or parsed_args.no_validations + inflight = not parsed_args.dry_run and parsed_args.inflight + cmd = undercloud_config.prepare_undercloud_deploy( no_validations=no_validations, verbose_level=self.app_args.verbose_level, force_stack_update=parsed_args.force_stack_update, - dry_run=parsed_args.dry_run) + dry_run=parsed_args.dry_run, + inflight=inflight) self.log.warning("Running: %s" % ' '.join(cmd)) if not parsed_args.dry_run: diff --git a/tripleoclient/v1/undercloud_config.py b/tripleoclient/v1/undercloud_config.py index 0ca42c9e8..2c7c3192e 100644 --- a/tripleoclient/v1/undercloud_config.py +++ b/tripleoclient/v1/undercloud_config.py @@ -374,9 +374,10 @@ def _process_network_args(env): raise exceptions.InvalidConfiguration(msg) -def prepare_undercloud_deploy(upgrade=False, no_validations=False, +def prepare_undercloud_deploy(upgrade=False, no_validations=True, verbose_level=1, yes=False, - force_stack_update=False, dry_run=False): + force_stack_update=False, dry_run=False, + inflight=False): """Prepare Undercloud deploy command based on undercloud.conf""" env_data = {} @@ -753,8 +754,10 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=False, utils.ansible_symlink() undercloud_preflight.check(verbose_level, upgrade) deploy_args += ['-e', os.path.join( - tht_templates, "environments/tripleo-validations.yaml"), - '--inflight-validations'] + tht_templates, "environments/tripleo-validations.yaml")] + + if inflight: + deploy_args.append('--inflight-validations') if CONF.get('custom_env_files'): for custom_file in CONF['custom_env_files']: