Commit Graph

1326 Commits (2f9215b2535a976e1d1568650aa78be3fe8b5606)

Author SHA1 Message Date
Rabi Mishra 2f9215b253 Remove shenanigans for stack event verbosity
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
3 years ago
Rabi Mishra fa6a29379c Fix some pep8 errors
- F632
- E305
- E117

Change-Id: Id08a49c401a11a6f43ff132e798bdb1088ddb75d
3 years ago
Rabi Mishra 701c146bd7 Remove unused write_overcloudrc() function
Change-Id: Ifb3df132802dc1380e9949528416ecfed882cd06
3 years ago
Zuul 9c5a51861c Merge "Fix upgrade prompt" 3 years ago
Zuul a3270036bf Merge "Use ansible playbook for creating overcloudrc" 3 years ago
Zuul 178a48e793 Merge "Inspector set baremetal port physical_network" 3 years ago
Alex Schultz c0b0a5aa67 Fix upgrade prompt
We need to prompt the user if we should upgrade earlier in the code so
we can handle additional things like package upgrades in the undercloud
upgrade after the prompt. This change pulls the confirmation logic out
of tripleo_deploy and reuses the prompt_user_for_confirmation code in
the tripleo upgrade and undercloud upgrade actions.

Change-Id: I8dbcae39e6f6d966c1337bad5fb5ba673f7be874
Closes-Bug: #1877825
3 years ago
Steve Baker 51b0cc4c13 New command "overcloud node extract provisioned"
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
3 years ago
Rabi Mishra 6268bdea73 Use ansible playbook for creating overcloudrc
This uses the new playbook to create the rc files.

Depends-On: https://review.opendev.org/725511
Change-Id: I6fe6d2f7f2c41214e501daf4fc16673f1ab47472
3 years ago
Zuul 90ef9f277b Merge "Add call to cleanup_ipa.yml playbook when doing a stack delete" 3 years ago
Ade Lee 244f14c03c Add call to cleanup_ipa.yml playbook when doing a stack delete
When doing a stack delete, we need to make sure that any IPA entries are
cleaned up. We have added a call to the cli-cleanup-ipa.yml playbook
to ensure that this is done.

This commit also introduces a new option called ``--skip-ipa-cleanup``
so that callers can bypass this playbook. The default is False, meaning
the intended behavior is to cleanup FreeIPA by default during overcloud
delete operations.

Change-Id: I131ff1977005d0f90afa567e5c4e2e9c3b5d3af2
3 years ago
Kevin Carter 329cad5794
Add stack_name support to ANSIBLE_INVENTORY
This change updates the ANSIBLE_INVENTORY constant to support stacks with different
names.

Change-Id: I601ff211d53a29dbda195cb2df8708e57efbcb94
Signed-off-by: Kevin Carter <kecarter@redhat.com>
3 years ago
Zuul c28e805b63 Merge "Remove workflow_engine from client setup" 3 years ago
Zuul fd64df6294 Merge "Raise a new ValueError with the contents of the JSON is parsing fails" 3 years ago
Zuul 0b803fb2d2 Merge "Add login flag to container image prepare defaults" 3 years ago
Kevin Carter 41d88961e0
Remove workflow_engine from client setup
This change removes the workflow engine object from the overcloud deployment
client setup method. This is done to ensure we're not importing and accessing
client objects that are no longer relevant.

Change-Id: Ib7a686732839596ae9b079f8c6e24794ec5d34d7
Signed-off-by: Kevin Carter <kecarter@redhat.com>
3 years ago
Zuul 81a4336908 Merge "Don't use mistral directory as WORK_DIR for config-download" 3 years ago
Harald Jensås 9cd91775f2 Inspector set baremetal port physical_network
When deploying routed networks the physical_network
attribute of ironic ports must be set, this has been
a manual task.

With this change we add configuration for the
physnet_cidr_map processing hook in ironic inspector
so that the physical_network field of ironic ports
is set automatically when introspecting nodes.

Depends-On: https://review.opendev.org/722088
Closes-Bug: #1870529
Change-Id: I7f31b9f0143507ec3c9c26efd086f0bd95ef2ce7
3 years ago
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
3 years ago
Zuul e0750c44a7 Merge "Expose --limit, --skip-tags, and --tags on the CLI." 3 years ago
Zuul 222976efe1 Merge "Use undercloud upgrade to update all required pkgs" 3 years ago
Alex Schultz 7d1b738910 Use undercloud upgrade to update all required pkgs
Rather than require the end user to manually update packages prior to
kicking off the undercloud process we can do it ourselves by
implementing a flag to skip the update and invoking the upgrade after
the packages have been updated.

Change-Id: Idda6387922adeb182afd11cb0d692d1fcceff9a8
Related-Bug: #1869776
3 years ago
Luke Short 67c49244be Expose --limit, --skip-tags, and --tags on the CLI.
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>
3 years ago
Rabi Mishra 7cef22cc68 Remove openstack overcloud failures command
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
3 years ago
Alex Schultz c08c5c2b92 Add login flag to container image prepare defaults
If a registry requires authentication and --local-push-destination is
not used, a user may need to enable the login functionality. This change
adds a --enable-registry-login flag to `openstack container image
prepare default` that can be used to ensure the
ContainerImageRegistryLogin flag is defined as true.  Previously this
would have needed to be added in elsewhere.

Change-Id: I809023604fe119ba162638d921ffec56d4eb72f2
3 years ago
Rabi Mishra 025b88aa38 Simplify setting deployment status
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
3 years ago
Rabi Mishra 9a6b7fa663 Set correct deployment_status in deployment stages
We need to set the deployment status before stack deployment
and for playbook failure after the stack deployment.

