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
This commit is contained in:
Steven Hardy 2018-01-11 17:04:19 +00:00
parent 372fc596df
commit a24dc7889a
2 changed files with 9 additions and 1 deletions

View File

@ -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/")

View File

@ -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='<HEAT_API_PORT>',
dest='heat_api_port',