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
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
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>
If one of the operations running Ansible playbooks returns a wrong rc,
leave the loop and go to final tasks before raising.
It'll prevent the upgrade tasks to fail but the other playbooks (e.g.
deploy) to keep running.
Closes-Bug: #1869230
Change-Id: I5b1bb964ed290c860e66074202c45d7dd09bf29c
This change adds a switch that will enable or disable raising an
exception when a playbook executes. This will allow some methods to
return the RC and status information when a playbook is run, even when
there's a failure. The default behaviour is to raise an exception on
failure, but when fail_on_rc is set to False the run_ansible_playbook
method will return the status and rc information regardless of any
failures.
To ensure we're not raising an exception from the ansible runner library
its been changed to RuntimeError.
Change-Id: I3af652615b5227144256074c05170d148f19bc1d
Closes-Bug: #1859182
Signed-off-by: Kevin Carter <kecarter@redhat.com>
At somewhere along the line, we lost the heat stack status output
indicating what progress was being made while waiting for a stack to
build. This change sets verbosity to True for the tripleo deploy command
so that the output is always shown.
Change-Id: Id349dbc8a554c2fa542b986062e708bbc14da714
We can identify the exception class by 'except <ExceptionClass>'
so we don't need to check in inside except block.
Change-Id: Ib4f3a47b6f1121b1c753d06bd42e74c9a0762eac
The move to ansible-runner lib created a regression where ansible runs
were logged in a separated file (ansible.log) instead of being appended
to the install-undercloud.log.
Change-Id: I0ceb90abfd6fcfbb3cbff439f8c348da2a7bfe2f
Closes-Bug: #1859183
copy_clouds_yaml is a new function that will be used to copy
/etc/openstack/clouds.yaml which is now generated by Ansible in TripleO
Heat Templates:
I585abc3e6a3b9b8ae9183e0b5170df2e39301e17
It also sets the right permissions to only allow the deployment user to
read the file which container sensible credentials (cloud admin).
Note that I286c71edf120e11d8e51c792e6078dc60147f026 will be rebased so
the revert can properly happen with the right dependencies with
tripleo-common.
Depends-On: https://review.opendev.org/#/c/696390/
Change-Id: I49b95bf7a03e39db3c2cbb91b2167c7645b09136
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>
Because the memcached_node_ips is required by puppet and we don't
configure it with a hostnetmap configuration, we need to specify the
undercloud as the memcached_node_ips configuration in the outputs that
we export for the undercloud minion.
Change-Id: I152b3e60d53ebd482430f9b52baf68a3370a9c4c
Closes-Bug: #1855010
- undercloud_config: set no_validations to True by default, since we want
to disable them by default now.
Introduce --inflight-validations in order to get those particular
validations independently.
- tripleo_deploy (undercloud + standalone): add missing extra_args when
running ansible.
Co-Authored-By: Cédric Jeaneret <cjeanner@redhat.com>
Closes-Bug: #1843555
Change-Id: I95b8d7abc632b190ac6731393bd490bfa3aedcca
Like we do for the overcloud, add the --inflight-validations option,
disabled by default. Disable by default, we'll skip the
"opendev-validations" Ansible tags when running the playbooks.
Related-Bug: #1844446
Change-Id: Ia37b3d4cc657d994b6a63412d5792930d54a14dd
Instead of hardcoding 'undercloud' for the artifacts and password files,
let's name them:
- Directory: <stack_name>-install
- Archive: <stack_name>-install-%s.tar.bzip2
- tripleo-<stack_name>-passwords.yaml
Depends-On: Iab62ca6bb209524e923ad44a3d8d6079fc976cef
Change-Id: I1e65235017b0b223c53e1c8b48ad2ac573e4ccca
Reset is an application provided via ncurses which is useful in
resetting a terminal when things go wrong. Since podman is eating some
of the terminal output, it can leave the cmdline in a broken state at
the end of the undercloud install. We tried to address it outselves but
let's reuse an existing application instead. -I being passed to reset
skips the initialization strings which can erase the output.
Change-Id: Id9aa7910032588605977f4725385503cf0a235bc
Closes-Bug: #1833302
The oslo messaging host configuration does not actually use the endpoint
map so we need to be able to provide this information as part of the
output yaml file for use with a minion. This code grabs the ctlplane
ip out of the rolenetmap for the undercloud and uses it to construct the
oslo messaging node names value that is used when configuring the service.
Blueprint: undercloud-minion
Change-Id: I5dc103452f3e7484ea81df15d75b606d2c74859a
We're seeing some escape sequences being dropped when we run the
deployment via the undercloud. This causes a user to have to run a reset
after the undercloud installation in order to be able to use their shell
command line again. We can avoid this if we send an terminal erase line
sequence to trim the rest of the line at the end of the deploy.
Change-Id: Ibb74bfebfaab2cd122abe1bc3cd5bbd2562ccfc5
Closes-Bug: #1833302
Add the ability to install an undercloud minion which is connected to an
original undercloud. This minion can have either heat-engine or
ironic-conductor deployed on it.
Adds two new openstack commands for the minion install and a new
minion.conf can be used to configure them.
openstack undercloud minion install
openstack undercloud minion upgrade
Depends-On: https://review.opendev.org/#/c/656984
Change-Id: I61832f5088be172eaf31b36a9cca8dc289580bb2
Related-Blueprint: undercloud-minion
The tripleo deploy command was duplicating a function call to the heat
stack that we already had a shared function for in utils. Let's use that
instead as it now has additional retry logic improvements.
Change-Id: I1f22b5b4aa79e5a1f7d340054e08423cd1b1c090
This converts Docker*Image params into
Container*Image varients when using tripleo deploy.
In the future we can use it for a few other ad-hoc
Docker* variable substitutions as well to make things
more generic.
Change-Id: Ib1dc0c08ce7971a03639acc42b1e738d93a52f98
Fixes wording of the exception message, and also notes that the
templates directory may be inaccessible due to permission denied. This
could be caused by using a remote mounted (nfs/sshfs) directory that is
not accessible by root.
Change-Id: I7210831eafea825a3e7f4209c79b07a0b2510dac
The symlink needs to be created with sudo because if validations are
enabled, the call to run ansible-playbook-3 is before the "sudo tripleo deploy
command".
This patch moves the symlink into a function, that will be called before
the preflight if enabled and during the tripleo deploy/upgrade command,
which should cover standalone deployment and upgrade.
Change-Id: I1ce9b3df6c937cd796728d4fc5921fcf1023e5db
With "sudo", the $PATH is overriden an really basic:
PATH=/sbin:/bin:/usr/sbin:/usr/bin
It doesn't list the /usr/local/(s)bin, hence the created
symlink wasn't seen by the script.
It also push that symlink creation in the __new__ special
method in order to make it cleaner.
Finaly, it takes care of lint/pep8 failures, not related to
this change (how is that even possible?!)
Co-Authored-By: Natal Ngétal <hobbestigrou@erakis.eu>
Closes-Bug: 1817365
Partial-Bug: 1816446
Change-Id: If09eb32f43b2c26c8cd8a89f2e862db1dd91dfed
This patch tries to reuse the same function _launch_ansible
for the multiple ansible executions in tripleo_deploy.py by
passing a list with the arguments to be used by the
ansible-playbook command.
Change-Id: Iad2c9b82478ae05d68fcfd5880270105c68abefb
If a user is using http_proxy or https_proxy but is not excluding
localhost from being proxied via the no_proxy var it can lead to a
failure when we try and talk to the heat api. This change adds a check
that is used for both the standalone tripleo deploy command and
the undercloud install to ensure the end user does not hit this
condition.
Change-Id: I507d81278097bc3b5e23d53ae35aa26657541bfc
Closes-Bug: #1815814
Run a hostname preflight check when running the standalone as this can
cause issues with rabbit/mysql/pacemaker/puppet. The standalone check is
not run when an undercloud is being deployed or if output only is
specified. The undercloud has a different set of preflight checks run
prior to deployment so we do not need to rerun the hostname check when
the undercloud is being deployed.
Depends-On: https://review.openstack.org/#/c/634836/
Change-Id: I4de51d792f004575e0e802a1d340478d6ae9f848
Closes-Bug: #1814564
Simply reading a file is dangerous, it might happens that the file
might be open but not closed will leads to ResourceWarning: unclosed
file error, It is necessary to use with keyword which will close the
file first and then allow it to open it.
Changing r mode to rb mode as in Python3, While r mode is used then
it reads the file based on file encoding provided but with rb mode
it reads the stream as a binary which avoides the encoding issue.
Change-Id: Ia48c1cb0e436ac2c53fc6bd46c4a906c70a51325
In RHEL8, we'll have /usr/bin/ansible-playbook provided by ansible
package.
Everywhere in TripleO we rely on /usr/bin/ansible-playbook but the
ansible-python3 package in Fedora 28 doesn't provide it.
Until it does, we have a temporary workaround that will create a symlink
only if the file doesn't exist and if ansible-playbook3 is here.
Change-Id: I040345ffb76a14035e6100c4e61a9aea07b690c6
Related-Bug: #1812837
Standalone does not use any of the composable networks by
default. Deploy Standaloen using /dev/null as network data
so that these resources are not included when creating the
plan.
Undercloud uses only the External network for the external
VIP. Deploy the undercloud using the Undercloud specific
network_data_undercloud.yaml, ensures external_from_pool.yaml
is in the plan.
Related-Bug: #1809313
Depends-On: Ib11a134df93e59947168b40bc71fb1da9172d4ac
Change-Id: I102912851a3b9952daaf7c4d5a34a919f527f805
If the file specified is empty, we currently throw a generic message
about it not being in the correct format. Let's add a check to make sure
the file is not empty before attempting to parse it as yaml.
Change-Id: I702da1170484c0d10c3ae836ec3f7550975a341c
Closes-Bug: #1810436
When rendering templates, check for services mapped to OS::Heat::None
and rewrite roles data to remove them. It reduces the numbers of
resources created, and improve in particular container image building.
Change-Id: I37aa673937681d5142feb74e89ca85fdb471db57
Previously if deployment tasks fail, the undercloud/standalone upgrade
would continue with post-upgrade and online upgrade tasks. This is now
fixed.
Change-Id: Ia749c01602214df326edf52b855e4a2a43c6b3c2
Closes-Bug: #1805836
We invoke python to parse the templates in the tripleo deployment
command so we need to make sure that runs as either python2 or python3
since the python command may not be available.
Change-Id: I242fdd717d9e52de0b122d50cf7d6a9ad7f0e041
Related-Blueprint: python3-support
After we switched from instack-undercloud to t-h-t-based undercloud
installer, we dropped online data migrations. Bring them back.
Change-Id: I31b7281728b75c968701b97234db835c1b8f298f
Closes-Bug: #1804275