Commit Graph

119 Commits

Author SHA1 Message Date
Rabi Mishra c02a458565 Remove deployment workbook and some unused actions
Change-Id: If6b608acf3501ccf73e7cb0a9e9b90a3d2792f27
2020-03-24 14:58:04 +05:30
John Fulton a54dc49bba Do not create temporary swift URLS for ceph-ansible
The state information in the ceph-ansible fetch directory
is no longer necessary to replace a Ceph monitor as of
ceph-ansible 4.0.14-1. Stein, Train, Ussuri and newer
should be using this version of ceph-ansible or newer.
TripleO does not need to do extra work to maintain the
fetch directory.

This means that the plan_management workbook no longer
needs to create the SwiftFetchDirGetTempurl and the
SwiftFetchDirPutTempurl parameters. This patch removes
the create_ceph_ansible_fetch_directory_backup_plan
task which creates them. It also removes the workbook
rename_ceph_ansible_fetch_directory.

Both Icce658f803a608ee4b7df34b0b8297ecabcdb0ee and
Ifab82c9a5b0a206c14ae7976d2c1c7f0e9fa3d9d are effectively
reverted of their ceph aspects with this change, but this
change should not be backported to Rocky or older because
ceph-ansible 3 still needs the fetch directory.

Change-Id: I167449e4d7e38f0f5fd74251a3bd8f5b0b31451b
Related-Bug: #1863809
2020-02-26 03:18:54 +00:00
Luke Short 07833ad572 Add config_download_args to the deployment workflow.
This will allow additional arguments to be passed directly
to the ansible-playbook command.

Change-Id: I0637f5c2b149017ae5630c3a93e46c45d7662786
Signed-off-by: Luke Short <ekultails@gmail.com>
2020-01-27 11:41:50 -05:00
Zuul 7d5e1a2e52 Merge "Remove checking for already running config_download_deploy" 2020-01-08 00:31:22 +00:00
James Slagle 101bff0021 Remove checking for already running config_download_deploy
This patch removes the checking for already running instances of the
tripleo.deployment.v1.config_download_deploy workflow from the workflow
itself as it's been moved to tripleoclient.

It is better handled in tripleoclient where the workflow inputs can be
checked to see if any of the other running workflows are also for the
current stack. That functionality would have required a custom action to
do in the workflow itself.

Change-Id: I6195068a42bfc2469a0b8b006e339e3ca5056dff
Partial-Bug: #1852314
Depends-On: Ic8dbf28b5796ff998165b6b73b941f21c65f1dfa
2020-01-06 22:24:22 +00:00
Emilien Macchi e366245ecd workbooks/deployment: ignore uuid to hostname errors with splitstack & nova-less
The lookup that converts a Nova server UUID into a node hostname from
Ironic doesn't work if the baremetal is managed in split-stack &
nova-less.

For the time being we address these 2 use cases, let's just skip Ansible
scale down tasks for these deployments.

A proper lookup will be provided in the future and backported down to
stable/train.

Change-Id: I90f7f5a8966a6942e5dcfeb753996df420665be7
Closes-Bug: #1858459
2020-01-06 12:26:07 -05:00
Emilien Macchi fd7b5f2e1e Revert "Added support of overcloud os_cloud"
This reverts commit 3c4cb58d81.

Change-Id: If7e58619cc43090f766db89c9abf477b683177cd
Depends-On: https://review.opendev.org/#/c/699329/
2019-12-19 16:18:59 +00:00
Steve Baker 8a8f6e6e84 Ignore failure calling cell_v2_discover_hosts from deployment
This will fail when there is no nova database configured, as for a
nova-less undercloud. This call to cell_v2_discover_hosts was added to
make sure any recent auto-discovered hosts are mapped to a cell, so I
think ignoring all errors is acceptable in this case.

