23 Commits

Author SHA1 Message Date
Ghanshyam Mann
120ef346df Retire Tripleo: remove repo content
TripleO project is retiring
- https://review.opendev.org/c/openstack/governance/+/905145

this commit remove the content of this project repo

Change-Id: I73e76d203878ef213816bf886b8172a0cff3bf28
2024-02-24 11:42:34 -08:00
John Fulton
29fe3996bb 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
2022-07-19 17:47:19 -04:00
John Fulton
fda3233451 Fall back to alt path for ceph client data during export
The patch to fix the related bug (not this patch) fixes an
inconsistency where the ceph client data is somtimes exported
to the wrong path. If anyone deployed before they got the fix
to the related bug, then this patch will workaround that
problem if they export later.

When 'openstack overcloud export ceph' is run look in the
correct default location for the ceph client data and if it
is not found, then fall back to incorrect location.

Change-Id: I0b8c747481e561645eefea50cb77ca806a7f0de2
Related-Bug: #1978846
2022-06-17 16:11:59 -04:00
Zuul
c00a0e4af9 Merge "cephadm support for 'openstack overcloud export ceph'" 2022-05-04 04:49:18 +00:00
James Slagle
d7af2f5482 Remove Heat API dependency for overcloud export
Update the overcloud export command to work without a dependency on Heat
API. The export data is updated to create the export data based solely
on saved stack output data and the config-download generated
overcloud.json so that Heat is not needed to generate the export at all.

Change-Id: I0bd4b4a0e33184e0f4d731899138bf4063f3cdac
Signed-off-by: James Slagle <jslagle@redhat.com>
2022-04-18 16:28:21 -04:00
John Fulton
1952f5a6ee cephadm support for 'openstack overcloud export ceph'
Without this patch 'openstack overcloud export ceph' can
only export information from a ceph-ansible deployment as
found in the config-download directory.

This patch results in the export ceph command looking in
the config-download directory for a ceph-ansible or
cephadm directory and based on what it finds it generates
the a Heat environment with the CephExternalMultiConfig
parameter populated.

Closes-Bug: #1966772
Depends-On: I9f854377fcd0dfa570d0dc30e34d40826de8656d
Change-Id: Idbb2d9270c83ac0e97e0bdb1ea6e2992671f94aa
2022-03-31 16:58:59 -04:00
James Slagle
2bfb6f2bc8 Add AuthCloudName to export data
Add the AuthCloudName parameter to the export data. If the parameter is
already set in the stack being exported, use that value, otherwise use
the name of the stack being exported.

Change-Id: Ie9b78d11c816d234853d454ab76da8750def9bba
Signed-off-by: James Slagle <jslagle@redhat.com>
2022-02-24 06:57:45 -05:00
Jiri Podivin
fdd9889488 Eliminating a race condition in the export_stack function
The correct export of the stack parameters no longer depends
on order of the tripleclient.constants.EXPORT_DATA,
as the lack of expected json file with parameters to export
raises exception, rather than filling the requested key with
data obtained in the previous iteration.

The I/O logic was moved to the tripleoclient.utils to keep
things more consistent.

No longer necessary json import was removed.

Tests were adjusted to mock more selectively.

Closes-Bug: #1940685

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ia7fb232261eb00c53d4e9bb352e572568704000f
2021-08-25 17:14:29 +02:00
Jiri Podivin
2939ed85bd New test case and documentation for the export_stack function.
New test case for handling a decoding error encountered
while reading a file.

Function documentation moved to docstring from comment,
and expanded to cover necessary API and implementation facts.

Too general 'Exception', raised if there are no data to export
for the specific key, was changed to 'RuntimeError'.

Some vars were renamed in order to improve readability.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I04f8eb15e58a2bec125f5de23ec2da7e51454e1c
2021-08-25 17:12:32 +02:00
John Fulton
3f6f67c106 Remove cyclic import between export and utils
Because export imports utils and utils imports export
there is a cyclic import so pylint objects PEP8 R0401.

overcloud_deploy and overcloud_export need the function
export_overcloud which depends on export. The function
export_overcloud was added to utils for that import but
this created the cyclic import. To work around this,
redefine the export_overcloud function in export and
have overcloud_deploy and overcloud_export import it
from export, not utils. Then remove the utils import
of export.

Change-Id: I8bab41ee9af9729cd63ed7132928cfbc1770887a
2021-07-14 12:12:50 +00:00
Zuul
e6c76a9777 Merge "Restoration of the 'export_passwords' exclusion" 2021-07-01 19:23:43 +00:00
Jiri Podivin
2400624bd4 Moving the 'export_data' dict into constants
The 'export_data' variable in the 'tripleoclient.export.export_stack'
is accessed in read-only manner and is used to determine
parameters selected for export.

It is, effectivelly, a constant, but placed within a function
body, without declaration of it's exact contents in the docstrings.

By moving the 'export_data' among constants, we expose the information
about exported parameters, with minimal change to the original code,
as the 'tripleoclient.constants' is already imported by the module.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I408560ffbecd145b476aa5205c4fd1c780491d0c
2021-06-24 10:41:54 +02:00
Jiri Podivin
cc2ac4a855 Restoration of the 'export_passwords' exclusion
The 'tripleoclient.export.export_passwords' function was intended
export passwords selectively, if needed, based on provided rules.

This patch restores that functionality.
Furthermore, tests were adjusted to validate exports with and
without filtering.

Function level documentation was expanded with information about
inputs and outputs.

Per suggestion, the loop was adjusted to iterate over generated passwords
rather than over `tripleo_common_constants.PASSWORD_PARAMETER_NAMES`.
The existing import of tripleo_common.constants was removed, as there
were no more references to it.

