Commit Graph

104 Commits (2f9215b2535a976e1d1568650aa78be3fe8b5606)

Author SHA1 Message Date
Bogdan Dobrelya d9174e83fd Invoke ansible from writeable workdirs
In order to make it configurable via env/settings,
use writebale tmp paths for ansible runner. This also aligns the
way we call it for other places.

Change-Id: I64999f19b4ce2083f05e09c40d6b89c8d8ba2cdd
Related-bug: #1868063
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
2020-04-06 09:38:03 +02:00
Kevin Carter 624a61f206 Update verbosity so it is consistently set
This change will set the verbosity consistently whenever a playbook is
executed via the client.

All tests have been updated to ensure that the verbosity setting is always
defined when a playbook is executed.

Change-Id: I35b10d48344c8b7f71186bc529a300f75d7b8d63
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-04-04 03:46:36 +00:00
Kevin Carter 7decad8399 Remove update parameters workflows
This workflow is no longer required becuase it has been converted to an
ansible playbook.

Story: 2007212
Task: 39045

Depends-On: I3d1c736f6d1ee704ece0101134f95582a5d060eb
Change-Id: I829217c99456f8ac8f49542eb1842c451fe77ad1
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-04-03 10:59:41 -05:00
Zuul 1b38e856e0 Merge "Add new interface to run arbitrary playbooks from a plan" 2020-03-31 04:00:37 +00:00
Rabi Mishra 71ca2d1073 Remove usage of GenerateFencingParametersAction action class
Replace with tripleo-common utils api.

Change-Id: I5fdecc3a9a2bd46f7d8056144c8b1d68f170878d
2020-03-30 15:17:22 +05:30
Rabi Mishra 98258c1a49 Remove usage of GetFlattenedParametersAction action class
Replaces with tripleo-common utils api.

Change-Id: I216b856ec0874045183b86d8a49b5473e35427c6
2020-03-30 15:17:22 +05:30
Rabi Mishra 197f5cf9cb Remove CreateContinerAction usage
This replaces the CreateContinerAction calls with tripleo-common
api call.

Change-Id: I58ad4b4b00b0889a16b2a211d8dbbd1a967f88ae
2020-03-25 10:54:43 +05:30
Kevin Carter 0464bdc17f Add new interface to run arbitrary playbooks from a plan
This change is the first step to providing a path to remove the mistral
"derived_params" workflows. Deployers will now be able to execute playbooks
from within a given plan by passing in the `playbook_parameters` key which
contains a dictionary of playbook file paths, and all options applied to a
given playbook.

Story: 2007419
Task: 39118

Change-Id: I26ea1c01e17513d001e311d68fd239d3ba8c8a0d
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-03-23 14:55:06 +00:00
Rabi Mishra becee11a5a Use ansible playbook for plan deploy
Depends-On: https://review.opendev.org/713641
Depends-On: https://review.opendev.org/714280
Change-Id: I9b9488672293558747c6dc41eb6d41c18bdc9e05
2020-03-22 10:07:39 +05:30
Rabi Mishra 4a55e5b9c2 Use ansible playbooks for plan creation/update
This removes mistral usage from plan create and
update cli commands by calling the new playbooks.

Depends-On: https://review.opendev.org/712605
Depends-On: https://review.opendev.org/712899
Change-Id: Icdc6c22a4e9fde316ef1700a4ee484a06c9dfd7d
2020-03-22 08:51:11 +05:30
Kevin Carter 026e98012a Remove mistral when running the provide workflows
This change removes all of mistral from the provide workflows
by calling the new provide playbook.

Story: 2007212
Task: 38443
Task: 38446

Depends-On: Ic1cf39a29826b3828967e23a056884d867431062
Change-Id: If0184d3db5e49f6c3d302674ce7587ba27050a91
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-03-16 03:11:03 +00:00
Kevin Carter 7e677b0c35 Remove the mistral from the clean_.*_nodes workflow
This change removes all of mistral from the clean_nodes and clean_manageable_nodes
workflows by calling the new cleaning playbook.

Story: 2007212
Task: 38451
Task: 38452

Depends-On: I0e3f50ff2bdc16b6a148977b39a12023d5b30b3e
Change-Id: I0b1981a82b1ae5d2b52a74250b623218a0cb6c0d
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-03-13 11:07:53 +00:00
Dougal Matthews bb639bc65c Remove mistral from the introspection workflows
This change removes all of mistral from the introspection workflows
by calling the new introspection playbook.

