Ensure tripleo_ceph_client_vars is set consistently

python-tripleoclient knows the correct working directory
after baremetal deployment. Thus, it can correctly override
the tripleo_ceph_client_vars variable in tripleo-ansible roles.
Use /home/USER/overcloud-deploy/STACK/ceph_client.yml, where
everything up to ceph_client.yml comes from the utils.py
function get_default_working_dir(STACK).

When tripleo-ansible roles are called directly by the client
use --extra-vars to pass tripleo_ceph_client_vars. As per the
deployed_ceph.yaml.j2 template in tripleo-ansible, the Heat
parameter CephClientConfigVars will then be set to the same
value. Then when the tripleo-ansible roles are called by
config-download they will have the same value for
tripleo_ceph_client_vars. Update export.py to use same path.

Change-Id: I7717f2ce9f668e9fd77c9b49e2433d729ed3c836
Depends-On: I0346bf1c6a3d8796a0aa70cbaac6e34b2f74fabb
Closes-Bug: #1981467
This commit is contained in:
John Fulton 2022-07-19 07:21:27 -04:00
parent 40abe6c7ac
commit 29fe3996bb
3 changed files with 7 additions and 3 deletions

View File

@ -210,8 +210,8 @@ def export_ceph(stack, cephx,
fsid = ceph_data['fsid']
if 'cephadm' in config_download_files:
ceph_client = "cephadm/ceph_client.yml"
file = os.path.join(config_download_dir, stack, ceph_client)
file = os.path.join(oooutils.get_default_working_dir(stack),
'ceph_client.yml')
if not os.path.exists(file):
# fall back to old path if user had LP 1978846 during deployment
file = "/home/stack/ceph_client.yaml"

View File

@ -67,6 +67,7 @@ class TestOvercloudCephDeploy(fakes.FakePlaybookExecution):
"deployed_ceph_tht_path": mock.ANY,
"working_dir": mock.ANY,
"stack_name": 'overcloud',
"tripleo_ceph_client_vars": mock.ANY,
"tripleo_cephadm_standalone": False,
'tripleo_cephadm_ssh_user': 'jimmy',
'tripleo_cephadm_cluster': 'ceph',
@ -112,6 +113,7 @@ class TestOvercloudCephDeploy(fakes.FakePlaybookExecution):
"deployed_ceph_tht_path": mock.ANY,
"working_dir": mock.ANY,
"stack_name": 'overcloud',
"tripleo_ceph_client_vars": mock.ANY,
"tripleo_cephadm_standalone": False,
'tripleo_roles_path': mock.ANY,
'tripleo_cephadm_first_mon_ip': '127.0.0.1',

View File

@ -391,7 +391,9 @@ class OvercloudCephDeploy(command.Command):
"deployed_ceph_tht_path": output_path,
"working_dir": working_dir,
"stack_name": parsed_args.stack,
"tripleo_cephadm_standalone": parsed_args.standalone
"tripleo_cephadm_standalone": parsed_args.standalone,
"tripleo_ceph_client_vars": os.path.join(working_dir,
'ceph_client.yml')
}
extra_vars_file = None
# optional paths to pass to playbook