There is a following deprecation warning
"DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead"
This patch changes warn to warning method to fix the DeprecationWarning
Change-Id: Id2173c89be889ea2c227e515db0237a1e6674702
Related-Bug: #1838765
This patch adds a new parameter called 'gathering_policy' (Defaults to
None) to the 'run_ansible_playbook' function. This parameter will
control the default policy of the Ansible fact gathering. Sets to None
by default, it will use the default policy for Ansible (ie. 'implicit').
Change-Id: I0668241a1675dd4e344cc24b6ff2cbb8f93b7a45
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
The validations execution will use now a static inventory file to speed
up things a bit. Note that this file will be removed after execution.
Change-Id: Ibdc3fc7ea9d3dec9531a2ce29ec8a1477c33c780
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This patch adds a new parameter called 'plan' (Defaults to "overcloud")
to the 'run_ansible_playbook' function. It will allow to execute
Validations with Ansible in a different plan or stack that the default
one through the TripleO CLI. Note That it was already possible only
while using Mistral but not for Ansible.
This patch also brings:
- Change the default values of the 'tags' and 'skip_tags' arguments
to 'None' and fixes their non Pythonic tests.
- Add '--stack' alias to the '--plan' argument for 'validator run'
command.
Change-Id: I6f8f55963f3f5261ec1497b650e0ca509d31dd32
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
The 'openstack tripleo validator list' subcommand can now get only the
available parameters for the validations using the new --parameters
argument.
```
$ openstack tripleo validator list \
--parameters \
[--validation-name <validation_id>[,<validation_id>,...] |
--group <group>[,<group>,...]]
```
Here is an output example:
```
Waiting for messages on queue 'tripleo' with no timeout.
{
"undercloud-cpu": {
"parameters": {
"min_undercloud_cpu_count": 8
}
},
"undercloud-ram": {
"parameters": {
"min_undercloud_ram_gb": 24
}
}
}
```
The --create-vars-file allow the operator to generate either a JSON or a
YAML file containing only the parameters of one or multiple validations.
This file will be available to pass as extra vars to the validations
execution.
```
$ openstack tripleo validator list \
--parameters \
--create-vars-file [json|yaml] /home/stack/myvars \
[--validation-name <validation_id>[,<validation_id>,...] |
--group <group>[,<group>,...]]
```
Change-Id: I6e2255c0d490ee8105f0757d02f5d8fba1d4fa20
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This patch adds a new parameter called 'extra_vars (Defaults to None) to
the 'run_ansible_playbook' function. This parameter will set additional
variables to the 'ansible-playbook' command. It will accept either a
dict or the absolute path of a file (YAML or JSON format).
Change-Id: Ib25ee9593528ad680b14ca09c62addbbd0b773a3
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
All the available Ansible variables for each Validations are now
processed as parameters and not as metadata anymore.
Change-Id: I1151923f3f0de7acf505a0beda3b7488c8ed8dec
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
Fixes an issue wich cause warnings such as the one below on the
console when using python3.
ResourceWarning : unclosed file <_io.TextIOWrapper name='FILENAME'
Closes-Bug: #1836379
Change-Id: I4a80a339b2cc0c3fca992cfc456581a91dbf2eef
This patch switch over Ansible to run validations by names by
default. The --use-mistral argument will have to be used in order to
execute them through Mistral.
Co-Authored-By: Gaël Chamoulaud <gchamoul@redhat.com>
Change-Id: Ia393f4d776ab2c09439e7772b5596ddbb47e0a5e
This patch adds a new parameter called 'log_path_dir' (Defaults to None)
to the 'run_ansible_playbook' function. The Ansible log file will be
created in the location of the playbook by default, otherwise in the given
directory path.
Change-Id: I7222a116974458b9149771cb44f7d5f7bc51bc79
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
When the tripleo.messaging.v1.send workflow fails with the error
'Workflow failed due to message status', the return message is None and
we don't have more information about what's failing. The same happens if
the validation runs well.
This patch improves the output in case of a messaging workflow failure.
Change-Id: I3fbf1a05b706b55fe1ab6d35653aecdaa8d4cc6e
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
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
It's possible that content["resource_registry"] might
not exist or be iterable so wrap the reference to it
with a try/except for a KeyError or TypeError and continue
the deployment without the empty resource_registry instead
of failing.
Change-Id: Ic7d88382a0ff15c24800f12ddbf69f13d6804b28
Closes-Bug: #1833743
If the heat api is overloaded or temporarily unavailable, we might get a
503 or 504 from haproxy during the deployment. We should retry polling
for events in this case as to not prematurely exit the deployment.
Change-Id: I947cd0f9bf4a97e46c3d2bf3e9b986f7d38e9357
Closes-Bug: #1833452
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/
We extend run_update_ansible_action
to allow running the Ansible playbooks with Mistral
or executing directly thru Ansible.
This is needed in case we need to run
exceptionally a task depending on Mistral
but Mistral is broken. For example, retry
an upgrade operation after having Mistral broken.
Change-Id: I15511b4f36260292e0ea4100b15b8e65a701b38b
ODL is deprecated since Rocky. Add a warning
before deployment asking the user if he wants
to continue with deployment even after
deprecation.
The logic is to check for neutron-opendaylight.yaml
environment file passed to overcloud deploy command.
If yes, ask for user confirmation before starting
deployment.
Change-Id: I1b16aab11591fac610cd4bf49a0927f1ec947146
Closes-Bug: #1827366
We are duplicating the code to fetch a specific value from the stack
outputs. This adds a get_stack_output_item that can be used to fetch
any named stack output and refactors the other functions that did this
same type of action.
Change-Id: I9f45661d432c47f9df962009cc3c6b9182006d1c
The problem we're solving here is that our operators using SSL + FQDN
based endpoints will have failures during the deployment because we
don't lookup the FQDN into IP addresses, needed later in the deployment
for proper binding.
This patch transforms undercloud_*_host parameters into IP addresses:
- We raise if lookup returns nothing.
- We raise if lookup returns more than one IP.
- We support both IPv4 and IPv6.
- We raise if the IP is a loopback.
- We raise if the returned IP is invalid.
Utils changes:
* Introduce utils.is_valid_ip.
Return True if the IP is either v4 or v6. Return False otherwise.
* Introduce utils.is_loopback.
Return True if the given host is a loopback. Return False otherwise.
* Introduce utils.get_host_ips.
Returns a list of IPs for a host to lookup.
* Introduce utils.get_single_ip.
Translate an hostname or FQDN into an IP address if it is valid IP.
Return it unchanged if it is an IPv4 or IPv6 address.
If the host is not reachable, it'll raise an exception.
By default it excludes the loopbacks but it can be allowed by setting
allow_loopback = True.
* Use utils.get_single_ip to translate undercloud_admin_host and
undercloud_public_host to IP addresses.
Related-Bug: #1763776
Change-Id: Ic008cc758493aa95e8aa237d23c2f66c0a930509
With the new validation framework, all the validations have been
migrated into their own Ansible Roles. The validations are now usable
from tripleo-validations/playbooks directory.
Change-Id: Id836ba2d88f04a90c1738bb71f2aeb07211d2620
Implements: blueprint validation-framework
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
These options now throw a hard error. Let's update the help text to
indicate that they will be removed in the U cycle.
See I94376c5f25c354a9fcdbca11548f7e3eedbd9491
Change-Id: I6826338e028b25230dbf12d4b207e5f4ab7805c8
The push=False flag with use with kolla-build.conf is not working if we
use buildah, clear example is the
tripleo-build-containers-centos-7-buildah job, it's suppose to work like
docker one but it's pushing too.
Closes-Bug: #1822752
Change-Id: I01788b3c11ac701b2cf8c151f95ccad7046532de
All of the calls to get_tripleo_ansible_inventory will then pass this
inventory to mistral, so the inventory entry for the undercloud needs
to use ssh as the connection.
Change-Id: I68ad49f103af79ab4b82b499b8620af9470f1ef9
Closes-Bug: #1822518
Depends-On: https://review.openstack.org/#/c/649459/
In python-3 the confirmation prompt isn't displayed without a flush on
stdout. This change fixes that.
This change also prevents a stacktrace from being printed when a
CommandError is raised, which is a much friendlier way of displaying
that user inputed caused a command to fail.
Change-Id: Ibab5abf6ab57793ca988b36d3411767f82e7e756
Closes-Bug: #1821672
As suggested by Jiri in this review adding a list() around
'map(replaced_list_value, template_part)' fixes the py3 issue
for me.
Closes-bug: #1819737
Change-Id: I1241985eac1aa7e092a11db5a443da0055ff0141
Unfortunately strftime does not always return a timezone that matches up
with what is available via zoneinfo on the file system. So instead of
using that, this patch creates a function to use timedatectl on the host
itself to determine what the current timezone is configured to.
Change-Id: I0d64cb0a534b48f1aa747655f7b7d997c74d77bc
Closes-Bug: #1820081
We've been deploying with keystone v3 for some releases now, so it's
time to get rid of this file; given that it's the same content as
overcloudrc.
Change-Id: I137e08213ef7f0f49510e2ebc905e351fb25b85a
Closes-Bug: #1733640
This submission starts with the integration of the current supported
Mistral workflows for running the validations.
This submission integrates the listing of all current installed validations.
Change-Id: Ic4a396598dcfdb55a0858bea95e9a2fcfc7b46e6
Implements: blueprint validation-framework
Depends-On: I294ab0016fda9587b405ef08dba3212b8e46a816
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
Check defined networks in the resource registry of the stack against the
networks defined in the environment files. If the environment provided
doesn't have the networks defined, it's likely they were improperly
dropped which can lead to deployment issues. This is a light check that
only checks for the existance of the networks but not the contents of
those networks. This handles the case where a user forgets to include
the network-isolation configuration on a subsequent update to the cloud.
This does not prevent a user from changing the contents of the networks
to something that breaks their deployment.
Partial-Bug: #1817631
Change-Id: Ia97a2367770e37bf8c55f2fd04c9a9efde914a67
Support Buildah instead of Docker by calling:
$ openstack container image build --use-buildah
And it will build TripleO containers with Buildah and not Docker.
Co-Authored-By: Alex Schultz <aschultz@redhat.com>
Change-Id: I7608136cb213bdca81348a0c3c751b488f48d712
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
The tripleo-common allow us to provide a verbosity level
but its not possible to pass it with the cli.
This review catch the --debug option passed to the cli
and provide it to package_update workflow
Change-Id: Ib1fc8f6aab9a0b1a26945d441185b5c8ccb6e7dd
Ansible doesn't take into account any 'ANSIBLE_PYTHON_INTERPRETER' env
var, as per this comment[1] back in 2016.
We hence have to pass it as an extra variable directly in the command.
This patch corrects I0600218163269409ae35ca34ffdfedb57926424e in
order to ensure we do pass the python interpreter value correctly.
[1] https://github.com/ansible/ansible/issues/6345#issuecomment-181981760
Change-Id: I48c8c532b23b9422406168cecdc9aebfe8f45651
Blueprint: python-3
Use a single queue for update and upgrade ansible run to avoid
race while consuming both messages from the web wocket
Change-Id: I8b04c2a39d35f530467ddb5f2c4305c08cbc44f1
Closes-Bug: #1804812
It's required to run TripleO Validation playbooks with Python3 on the
Undercloud.
blueprint python-3
Change-Id: I0600218163269409ae35ca34ffdfedb57926424e