diff --git a/tripleoclient/v2/overcloud_ceph.py b/tripleoclient/v2/overcloud_ceph.py index c6b8f6d04..62a1672f3 100644 --- a/tripleoclient/v2/overcloud_ceph.py +++ b/tripleoclient/v2/overcloud_ceph.py @@ -291,6 +291,11 @@ class OvercloudCephDeploy(command.Command): "Path to an existing crush hierarchy spec " "file. "), default=None) + parser.add_argument('--tld', + help=_( + "postfix added to the hostname to represent " + "canonical hostname "), + default=None) parser.add_argument('--standalone', default=False, action='store_true', help=_("Use single host Ansible inventory. " @@ -485,6 +490,21 @@ class OvercloudCephDeploy(command.Command): else: extra_vars['crush_hierarchy_path'] = \ os.path.abspath(parsed_args.crush_hierarchy) + + if parsed_args.tld: + extra_vars['tld_option'] = str(parsed_args.tld) + #call playbook to update hostname with tld + with oooutils.TempDirs() as tmp: + oooutils.run_ansible_playbook( + playbook='ceph-set-hostname.yaml', + inventory=inventory, + workdir=tmp, + playbook_dir=constants.ANSIBLE_TRIPLEO_PLAYBOOKS, + verbosity=oooutils.playbook_verbosity(self=self), + extra_vars=extra_vars, + reproduce_command=False, + ) + if parsed_args.ceph_vip: if not os.path.exists(parsed_args.ceph_vip): raise oscexc.CommandError( @@ -684,6 +704,7 @@ class OvercloudCephDeploy(command.Command): "is not setting push_destination. Or " "--skip-container-registry-config was used.") + # call playbook to deploy ceph with oooutils.TempDirs() as tmp: oooutils.run_ansible_playbook( @@ -1027,6 +1048,11 @@ class OvercloudCephSpec(command.Command): "Path to an existing crush hierarchy spec " "file. "), default=None) + parser.add_argument('--tld', + help=_( + "postfix added to the hostname to represent " + "canonical hostname "), + default=None) return parser def take_action(self, parsed_args): @@ -1127,6 +1153,20 @@ class OvercloudCephSpec(command.Command): extra_vars['crush_hierarchy_path'] = \ os.path.abspath(parsed_args.crush_hierarchy) + if parsed_args.tld: + extra_vars['tld_option'] = str(parsed_args.tld) + #call playbook to update hostname with tld + with oooutils.TempDirs() as tmp: + oooutils.run_ansible_playbook( + playbook='ceph-set-hostname.yaml', + inventory=inventory, + workdir=tmp, + playbook_dir=constants.ANSIBLE_TRIPLEO_PLAYBOOKS, + verbosity=oooutils.playbook_verbosity(self=self), + extra_vars=extra_vars, + reproduce_command=False, + ) + if parsed_args.standalone: spec_playbook = 'cli-standalone-ceph-spec.yaml' tags = '' @@ -1134,6 +1174,7 @@ class OvercloudCephSpec(command.Command): spec_playbook = 'cli-deployed-ceph.yaml' tags = 'ceph_spec' + with oooutils.TempDirs() as tmp: oooutils.run_ansible_playbook( playbook=spec_playbook,