Story: 2007212
Task: 38444
Task: 38445

Depends-On: I7ba8a31b71ed5bc9bdd944769ea472b537c83a98
Change-Id: I48bedfe9a705f5ff8e0eed1f852b77938d53c763
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-03-13 11:07:53 +00:00
Kevin Carter af719b795b Remove mistral from the configure workflows
This change removes all of mistral from the configure functions
by calling the required functions directly.

Story: 2007212
Task: 38447
Task: 38448

Change-Id: I65eac9f813330d066f8ca6cbaae6c972d43d0246
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-03-13 11:07:53 +00:00
Kevin Carter ad9c7a7504
Remove mistral when running the register_or_update workflow
This change removes all of mistral from the register_or_update workflow
by calling the required functions directly.

Story: 2007212
Task: 38442

Closes-Bug: #1866637
Change-Id: Ie85adc64cd4fcec469d6979a424d8f01b00f34f2
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-03-09 19:48:56 -05:00
Kevin Carter 8416553903 Remove the mistral from the check_deprecated_parameters workflow
This change removes all of mistral from the check_deprecated_parameters
function by calling the required functions directly.

Story: 2007212
Task: 38424

Change-Id: Ib76dac4e0d11c66fe90c30db19788af1cb4694f6
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-02-28 11:38:51 +01:00
Zuul d6e526a9de Merge "Don't use the delete_deployment_plan workflow, call the action directly" 2020-02-26 08:18:21 +00:00
Zuul 58c0c2fb76 Merge "Remove mistral from the generate_fencing_parameters deploy workflow" 2020-02-26 01:02:41 +00:00
Zuul 5416e6bb86 Merge "Convert the support deployment and workflow to ansible" 2020-02-25 21:12:18 +00:00
Zuul d4f14f21d3 Merge "Remove the unused backup method" 2020-02-25 19:10:16 +00:00
Kevin Carter dbe5169d97 Remove mistral from the generate_fencing_parameters deploy workflow
This change removes all of mistral from the generate_fencing_parameters function
by calling the required functions directly.

Story: 2007212
Task: 38425

Change-Id: Iadcfb34e296144d82fde1d32acfffa1e01c5c997
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-02-24 13:11:06 -06:00
Kevin Carter 2c028c4a52 Convert the support deployment and workflow to ansible
This change converts the support deployment and workflow process to use an ansible
playbook instead of a mistral workflow. The overcloud_support module has been
updated and moved to the V2 client and all tests in support of this new process
have been updated.

Story: 2007212
Task: 38431
Task: 38432
Depends-On: I606f1ee3bc323e5c83d09ca9bc8f7e4033e81e70
Change-Id: If47e1e64e251e72d5bc8d0eb253d931257fd2ca8
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-02-23 01:21:55 +00:00
Dougal Matthews 2f1afe62e7 Remove the unused backup method
This Mistral workflow is no longer used

Change-Id: Id0ba76f5ae2da51d06d86d3fd3ea47df0462763a
2020-02-19 12:50:39 +00:00
Kevin Carter aefda7f205 Remove mistral from the create_container deploy workflow
This change removes all of mistral from the create_container function
by calling the required functions directly.

Story: 2007212
Task: 38780

Change-Id: Icdcd4589f413fb510ee56d6a27c110e3cc065ddf
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-02-18 00:36:08 +00:00
Kevin Carter dc9ae1ac5b Remove mistral from the config_download deploy workflow
This change removes all of mistral from the config_download_deploy function
by calling the required functions directly.

- All of the inputs within this function have been cleaned up and documented.
- New log entires will be created when using this method giving the deployer
  a better overall user experience.
- To ensure we're able to support the ability to reproduce commands, the ssh
  args extravar has been moved to an environment variable.
- The methods get_config and get_key have been moved to the utils module.
  This was done to help avoid circular imports.

Update methods have been changed to execute without running within a mistral
workflow. This was changed because there's no need to support the multiple
code paths anymore given config_download is now running directly.

Test classes have been updated to reduce duplication.

With the new streamlined execution process we should see improved deployment
times and better visability into the deployment process.

Task: 38422
Story: 2007212