Related-Bug: #1742179
Change-Id: I77727bbee996d123aea442a76810dcee8e957a8f
Blueprint: nova-less-deploy
2019-09-13 11:10:05 +12:00
Dougal Matthews b6e6b79d29 Remove the tripleo.deployment.v1.recover_deployment_status workflow
This was only used by tripleo-ui and is no longer needed.

Related-Bug: #1835232
Change-Id: I4e592dc88741015243fab6d6933a029bd22c1453
2019-08-22 08:25:26 +00:00
Cédric Jeanneret 04b106cb97 Allows to disable in-flight validations
This patches adds the possibility to deactivate in-flight validations by
skipping the "opendev-validation" ansible tag.

It does it in a generic way, meaning we might pass other tags to skip.

Change-Id: I6f3e4fb279146a0f292818929092d1aeb1d3fced
2019-08-06 14:50:07 +02:00
yatinkarel 71b285b345 Add deployment_options input to config_download workflow
Inventory is generated as a part of config_download_deploy
workflow but 'deployment_options' input needed to set
'ansible_python_interpreter' input for 'ansible-generate-inventory'
action is missing as a input to the workflow.
This patch adds it.

Partial-Bug: #1838540
Change-Id: I86b914f8e20704da2d566d137718b4b7fb02ad95
2019-07-31 21:25:01 +05:30
Chandan Kumar (raukadah) 3c4cb58d81 Added support of overcloud os_cloud
It includes:
* mistral action for generating clouds.yaml once
  overcloud deployment finishes.
* clouds_yaml.py library for generating clouds.yaml
* Moved global vars to tripleo-common constants.

https://review.opendev.org/#/c/664586/ adds the review in
python-tripleoclient to create the clouds.yaml for
overcloud by calling the above mistral actions.

Related-Bug: #1719369

Change-Id: Ie9004222ca5f77031795eaa4b4a757da8b409d05
Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
2019-07-11 16:08:34 +05:30
Zuul 4bc8fbeaaa Merge "Don't force verbosity of 1 for config-download" 2019-07-02 16:37:38 +00:00
John Fulton 8f2e1064a2 Increase timeout of temp swift URLs from 1 to 4 hours
It can take longer than 1 hour for a temporary swift
URL which stores the backup of the fetch directory to
be created vs used. Increase the timeout from 1 hour
to 4 hours so that the URL does not expire before it
is used.

Change-Id: Ib989bd673c694a9dc5af2a4a63ed84888f102a50
Fixes-Bug: #1832509
2019-06-12 10:24:02 -04:00
James Slagle 86bb40cf04 Don't force verbosity of 1 for config-download
Instead, honor the value of verbosity that was specified on the command
line. This will make the ansible tasks less verbose by default, so that
we don't have to add no_log everywhere which actually ends up hiding
useful output.

Change-Id: I0ef61bc49d31247a408e340d33a2ae239e1f11fe
Depends-On: Ib5060a3e9679b105c76c3c72011c23aee0093dc1
2019-05-20 17:46:46 -04:00
Emilien Macchi 030ad3e281 workbooks/deployment: add support to choose playbook name
In run_ansible task, adding support to change the playbook name, with
the default set to deploy_steps_playbook.yaml for backward
compatibility.
It will allow the tasks to be re-used by another workflow, like scale.

Change-Id: I8adeffb03836de3f1ace7d4311dbff353c10ea14
2019-05-09 11:09:26 +00:00
Emilien Macchi 68334a0041 workbooks/deployment: add support to filter nodes when running Ansible
In run_ansible task, adding support to filter nodes with limit_hosts
(--limit option in Ansible), so we can call the workbook with the desire
to run Ansible only on certain hosts (e.g. scale down).

Change-Id: I1aa086cc706110905b7a45a765d67d01ee90434e
2019-05-09 09:44:39 +02:00
Steve Baker e234c4ea70 Set the private key for undercloud tripleo-admin
This means the access workflow no longer needs to inject the public
key into the undercloud authorized_keys file, since there is already a
key configured and ready to use.

