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
This change reverts the change to verbose_level because it enables
ansible verbosity by default. Additionally this change hard codes true
for the wait_for_stack_ready function call so we always get the heat
stack creation output.
Revert "Don't override default verbose_level"
This reverts commit c8cd714588.
Change-Id: Idcc00fa04d4a356efb9e0bc30bc24e0121f31961
This change will provide the operator the ability to better control
a given deployment or operational task while leveraging the
tripleoclient.
A utility has been added to sanitize user input. This will ensure
the parsed string is in valid ansible limit format.
Change-Id: I190f6efe8d728f124c18ce80be715ae7c5c0da01
Depends-On: I0056fdbe3d9807e6baf4a1645a632ab9eb1b2668
Signed-off-by: Luke Short <ekultails@gmail.com>
Co-Authored-By: Kevin Carter <kecarter@redhat.com>
This was added to fetch the ansible errors via mistral api. We had
long removed the json_error.py callback plugin that used to write
ansible-errors.json, when moving ansible code to tripleo-ansible
repo and the command is useless now. Also, users won't need it as
they can get the errors from ansible.log.
Change-Id: Iceb4c282f3ae9fcb2c3836263ba66f5792e42334
We don't use mistral anymore to set the deployment status.
This simplifies setting of the deployment status and also
removes the usage of DeploymentStatusAction.
Change-Id: I5454510dc3aae681d5b37570a15cf0d0c8a3a114
We need to set the deployment status before stack deployment
and for playbook failure after the stack deployment.
Change-Id: Ic353b6552d28d66bcc53a7a4df318e60de5bd320
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>
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>
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>
As we now have ansible playbook running the stack create/update
and would only finish when the stack has been *_COMPLETE/*_FAILED,
we need to get the event marker before doing the update, else there
would be no events listed for subsequent deploy (stack update).
Left the call to utils.wait_for_stack_ready() for the time being.
We can just get the events as the stack operation is finished or
move the event polling to the playbook.
Change-Id: I746f3bb135fac309bb7e780648e3e8216d76770e
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>
Remove the mistral indirection and Use the tripleo-common
infrastructure directly when creating an overcloudrc file.
Story: 2007212
Task: 38426
Change-Id: Iaf6a401f510b768f26f3ff95a9c47d2d1dced71d
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This reverts commit 90eee3abc1.
I'm reverting this because it's a regression.
I'm open to not reverting this one if we want to fix it. If the
intention is to backport then we should revert this and correct it
before backporting. We shouldn't touch the verbosity for anything
except ansible items. I'm uncertain if this silenced the heat output
for the upgrade tasks but it impacted the deployment output.
Change-Id: I1bc27ca55a86d8d51960750d36ba825e5197b75f
Closes-Bug: #1863633
This change removes all of mistral from the get_deployment_failures function
by calling the required functions directly.
Story: 2007212
Task: 38781
Change-Id: I9d6779ff8b85132154541dd11697467aab164f93
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change removes several layers of abstration from our overcloud commands.
By cleaning up these layers we'll improve the understandability of the client
code while also improving the speed of these interactions.
Story: 2007212
Change-Id: I71617d4f47caaee9ce3025191ff0c0ebfe2adf79
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 change removes mistral from the config_download_export workflow by
managing the mistral context and calling the required methods directly.
Story: 2007212
Task: 38428
Change-Id: I9b8f15a92ffe75c0dcd091a89c93d842b6c6c16a
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change removes the mistral workflows from our set_deployment_status
function, which called three different mistral workflows.
- set_deployment_status_success
- set_deployment_status_failed
- set_deployment_status_deploying
Task: 38660
Story: 2007212
Change-Id: Idc18c245dc9debcf5236170e0aa99277e58d68a3
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change Converts plan status checks to using a direct call instead of
executing via mistral.
* A new method was added allowing us to update the deployment status object
when required.
* Tests have been added for the new static method update_deployment_status.
Story: 2007212
Task: 38430
Change-Id: Ie19be2078e2f349bf06e5b99ab93ca843e367463
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change will now use an ansible playbook to parse the horizon URL
information from a heat stack and return the connection string
accordingly.
Story: 2007212
Task: 38429
Depends-On: https://review.opendev.org/#/c/706196/
Depends-On: I85cb99d47cf3cb4f3093fc856e9f6892115ff5ef
Change-Id: I78e68147fc30ff4d71edb023f553219d553b53a6
Signed-off-by: Kevin Carter <kecarter@redhat.com>
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>
The OpenStack CLI defaults to 1 level of verbosity
which was being directly passed to Ansible methods.
When the CLI is given "-v", the verbosity level is set to 2.
This patch ensures that Ansible will not be verbose by default.
This lowers the amount of RAM a default
deployment/update/upgrade will use along with lowering
log file sizes.
Change-Id: Ic59cc6b2b9b979255c10d71e437afa733517e3e1
Signed-off-by: Luke Short <ekultails@gmail.com>
Added `--overcloud-ssh-enable-timeout` and
`--overcloud-ssh-port-timeout` to the openstack overcloud deploy command
to allow users the ability to tune these values. The ssh port timeout
might need to be tuned if the hardware being deployed is slow to post
and takes longer than 5 minutes to become ready.
These options have been added to:
* openstack overcloud deploy
* openstack overcloud admin
* openstack overcloud ffu upgrade
* openstack overcloud upgrade
Change-Id: I56f6001b5efeed7ccb3918a5c2622c3eca613c07
Closes-Bug: #1858222
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>
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
The inflight validations caused timeouts in the TripleO CI.
They should not be enabled by default. New features should not be
enabled by default in general, they should be optional.
So this patch changes the option to be --inflight-validations,
and make sure the inflights are disabled by default everywhere it's
called.
Change-Id: I082628a9480686d6a7801056c3b4bf332b4e3d95
Related-Bug: #1844446
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
Up to now, the in-flight validations were launched without any way to
deactivate them. This patch intends to change that fact.
Depends-On: https://review.opendev.org/674801
Change-Id: Ic3af7eb49ee6db5bc0ab10302c3f2a2c616db7b6
These resources were previously not properly closed when leading to
ResourceWarnings being printed to the end user.
Change-Id: I27e3f209f948b4c7c04e7994fc4dc7489f28f720
Related-Bug: #1837393
https://review.opendev.org/673862 allows config_download
workflow to take deployment_options as a input, this patch
passes it to the workflow so ansible_python_interpreter
is set correctly in generated inventory and thus used
during ansible deployment.
Depends-On: https://review.opendev.org/#/c/673862/
Closes-Bug: #1838540
Change-Id: I993fc09fd571fb93d78ffdbecf1823e806f744f4
https://review.opendev.org/#/c/664568/ adds mistral actions for
generating overcloud clouds.yaml file. This patch enables the
same to call the above mistral action and reuse
The clouds_yaml.py script is also moved from tht to here in
order to reuse the script.
Added proper constants and method for creating clouds yaml
directory.
Added a mock_clouds_yaml.py function to mock the
tripleo-common.utils.clouds_yaml script in order
to integrate with Tripleo.
Depends-On: https://review.opendev.org/#/c/664568/
Change-Id: I243ec370f9de0f2a0e34163962f1a1f228c3a9a1
Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
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: Ib5060a3e9679b105c76c3c72011c23aee0093dc1
This is needed in reprovisioning upgrade to be able to deploy new keys
without having to run an entire deployment.
We add some error handling:
- raise an error if no host is found;
- display a message if ssh connection fails
Change-Id: I4cbcfe4aa5596969ee501a41645b9b29e9a7236d
Implements: blueprint upgrades-with-os
In order to be able to properly configure the python interpreter we want
to use for the ansible deployment process, we need to expose it to the
deployment process. If a user is deploying from a CentOS7 host to a
fedora28 host, we need to be able to specify that we want to use
python3. The opposite might be true for Fedora28 host to CentOS7. For
the undercloud or standalone deployment methods we use the version of
python that the openstack client is running under as our default. For
the overcloud deployment, we currently do not specify anything by
default which will fall back to the ansible default. This may need to
change as we begine to run deployments against python3 hosts in CI. But
for now this change lays the framework to be able to specify it in the
deployment commands as an option.
Depends-On: https://review.openstack.org/#/c/617793/
Depends-On: https://review.openstack.org/#/c/616203/
Change-Id: I425905110d701bb7e3079f1017a07678eca42456
Related-Blueprint: python3-support
Co-Authored-By: Alex Schultz <aschultz@redhat.com>