Depends-On: I006291a2465aa4c950abce76f9e5f9459b76e330
Change-Id: Ide1a4503dd2bdd2d5e494cd1eac483b842a21acf
Co-authored-by: Luke Short <ekultails@gmail.com>
Co-authored-by: Dougal Matthews <dougal@dougalmatthews.com>
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-02-14 23:40:16 +00:00
Dougal Matthews 5bcf139b30 Don't use the delete_deployment_plan workflow, call the action directly
This workflow only uses one action, we can remove Mistral by calling it
directly.

Story: 2007212
Task: 38419
Change-Id: I33d5961518337a8d711e1de751cd4e1fc1a68f09
2020-02-14 13:42:57 +00:00
Kevin Carter 4866ab8fde Convert deployment to use new ssh-admin playbook
This change converts the deployment process to use the new enable ssh admin
playbook instead of the shell commands and a mistral workflow.

Tests have been updated to reflect the use of the new methods.

Story: 2007212
Task: 38427
Depends-On: https://review.opendev.org/#/c/706196/
Depends-On: I5ab7f4d9dc39a74714c9bcfa39fa50cc586e8e08
Change-Id: I5c744e116f00e81f92c014fc1f599ad3db11ada2
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2020-02-06 18:16:57 +00:00
Zuul b6bcdefbdc Merge "Handle config-download in progress in tripleoclient" 2019-12-21 02:42:59 +00:00
Kevin Carter bcc9c66747
Replace ansible shell with python runner
This change replaces all of the ansible shell commands with the
python library, ansible-runner. This library is supported by
upstream ansible, is approved by the openstack foundation, is
supported in global requirements, and provides a better, more
programatic interface into running ansible playbooks.

All tests that interacted with the old shell commands have been
updated to now test using the library.

Change-Id: I8db50da826e2fbc074f4e7986d6fd00f6d488648
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2019-12-17 07:35:35 -06:00
James Slagle 72f5762e45 Handle config-download in progress in tripleoclient
This patch adds handling and checking of any instances of the workflow
tripleo.deployment.v1.config_download_deploy already in progress for the
current stack. It will prevent duplicate instances of the same workflow
being started and running at the same time.

It will allow for multiple instances of the workflow running at the same
time as long as they are for different stacks.

Change-Id: Ic8dbf28b5796ff998165b6b73b941f21c65f1dfa
Closes-Bug: #1852314
2019-12-10 16:23:11 -05:00
Gael Chamoulaud c6616f8d96
Drop Mistral support for the Validations CLI
This patch removes the possibility to run the validations through the
CLI with Mistral. Ansible is now the only way to run the validations.

Change-Id: I8bd9f4c4512279a291963d0b6df62316e7410f2b
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2019-11-08 13:38:45 +01:00
Gael Chamoulaud 746b97f19a
Get rid of Mistral for listing validations
Until now, we were using Mistral to get all the validations available on
the Undercloud. This patch drops the Mistral support for the validations
listing through the CLI and will parse them directly on the filesystem
instead of parsing from the *tripleo-validations* Swift container.

This change makes the CLI faster:
- ~6s with Mistral
- ~1.3s w/o Mistral

Change-Id: I5730fb2e23775f1d666276b6b4d46bcb550fc928
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2019-11-08 13:38:41 +01:00
Natal Ngétal ddb9970aef Add test for the function check_deprecated_parameters.
Add test for the function check_deprecated_parameters in workflows
parameters file. Test the unused_params and invalid_role_specific_params
parts.

Change-Id: I052d9958f52479e196d5e5dd4531f3971d7c0eb8
Closes-Bug: #1838923
Depends-On: https://review.opendev.org/#/c/674570/
2019-10-14 11:47:33 +02:00
Zuul 3c589979ce Merge "Handle a deployment that was manually cancelled." 2019-10-09 19:39:32 +00:00
ekultails 72850060e0 Handle a deployment that was manually cancelled.
When doing a deployment or update, if the end-user uses CTRL+c
(SIGINT) to end it early, it will fail complaining that there is
no passwords key in the plan. We will now handle this and cleanup
the existing plan.

Change-Id: Ie7f1a4269936f98ad86db4993992e0b9a27edf73
Closes-Bug: #1819672
Resolves: rhbz#1753251
Signed-off-by: ekultails <ekultails@gmail.com>
2019-10-08 17:41:07 +00:00
Steve Baker b5b5cab61d Fix race in execution finishing
An execution state can go from RUNNING to SUCCESS between fetching the
last message from the websocket and polling the execution state. This
means the SUCCESS payload is never returned and the overcloud
deployment fails at the end with no indication as to why.