Change-Id: I4c6d0b87f4436713ba7080175308ed715907c111
Depends-On: https://review.openstack.org/#/c/649460/
2019-04-02 22:42:16 +00:00
Quique Llorente 573f67df3d Use len to compare list at mistral
Looks like mistral has issues using empty list [] comparation to check
if the list is empty or not, let's just use len.

This is needed since https://review.openstack.org/#/c/637507/ is not
merged.

Change-Id: Ifd04d741bd92b2ada5f181ed87ed5b07c0e01d48
Closes-Bug: #1816026
2019-02-18 14:18:11 +01:00
Honza Pokorny 17709257fb Don't fail when undeploying and the stack doesn't exist
Before attempting to delete the stack, we check if it exists.  And if it
doesn't, we skip straight to updating the environment.

Change-Id: I4124f73571cd794a457f52d4f76bfb75cf64e886
2019-01-14 13:19:11 -04:00
Zuul e4633bec9a Merge "Fail multiple executions of config-download of the same plan" 2019-01-07 13:55:42 +00:00
James Slagle 094ce5b250 Fail multiple executions of config-download of the same plan
Add an initial task to the config_download_deploy workflow that queries
for existing executions of the same workflow on the same plan. If any
are found, that means that config-download is already running on the
existing plan, so we should fail the additional one that is trying to
start.

Change-Id: I967ae5528834382b6ef69cc4dac10c893c907fc8
2019-01-02 10:45:57 -05:00
Zuul 14d736f9df Merge "Pass execution_id to tripleo.ansible-playbook." 2018-12-08 11:13:46 +00:00
Alex Schultz d610129d8f Add advanced deployment options
In order to be able to specify the ansible python interpreter, we need
to be able to pass in some extra options into the deployment workflow.
This change adds support for ansible_python_interpreter to the inventory
code as well as exposing a deployment_options input to the deployment
workflow.

Change-Id: Ieed77f5fe886ef38f447bfa647c8e01009f93d89
Related-Blueprint: python3-support
2018-11-13 14:21:37 -07:00
Zuul b8bfff895b Merge "Sync state if needed during retrieval" 2018-11-12 06:55:14 +00:00
James Slagle 678d564619 Pass execution_id to tripleo.ansible-playbook.
Passing the execution_id to the tripleo.ansible-playbook action will
make it such that the execution_id is included in any messages sent on
the queue.

This is needed so that when tripleoclient filters by execution id to
discard messages that are not from workflows it did not start, won't be
shown.

The tripleoclient patch to filter on execution_id is
https://review.openstack.org/#/c/605520/, but first we must land this
patch so that execution_id is added an input to these actions.

Change-Id: Icbe80c338d69efc6ce8fceb0f73f833bec588536
Related-Bug: #1794277
2018-11-09 14:50:24 -07:00
James Slagle de06f9373a Sync state if needed during retrieval
Update the deployment status if needed when retrieving the status. We do
this since tripleoclient does not yet use a single API for overcloud
deployment. Since there is no long running process to make sure the
status is updated, we instead update the status if needed when we get it
with this action.

The logic to update the status is detailed in a comment in the code.

Also as part of this commit the status is kept as deploying in
deploy_play when not triggering config_download, since the client will
trigger config_download on it's own. It makes more sense to keep the
status as deploying in that scenario.

Change-Id: I6d329e974965edf28d6f5b12e6854319cfb683f4
Closes-Bug: #1798193
2018-11-06 10:46:32 -05:00
Thomas Herve d22611b19d Fix config-download timeout
Relying on mistral task timeout to fail the ansible command is awkward,
because it doesn't kill the running command, and it doesn't give an easy
indication of the error without looking at the status info.
Instead, use the "timeout" command on the command line to invoke
ansible, and check the status code to find out if it reached it.