Change-Id: Ic353b6552d28d66bcc53a7a4df318e60de5bd320
3 years ago
Kevin Carter a947b57094
Add the ability to load vars from files
This change will provide the ability to load extra vars from files, instead
of having to pass options through the CLI parser. By loading vars from file
we can ensure options are made more safe and better handled, especially in
cases when a given option may be massive, as is the case with
`parameter_defaults`.

> A new argument has been added to the ansible playbook runner which will
  allow us to pass options into the method that will be stored in an
  extravars file, which is then dynamically loaded by ansible-runner.
  Information on extravars files can be seen here: [0].
> A test has been added to exercise the new extravars file capability.

[0]: https://ansible-runner.readthedocs.io/en/latest/intro.html#env-extravars

Closes-Bug: #1871338
Change-Id: I9675e587abf3f07e91319a40620a8f4c67fbf97b
Signed-off-by: Kevin Carter <kecarter@redhat.com>
3 years ago
Alex Schultz 561bf0db29 Fix ResourceWarning: unclosed file
Fixing resource warnings as raised in
https://review.opendev.org/#/c/713807/

Change-Id: I2d7735751e504a10dbcf73a2fea832deeca664f0
3 years ago
Zuul 60ea5a3a4b Merge "Update necessary packages before undercloud upgarde." 3 years ago
Bogdan Dobrelya 9c602da452 Fix misused deployment vs connection timeouts
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>
3 years ago
Sofer Athlan-Guyot 0227a54473 Update necessary packages before undercloud upgarde.
This used to be a manual step in the tripleo process. You still have
to update python-tripleoclient and tripleo-common manually.  But:

 - "openstack-tripleo-heat-templates"
 - "openstack-tripleo-validations"
 - "tripleo-ansible"

can all be installed from this process as we spawn another new process
"openstack tripleo upgrade".  Thus all those packages will be
available for it.

Note that tripleo-common should still be installed before running that
command as some of its code is used by tripleoclient.

Eventually adding version dependencies from python-tripleoclient to those
other packages (or from tht which would stay a manual step) looks
challenging as it would be hard to track which version work with which
version.

Change-Id: Ic258f314074007e7e5fd16d87448ffb7a3447fc3
Closes-Bug: #1869776
3 years ago
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>
3 years ago
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>
3 years ago
Zuul c7ff66854a Merge "Remove update parameters workflows" 3 years ago
Zuul 0eaf44d198 Merge "Remove OrchestrationDeployAction call in ffwd upgrade prepare" 3 years ago
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>
3 years ago
Steve Baker a963409890 Remove unused baremetal provision workflow code
This code all has ansiblie equivalents now.

Change-Id: Ib45cad1cdb17482bf4d8102c066e67f82c658558
Story: 2007212
Task: 38457
3 years ago
Rabi Mishra 0e7c4bd3ba Remove OrchestrationDeployAction call in ffwd upgrade prepare
This was added for ffwd upgrade from N->Q, where we moved to use
scipt hook rather than os-apply-config. This does not seem relevant
any more is it would be removed for both normal upgrade[1] and ffwd
upgraded N->Q deployments.

Also, it won't be needed for Q->T ffu.

[1] https://review.opendev.org/560022

Change-Id: I5c55938b1c313e4ebf24f3babeb377e87bf7cd30
3 years ago
Rabi Mishra 62c43e7626 Fix GlanceClientAdapter to use new osc release
It seems osc has started using openstacksdk[1] and it probably breaks
how you find image with name.

[1] https://review.opendev.org/#/c/650374/

Change-Id: Ia15a065c908aa9992747f5286f2404a0947f6720
Closes-Bug: #1869736
3 years ago
Zuul 1b38e856e0 Merge "Add new interface to run arbitrary playbooks from a plan" 3 years ago
Zuul 1ec8fd29b3 Merge "overcloud node delete, use ansible for unprovision" 3 years ago
Zuul 55e9c48acb Merge "overcloud deploy, use ansible for bm provision" 3 years ago
Rabi Mishra 71ca2d1073 Remove usage of GenerateFencingParametersAction action class
Replace with tripleo-common utils api.

Change-Id: I5fdecc3a9a2bd46f7d8056144c8b1d68f170878d
3 years ago
Rabi Mishra 98258c1a49 Remove usage of GetFlattenedParametersAction action class
Replaces with tripleo-common utils api.

Change-Id: I216b856ec0874045183b86d8a49b5473e35427c6
3 years ago
Zuul 0379179dfd Merge "Switch default images to py3" 3 years ago
Zuul 1a42f9a6b3 Merge "Switch to ansible for overcloud node (un)provision" 3 years ago
Steve Baker bd0588e3ef overcloud node delete, use ansible for unprovision
Change-Id: I1340345702a506fe195429b6e4900eb9ce95e827
Story: 2007212
Task: 38457
3 years ago
Steve Baker ed3cee8641 overcloud deploy, use ansible for bm provision
This change switches over the "openstack overcloud deploy" command to
use ansible instead of mistral for baremetal (un)provision. This is
only called when the --baremetal-deployment argument is used, although
users are encouraged to provision with the standalone provision
command.

Change-Id: Ice88dcfc41c9211c6f43846db3f8b79ca0159eaf
Story: 2007212
Task: 38457
3 years ago
Steve Baker 708afba0b1 Switch to ansible for overcloud node (un)provision
Change-Id: Iaa10d3d3e5f9facd6b03ba0e55f90f532d691abd
Story: 2007212
Task: 38457
3 years ago