Closes-Bug: #1933237

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I397caaf314dae17a48d4aeed55f1a5a8e4ae3d41
2021-06-23 09:01:07 +02:00
Jiri Podivin
a1aadd37d7 Too broad exceptions replaced with altenatives.
Blocks catching base Exception were replaced
with more constrained alternatives where possible.

Alternatives were chosen based on exceptions possibly
raised by calls within the `try` clause.

Logs were altered to reflect new situation.
string method format was used for new log calls.

Unit tests were adjusted accordingly.

This patch may cause uptick in unhadled exceptions,
as previously "hidden" issues become apparent.

Increase in the number of exceptions capture,
including potential hunk revert should be done with care however.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I24612700bcbd3e17685ae7a33a27f38a2055a0fb
2021-05-14 16:37:29 +02:00
James Slagle
7483b62332 Automatically run overcloud export when using ephemeral heat
The overcloud export environment will be automatically created when
using ephemeral heat. Since the stack is ephemeral, we need to go ahead
and do the export before stopping Heat. While we backup the heat db so
we have the stack saved if needed, it's just eaiser and eliminates a
manual step to do the export if we do it automatically.

Signed-off-by: James Slagle <jslagle@redhat.com>
Change-Id: Idc326cb7baa54a7d2d01a2be002dfffa6a59ef6a
2021-04-28 07:30:49 -04:00
John Fulton
1e69013691 Use ceph_mon_network to find Ceph monitor IPs for export
When 'openstack overcloud export ceph' is run, do not assume
the storage_ip will be set. Instead, find the ceph_mon_network
name in the service_net_map, e.g. 'storage' or 'ctlplane', and
then use that network name to get the IP from the inventory.

Closes-Bug: #1922788
Change-Id: I962bed846b2cae7206c76f883f9294d366031245
2021-04-08 11:41:51 +00:00
ramishra
d2b8115266 Don't use swift plan when exporting passwords
This changes to use the stack environment instead for
passwords when using ``overcloud export`` or
``overcloud cell export``.

Change-Id: Iae58a6415cc12e2035e0d3b62327e59e038d1b2c
2021-02-01 10:54:46 +05:30
Kevin Carter
7c40575d7b
Update client to create archive and use tripleo-common
The client utils will now run a new playbook to ensure that the local
archive directory is created early in the deployment process. This
change will allow us to build toward a swift-less deployment. All of
the client calls, save one, has been moved to use tripleo-common which
will assist us to better manage, and migrate from swift storage to a
local archive.

> As a product of this change all of the "webhook" calls have been
  removed. which was deprecated as part of the Zaqar and Mistral work.
  These calls were removed because several swift calls were tied into
  them, and because mistral is no longer part of the stack, and has
  been gone for a few cycles, we can safely remove these calls which
  do nothing.

Depends-On: Ibe9b2ffe94cdf493fc84366979d1d78b8528ea1b
Change-Id: I7531612a49527f8a21df415c648acb41ac7a0b10
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2021-01-20 09:43:52 -06:00
John Fulton
ac0dfb5e1e Add openstack overcloud export ceph
Add a new command to export Ceph information from one or
more Heat stacks to be used as input of another stack.
Creates a valid YAML file with the CephExternalMultiConfig
parameter populated.

Also have export's export_password use yaml.safe_load in
place of the deprecated yaml.load.

Closes-Bug: #1895034
Change-Id: Ibdf9115e92c6b476b99d6df785b0c7e9f23991de
2020-09-23 00:25:20 +00:00
James Slagle
ced221406b Use user set password values in overcloud export
The overcloud export command needs to look at both the
parameter_defaults and passwords keys from plan-environment.yaml.
passwords contains only the generated password values, while
parameter_defaults contains any user set values. If a value is not set
in parameter_defaults, then passwords can be used.

Change-Id: I6b1b8bd1e7800720f6bbbe418c1f83b2f710fb48
Closes-Bug: #1891388
Signed-off-by: James Slagle <jslagle@redhat.com>
2020-08-12 16:07:03 -04:00
Rabi Mishra
191438f743 Don't use mistral directory as WORK_DIR for config-download
As part of mistral removal all config-downloaded playbooks
are run from tripleoclient. This changes the download location
to $HOME/config-download.

Documentation for default location will be changed along with
all doc changes for mistral removal.

Closes-Bug: #1874432
Depends-On: https://review.opendev.org/721568/
Change-Id: Ib4c9c47baabd64f008c4f61e4fa8c37a311350a3
2020-04-24 12:26:41 +05:30
Kevin Carter
7cfe4d4f12
Correct YAML load warning
The use of `yaml.load` is deprecated and considered unsafe.

The warning notice:

> /usr/lib/python3.6/site-packages/tripleoclient/utils.py:2349:
  YAMLLoadWarning: calling yaml.load() without Loader=...
  is deprecated, as the default Loader is unsafe. Please read
  https://msg.pyyaml.org/load for full details.

This change removes the use of the deprecated function, which
corrects the issue.

Change-Id: I7b747fd124880f55a30f75e5efb27c22c57ac10c
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-03-16 15:05:44 -05:00
James Slagle
975f771702 Add openstack overcloud export
Add a new command to export the data from a control plane stack for
multi-stack. The created export file can be used as input into a compute
stack for the multi-stack feature.

Also refactors the overcloud cell export command to use the same common
code.

Closes-Bug: #1850636
Change-Id: I6e145d7a54dcd306c4633ebd4d7471a19a967a86
2019-11-11 16:33:49 -05:00