Change-Id: Iec15a06b85722ff6dc9209f0a5d4db333b71496f
Closes-Bug: #1801902
2018-11-06 11:17:34 +01:00
Zuul 0f66cfcce5 Merge "Set workflow status to success when manipulating deployment status" 2018-10-16 00:57:30 +00:00
Zuul 5e0e291e0b Merge "Honor blacklist with enable_ssh_admin" 2018-10-03 01:46:01 +00:00
James Slagle 71a2020a3b Set workflow status to success when manipulating deployment status
The workflows that manipulate the deployment status should set the
workflow status to SUCCESS regardless of how they set the status of the
deployment. Otherwise, the workflows themselves are seen as failed or
continually in progress by the caller.

Change-Id: I87b97bcab3e8cec6bdbb79c0acb95a375bb2d2fa
Partial-Bug: #1795640
2018-10-02 09:06:27 -04:00
Zuul 0748854d11 Merge "Add config_download_timeout input" 2018-09-29 16:27:22 +00:00
Zuul 0d658d0f60 Merge "Update swift_rings_backup workflow to also backup ceph fetch dir" 2018-09-28 03:31:22 +00:00
James Slagle 1e13e461cd Handle non-existant plan when getting deployment status
Instead of failing the workflow when requesting the deployment status of
a non-existant plan, return a useful message instead.

Change-Id: Ic0333c0726b16d284a7cc54bc68e16ea1c9ebc4d
Partial-Bug: #1792637
2018-09-24 14:03:22 -04:00
John Fulton bdde61dec0 Update swift_rings_backup workflow to also backup ceph fetch dir
Rename swift_rings_backup to swift_backup because we might wish
to use swift on the undercloud to backup more than just the
overcloud swift rings. For example the same workflow is useful
for backing up the ceph-ansible fetch directory in the undercloud
swift.

Update deployment and plan management workflows to also create
or update the ceph-ansible fetch directory swift container.

Change-Id: Icce658f803a608ee4b7df34b0b8297ecabcdb0ee
Related-Bug: #1769769
2018-09-07 11:15:10 +00:00
Zuul 1d551299e2 Merge "Add workflow for config-download export" 2018-08-30 05:35:15 +00:00
James Slagle 771975640c Add config_download_timeout input
The config_download_deploy workflow now has a config_download_timeout input
that will honor a user requested timeout. Previously, no timeout was honored
even though the user could request one via tripleoclient.

Change-Id: I522b71f92149e0cee7842d1bcbf35d9e820454b8
Partial-Bug: #1783893
2018-08-29 20:39:49 -04:00
Zuul 0f3656ea66 Merge "Add override_ansible_cfg" 2018-08-29 09:00:38 +00:00
Steve Baker 0744fe420b Add container_image_prepare_params to deployment workflow
This change has been broken out from the previous one because
Ifb1f81d4f7db3efd2799beca8705957e29ba16bd had to be reverted due to a
dependency on needing a promoted container image which contains the
action python.

Change-Id: Ie1bd6448684d5885a58c0ba30800b22ec9c105fd
Blueprint: container-prepare-workflow
2018-08-10 18:25:22 +00:00
James Slagle 893cd2af3f Honor blacklist with enable_ssh_admin
Use the stack output BlacklistedIpAddresses in the enable_ssh_admin
workflow so that the workflow does not use any of the servers in the
blacklist.

Change-Id: Ie5dbe86232c3b6a85665a9eec08ace8ba9415ea1
Depends-On: Ie96acf29a857e4801f5823f26a7de6bc989f39e2
Closes-Bug: #1785680
2018-08-06 17:23:59 -04:00
Jose Luis Franco Arza 1ad01c3335 Avoid getting one-empty-element-list in blacklisted_hostnames.
When obtaining the output from the heat.stack_output_show
action [0], if no parameter is specified in the stack, then
the action returns a list of one empty string ['']. This
is causing some error when calling tripleo.ansible-playbook
workbook, as self.blacklisted_hostnames get set, as the
argument passed is a non-empty list [1], and the result is
that the argument '!' is always passed to the --limit
option when calling ansible-playbook.

