Updates the cli-enable-ssh-admin.yaml and cli-grant-local-access.yaml
ansible playbook executions to use the consistent working directory
instead of a temporary directory. Adds reproduce_command=True to the
calls to utils.run_ansible_playbook so that the workflows can be re-run
out of the deployment for reproducability.
Change-Id: Id4880be3a0d936e67bfc77ed28145eb1b9de162e
Signed-off-by: James Slagle <jslagle@redhat.com>
Instead of using tmp dirs for ansible-runner, use the consistent working
directory, which allows for saving the output for debugging and
reproducability.
Change-Id: I83ad02817ace364eb4bc596127cfd7d6699c32aa
Signed-off-by: James Slagle <jslagle@redhat.com>
Extend the command which extract overcloud node
information to also include network information.
The command now requires the --roles-file used
when deploying the overcloud to be passed because
this is the source for these options:
* default_route_networks
* networks_skip_config
Partial-Implements: blueprint network-data-v2-ports
Depends-On: https://review.opendev.org/772359
Change-Id: I09c886fe6bada721caac61d25d9a0915cf9aff02
This refactors and moves the code to tripleoclient
for us to be able to remove dependency on mistral-lib.
Change-Id: I62352871311e98927fbd560b4235114c8c62f223
This also moves some helper functions from tripleo-common
mistral action to utils.py. A subsequent patch would
cleanup the mistral actions in tripleo-common.
Closes-Bug: #1915780
Change-Id: I8cf4c983c8810a42bd703b097dc1cb8034798314
The `-e` and `--templates ` switches have been deprecated for a while, at least
since newton, it's time to remove them because it causes confusion to
operators.
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1909347
Change-Id: I4000638be5ec5e95b36e38f1a93ceb5cf2851905
Ansible forks are now configurable for a deployment. The default
will also no longer exceed 100 forks (but --ansible-forks can).
Change-Id: Iaa6763a3124e45c1f0297cd59cc57f206dfc5cda
Depends-On: I57345d5b100efce143fa940b56c81f5e6bc6c390
Signed-off-by: Luke Short <ekultails@gmail.com>
We have recently switched the --limit option to take precedence over the
defined skip list via a Heat parameter. In order to prevent confusion
between these two, we should throw a warning indicating that the
parameter in Heat will be ignored when running ansible.
Depends-On: https://review.opendev.org/#/c/741271/
Change-Id: I7c43563381b694573801e6a54e973fdbd36e0798
Related-Bug: #1857298
We changed all client workflows other than derived params
to not use mistral and zaqar. However, the unit tests still
mock lot of these. Let's remove those.
Change-Id: Ieddd97e73b1bd0f88b1fed17ac2575b3e2964e5f
It seems we want to output stack events irrespective of verbosity,
as per https://review.opendev.org/#/c/724856/. There is no point of
having all the useless logic for verbosity in wait_for_stack_ready().
Also fixes stack update for scale-down to list events.
Change-Id: I96a2a2255253aa2feac62b67ad5d5813e3126a20
As a first step to upgrade to a nova-less undercloud, the baremetal
deployment yaml which represents the current overcloud needs to be
built.
This command builds the yaml for an existing overcloud using the
heat stack output AnsibleHostVarsMap and a list of all baremetal
nodes. When the generated yaml is used to run "openstack overcloud
node provision" no changes will be made to any nodes.
Blueprint: nova-less-deploy
Change-Id: I47c885697bf36b999fd0ad9bd99a23990440ed62
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
Fix misused ansible connection timeout and deployment timeout passed in
config download and ansible runner utility.
Allow ansible runner utility to be given a job_timeout as well.
Also fix the misuse of timeout parameters in related worklows. Add
--overcloud-ssh-port-timeout and use it to configure ansible connection
timeout for the DeleteNode interace of the involved
workflows. Then use the timeout parameter as real timeout instead of
mistakingly passing it as a connection timeout.
Add new unit test for ansible timeout in config_download. Add missing
coverage for the existing timeout-related params in other unit tests.
Closes-Bug: #1868063
Co-authored-by: Kevin Carter <kevin@cloudnull.com>
Change-Id: I2a4d151bcb83074af5bcf7d1b8c68d81d3c0400d
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
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>
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>
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>
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>
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>
This moves the node import into ansible.
Story: 2007126
Task: 38183
Change-Id: I7889228333dfc503529770d5cf06a35f39432f18
Signed-off-by: Kevin Carter <kecarter@redhat.com>
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>
These arguments are available in the workflow but are not exposed as
arguments. This change fixes that, allowing users to tune for their
environment.
The new ansible version of this command already has these arguments
(next change in this series)
Change-Id: I00b224ec7e2334afd2dfe549f36dbec2987a1be1
The provision command was defaulting to id_rsa.pub, however the deploy
command uses id_rsa_tripleo for initial setup.
When using the deploy command for provision as well, use the public
key, not the private id_rsa_tripleo.
This option was being processed in several different ways, this change
normalize it by creating a single function in the Command class, which
all inheriting methods will consume. Tests have been updated to
accomodate this change.
Related-Bug: #1863920
Change-Id: I221480f3cfc77545a8fcbef777829239c3bad0a0
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change removes all of mistral from the expand_roles function
by calling the required functions directly.
Story: 2007212
Task: 38782
Change-Id: I07c1249571e1fe989d57427412c1aaa6ea1ff165
Signed-off-by: Kevin Carter <kecarter@redhat.com>
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>
This wait function mimics what we used to have with the old mistral workflow,
by pausing and streaming heat status information while a node is being deleted.
Change-Id: I3d85bd85bffb8e1e6bc9d48b8d51fbab5302580d
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change removes mistral from the scale_down workflow by managing
the mistral context and calling the required methods directly.
Story: 2007212
Task: 38423
Change-Id: I17c74e8a5f0ed166316e67e9a62966194869df6a
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change removes mistral from the discover_and_enroll workflow by managing the
context and simply calling the required methods. This change will speed up the
general execution process and ensure better reliability as we'll no longer require
mistral or zaqar to execute this workflow.
Story: 2007212
Task: 38450
Change-Id: Ic13a3f70383afdc23abd29b8db230f01e0bebf55
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change integrates baremetal provisioning with the existing
"openstack overcloud node delete" command.
Instead of providing node ID(s), the --baremetal-deployment argument
will specify the provisioning yaml with instances set to
provisioned:false for the nodes to be deleted.
Internally the command needs to expand the roles and compare the
indexes of unprovisioned instances with the indexes of the heat
resources in the server resource group, using the match to specify the
heat resource physical_resource_id to pass to the scale down workflow,
automating what is done for deployed-server scale-down[1].
Blueprint: nova-less-deploy
[1] https://docs.openstack.org/project-deploy-guide/tripleo-docs/latest/features/deployed_server.html#scaling-down
Change-Id: I3376378cdffbe69b8d14aed683deba185ba1e0f5
- print a table of baremetal nodes which are about to be unprovisioned
- prompt user to confirm unprovision, overridable with --yes argument
- add an -all argument which will unprovision all nodes in the yaml,
instead of just the provisioned:false nodes.
- add the missing plan argument to the provision deploy_roles to
support multiple overcloud stacks
Blueprint: nova-less-undercloud
Change-Id: I25c5311ec3599e0de9bd87038366ed8c7d7896a2
Previously, kernel and ramdisk images had been
removed from glance in favor of using them directly from the
filesystem. However, some references to these images remained in a
couple of test scripts and also for node discovery where they were
being used as the default. The images being used were
bm-deploy-kernel and bm-deploy-ramdisk.
The change requiring this update was made in commit 7ad1b812fc and
can be found at review https://review.opendev.org/#/c/663897/
In tripleoclient/v1/overcloud_node.py, replaced the default kernel and
ramdisk image names with paths to the current default locations, and
adjusted tripleoclient/tests/v1/overcloud_node/test_overcloud_node.py
to use these paths in the test.
In tripleoclient/tests/v1/overcloud_image/test_overcloud_image.py,
removed mentions of these images in the image list as they no longer
appear as available images in a live setup. This rule change would
have correctly caused test failures for missing images before
overcloud_node.py was updated.
Closes-Bug: #1845698
Change-Id: Ia556e09b7e92ed16e50061ccfbd002af61252092
This is a companion command to "openstack overcloud node provision"
which is required for scale-down and should be run after "openstack
overcloud deploy".
It will undeploy any instance which has provisioned=False in the
supplied roles yaml, see this change[1] for the provisioned format.
[1] https://review.opendev.org/#/c/672605/
Change-Id: Ic7705c290220df7c55656fa080ff74315fb2030f
Blueprint: nova-less-deploy
Depends-On: https://review.opendev.org/#/c/672848/
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
Ironic can use HTTP links or local files, and we already put the images to
a location accessible inside of ironic containers (for introspection).
This change switches to using file images for IPA. The existing Glance
images are not deleted since some nodes may be using them. Multi-arch
layout of [[PLATFORM-]ARCH/]agent.EXT is reused from the unit tests
of the `image upload` command, assuming that's what people are using.
Change-Id: Ie6fa04112e3348f429dc42b28442f8996ab03f29
Implements: blueprint nova-less-deploy
Depends-On: https://review.opendev.org/#/c/663897/
Node delete is a destructive action and we should prompt a user to
confirm they want to do this action. We also added a --yes parameter to
skip this confirmation prompt.
Change-Id: If4a82977e2351fd3a9e0241eee60cb3719ef43c0
To avoid tasks duplications in the tripleo-common workbooks, let's
re-use the deployment workbook with the right parameters so we can avoid
all the config-download tasks.
This patch will reuse tripleo.deployment.v1.config_download_deploy with
the right parameters for a scale-down.
Depends-On: Ibc980e9162bf109de7e7ef338c9bd602174c8448
Change-Id: Ie8e15589197e9725a1cae2d29137f05fefa427c1
With the new workflow, ansible_scale_down, we can now tear down the
nodes before they get deleted from the stack.
blueprint scale-down-tasks
Change-Id: I9982f3854604497c804d7875b926f14e1060b788
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
Provide (make available) the nodes once cleaning is
completed.
Also add tests for node cleaning.
Closes-Bug: #1806502
Change-Id: Ic9212236e4372faaf7d43da8958adec5eac9df06
This is now the default in ironic on tripleo and
redundant.
Change-Id: I4047298ac5af8a0314ace343518f695144073ff5
Depends-On: I249a1a9e30c06ea15b487e952b91949c606423c5
Related-Bug: #1803965
The convention is to use the same queue name ("tripleo") for all
workflows. This can lead to messages showing from other tripleoclient
triggered workflows showing up during message polling if multiple
workflows are running at the same time.
This patch adds a check that will filter out any messages that do not
belong to the execution that is being waited on by comparing the
execution id with the root_execution_id returned in the execution
payload.
Depends-On: Icbe80c338d69efc6ce8fceb0f73f833bec588536
Change-Id: Ie6473d6a1044cdf76552d62645b4d63da2df9398
Related-Bug: #1794277
The prior changes in this series enabled uploading of images tagged in
such a way that they could be used with multiple architectures, this
change uses the data from instckenv.json to select appropriate deploy
images for each node as it's registered to ironic.
Blueprint: multiarch-support
Depends-On: Id82de41e7a49c2d8124fc74125ed51031579aa80
Depends-On: Idaf05b8efce28cd0cbf339cf693db4f55a693d9b
Depends-On: I41dce6e25766562db4366021309b8c2b74a8ab80
Change-Id: I7c84f3035853d8ee7b8d45895e7acce8e9dd3d13
There were two issues: The action timeout and the wait_for_messages
timeout.
The wait_for_messages did not need a timeout here and it was causing the
bug. I added an cli option for the timeout and setup a reasonable
default (the previous default was over 4 hours that would invalidate
keystone session duration)
Change-Id: I232d071516d3f53f9f87143d9d65ebe3e58b0f38
Closes-Bug: 1734712
This will allow the cli and tripleo UI to share a common queue,
which will help with scripting the frontend behaviour or track
the progress of the cli from the frontend.
Related-Bug: #1603345
Change-Id: I5849983eee82b5a56cae1bf38a3c2694b6b291db