This change turns the output of the execution into the last payload,
allowing the calling SUCCESS logic to run.

Change-Id: Ic22021ba9a2717de199629e361c656e2f562fb38
Closes-Bug: #1842987
2019-09-06 11:01:38 +12:00
Dougal Matthews 7f3853abe1 Remove get_overcloud_passwords, a unused function
Change-Id: I81883b8e501481a3ddf372abc547d85215475411
2019-08-22 08:24:31 +00:00
Sergii Golovatiuk b40c9e3b1c Suppress output for ssh-keygen
ssh-keygen has private key which shouldn't be visible in output. This
patch change the behaviour to print only exit code on failure. Also this
patch closes file descriptor once key is read.

Change-Id: I5a286cca6e48b0abc9cec3f15b2648977ae838c2
Related-Bug: rhbz#1734356
2019-08-14 15:11:37 +02:00
Zuul f64bf489ce Merge "Additional resource cleanup" 2019-08-06 18:29:19 +00:00
Natal Ngétal a6b920419c Use logger module instead print.
Use logger module instead print when it's necessary like to display a
warning message. Fix also a pep8 error in the workflows base file.

Change-Id: Ie6f06361ed15bab4d24536a9da88e9c92097771e
Closes-Bug: #1713539
2019-08-05 11:51:30 +02:00
Alex Schultz 6e13179ecd Additional resource cleanup
These resources were previously not properly closed when leading to
ResourceWarnings being printed to the end user.

Change-Id: I27e3f209f948b4c7c04e7994fc4dc7489f28f720
Related-Bug: #1837393
2019-08-02 12:34:42 -06:00
Steve Baker 3e03e3b78c Add --concurrency argument to introspect commands
The default concurrency of 20 may be too high for small underclouds
(especially CI environments), so this change adds a --concurrency
argument so callers can control the maximum number of nodes
to introspect concurrently.

Depends-On: https://review.opendev.org/#/c/672389/
Change-Id: I9faee9ab133e34466a79aa1176a16106bda1f15d
Closes-Bug: #1836976
2019-07-24 21:10:58 +00:00
Zuul 7eadd717e7 Merge "Add unit tests for running and listing validations from the CLI" 2019-03-18 19:57:41 +00:00
Emilien Macchi 3982259973 Make _upload_file to work with Python 3
Open the content from the file in Swift as bytes and in read
mode, otherwise Python 3 fails to open it as it comes as a string by default.

Closes-Bug: #1819665
Change-Id: I0da24d3508174190b431b660e67365f242ef04d8
2019-03-12 10:43:58 -04:00
Carlos Camacho c85b3de515 Add unit tests for running and listing validations from the CLI
This submission add unit tests for both listing and running validations
from the CLI.

Change-Id: If728b7535e3aef9439e022ae28e70ccffb97e0dc
Implements: blueprint validation-framework
2019-03-05 15:05:15 +01:00
Zuul 385a797ccb Merge "Don't validate stack when creating/updating plan" 2019-03-05 02:25:06 +00:00
Rabi Mishra eae703d52d Don't validate stack when creating/updating plan
There may be resource mappings in user_environment.

Change-Id: Ia2299698dfb5d7afb374e9ac2d7908c7cc6bbc22
Closes-Bug: #1817539
Depends-On: https://review.openstack.org/639072
2019-02-25 17:57:39 +05:30
apetrich cad7916ce8 Remove execution from workflow message send
Serializing all the execution in a message can make the message too big.
This change was done in tripleo-common. this supports that change
This change still supports the old format and is backwards compatible.

Partial-Bug: #1812172
Change-Id: I40ee028366222f38f5ba1db58d171f98be75d009
2019-01-21 09:26:04 +01:00
Zuul 0b0aea8ade Merge "Filter messages not from waiting execution" 2018-12-08 11:15:50 +00:00
James Slagle 7cef36bc9b Honor blacklist during temp key injection
The server blacklist also needs to be honored when getting the list
of hosts that we use to check for the ssh port being available, and
injecting the temporary ssh key.

Change-Id: I7ea9201f39af17bb43b7a1b8a9d8d1064e365c14
Closes-Bug: #1797572
2018-10-12 12:31:43 -04:00