[0] - https://github.com/openstack/tripleo-common/blob/master/workbooks/deployment.yaml#L365
[1] - https://github.com/openstack/tripleo-common/blob/master/tripleo_common/actions/ansible.py#L461-L464

Change-Id: I559d5ec5548ca24490a204809c7167660c307bac
Closes-Bug: #1785597
2018-08-06 15:28:30 +02:00
James Slagle edacca490b Add override_ansible_cfg
Add a new workflow input for config_download_deploy for
override_ansible_cfg which is a string of ansible config file contents.

The contents will override any configured ansible.cfg values set by the
action, allowing users to set any arbitrary ansible.cfg they want.

Change-Id: I0221311f3b17e9a60440681c42542c46af5e8903
2018-07-30 21:11:35 +00:00
James Slagle e1556486c5 Add workflow for config-download export
Add a new workflow, config_download_export, to export the
config_download files by providing a swift tempurl of the generated
tarball.

The CLI will be migrated to using this workflow.

Partial-Bug: #1783646
Change-Id: Ic3d3667a7e2d0b445a4ace4d9aa8643062eb9cf3
2018-07-26 09:01:22 -04:00
Zuul 2dfed4e87a Merge "Action to perform container image prepare" 2018-07-25 03:29:19 +00:00
Steve Baker 49c169a144 Action to perform container image prepare
This action runs in the deployment workflow just after validation. It
does the following:

- Fetches the plan, environment files and role data
- Builds a merged environment from the fetched plans
- If a ContainerImagePrepare parameter is defined, do a dry-run
  prepare to determine the image parameters for when the actual prepare
  is run during the deployment.
- Write the resulting image parameters to
  environments/containers-default-parameters.yaml and insert that file
  into the environments file list in the plan

If no ContainerImagePrepare parameter, this action has no effect, so
it can be inserted into the deployment workflow now without affecting
any existing image prepare.

This dry-run prepare is the same approach used for containerized
undercloud deployment. Doing a dry-run is fast compared to a full
deploy because there are no image transfers or build performed, only
inspect calls to image registries. The actual prepare will be done
during the deployment when change
I8b0c5e630e63ef6a2e6f70f1eb00fd02f4cfd1c0 lands.

Change-Id: Ifb1f81d4f7db3efd2799beca8705957e29ba16bd
Blueprint: container-prepare-workflow
2018-07-23 15:27:58 +12:00
Jiri Tomasek eec131ee5e Update failures listing to use latest ansible-errors.json location
Since the config-download files are stored per plan name, we don't need
to reach for deployment status object and execution any more.

This change also updates get_deployment_failures workflow to set status
FAILED when an error message is returned from the action.

Closes-Bug: 1779093
Change-Id: I49805f1e2ce845b1cebc04df813261cca12ec431
2018-07-19 08:24:24 -04:00
James Slagle 81b022ce03 Use /var/lib/mistral/<plan-name> as config-download dir
Use a consistent directory under /var/lib/mistral (which defaults to the
plan name) as the working and config-download directory in the
config_download_deploy workflow. Since the config-download directory
is now managed by git, we can re-use the same dir and preserve the
history.

Change-Id: Id639d0a99aa1103f6f9cc54de676ea8ba6111332
Closes-Bug: #1779093
2018-07-19 08:24:24 -04:00
James Slagle ec40eb3edf git integration for GetOvercloudConfig action
Override the default git commit message so that it's clear that the
config-download commit was run from the Mistral action.

Also, first download the existing config container if one exists. Since
the config-download dir is now managed as a git repo, we want to
preserve the git history, so we need to first reuse the existing
contents of the config container.

Change-Id: I0246918d89dfb564e3d472d4b2f517b5beaf4372
2018-07-19 08:24:24 -04:00
Zuul 3d7779afd7 Merge "Workflows for manipulating deployment status" 2018-07-05 10:54:42 +00:00
Zuul 96e78eb0d6 Merge "Add new undeploy_plan workflow" 2018-06-30 09:22:01 +00:00