From a24dc7889af67fbb7ca57ab5eff2c22d8940a186 Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Thu, 11 Jan 2018 17:04:19 +0000 Subject: [PATCH] Add -r/--roles-file option to undercloud deploy This aligns with the overcloud deploy, and enables faster testing with a customized roles_data.yaml (e.g one with a small number of services). Change-Id: I0e44b1aa1be3436990053a665478c92e91856dee --- tripleoclient/constants.py | 1 + tripleoclient/v1/undercloud_deploy.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tripleoclient/constants.py b/tripleoclient/constants.py index ef046642c..9771bb8b1 100644 --- a/tripleoclient/constants.py +++ b/tripleoclient/constants.py @@ -16,6 +16,7 @@ TRIPLEO_HEAT_TEMPLATES = "/usr/share/openstack-tripleo-heat-templates/" OVERCLOUD_YAML_NAME = "overcloud.yaml" OVERCLOUD_ROLES_FILE = "roles_data.yaml" +UNDERCLOUD_ROLES_FILE = "roles_data_undercloud.yaml" OVERCLOUD_NETWORKS_FILE = "network_data.yaml" RHEL_REGISTRATION_EXTRACONFIG_NAME = ( "extraconfig/pre_deploy/rhel-registration/") diff --git a/tripleoclient/v1/undercloud_deploy.py b/tripleoclient/v1/undercloud_deploy.py index a6f739b02..6baac889c 100644 --- a/tripleoclient/v1/undercloud_deploy.py +++ b/tripleoclient/v1/undercloud_deploy.py @@ -224,8 +224,9 @@ class DeployUndercloud(command.Command): def _setup_heat_environments(self, parsed_args): tht_root = parsed_args.templates # generate jinja templates + self.log.debug("Using roles file %s" % parsed_args.roles_file) args = ['python', 'tools/process-templates.py', '--roles-data', - 'roles_data_undercloud.yaml'] + parsed_args.roles_file] subprocess.check_call(args, cwd=tht_root) print("Deploying templates in the directory {0}".format( @@ -415,6 +416,12 @@ class DeployUndercloud(command.Command): 'or heat stack-update command. (Can be specified more than ' 'once.)') ) + parser.add_argument( + '--roles-file', '-r', dest='roles_file', + help=_('Roles file, overrides the default %s in the --templates ' + 'directory') % constants.UNDERCLOUD_ROLES_FILE, + default=constants.UNDERCLOUD_ROLES_FILE + ) parser.add_argument( '--heat-api-port', metavar='', dest='heat_api_port',