When running 'overcloud deploy' command look for dynamic
defaults file for these options:
--roles-file, --network-file, --vip-file and
--baremetal-deployment
When the option is set by the user, use the user provided
file and make sure a copy is created in the working
directory. If the argument is not set look in the working
directory for the file used previously and use that file.
overclod node, and overcloud network commands require the
user input. But will place a copy in the working_dir for
overcloud deploy.
The depends-on creates these "defaults" by running the
different nova-less/network-v2 export commands when
upgrading the undercloud. With this change the next
'overcloud deploy' after the undercloud upgrade will use
the correct files (unless the user set the args ...)
Depends-On: https://review.opendev.org/795773
Change-Id: I53ba631dc80428c6f1fe71c2bbfb0b5a36dd8f01
Relevant logic was altered to comply with the rule
while preserving the function.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I8363336463dc170087924b2f7cc3fa56609f848e
While using tripleo deploy command we need sometimes to save
reproducer script for issues investigation. Add option to enable
it '--reprocuce-command'.
Change-Id: Ie5e694ab3b9e5196aea76da51e4e567ec8970fd7
Adds a step to unmount the tmpfs dir used by the HeatNativeLauncher
(heat-all aio process) when the process is stopped. Previously, the
mount was kept and would hang around until the next reboot.
As part of this change, the following is also included:
- The tmpfs mount dir is also changed to be at the generated temporary
directory within the heat launcher dir (heat_dir), instead of one level
higher up. This provides a location to backup the files before
unmounting.
- The default value for the heat_dir directory is also changed from
/var/log/heat_launcher to ~/tripleo-deploy/<stack>/heat_launcher, so
that the artifacts are saved in the generated tarball.
- heat-all is started as the deployment user ($SUDO_USER, e.g. stack)
instead of heat. There is no reason to run heat-all as heat. This
enables keeping the generated files within the home directory of the
deployment user
- The heat_dir directory, owned by root, has it's mode changed from 700
to 755. This is safe as the directory is now in the deployment user
home directory. This is necessary so that the deployment user can
read the directory.
- A step to backup the heat-all files is added such that the files are
not lost when the unmount is done, and they are saved as part of the
deployment artifacts.
Signed-off-by: James Slagle <jslagle@redhat.com>
Change-Id: I751fc605cb09ad9fcf169b3e2eab0532feb379a5
Rather than use the generated ansisble inventory.yaml or
tripleo-ansible-inventory.yaml, switch to use the native AnsibleRunner
inventory directory instead.
Change-Id: I74b31d1080fd7b19efbe706024267aa871a6029b
We currently re-implement what the download_config function does in
tripleo-common. Let's just reuse that function to align better with what
the overcloud does.
Depends-On: https://review.opendev.org/c/openstack/tripleo-common/+/798153
Change-Id: Idc66d711ca7f4ce6369e38526257b887b9bc7dfd
This would ensure that we don't build service chains for
not enabled roles and cip would not try to pull images
for services mapped to OS::Heat::None.
Depends-On: https://review.opendev.org/c/openstack/tripleo-common/+/797173
Change-Id: I8f2f7700d0dd5a6c7459c8bc69d7937d72d23687
We don't need to keep writing undercloud-passwords.conf
as tripleo-<stack_name>-passwords.yaml is the
source of old passwords since rocky.
Change-Id: I527d752fbf0713b93354f61acdaf35db8c60f068
Now that we've new releases of tripleo-common, we can
change this and drop the action module from tripleo-common.
Change-Id: I26e5781b24d1d071858d135a6a3b09aa238ba31c
Blocks catching base Exception were replaced
with more constrained alternatives where possible.
Alternatives were chosen based on exceptions possibly
raised by calls within the `try` clause.
Logs were altered to reflect new situation.
string method format was used for new log calls.
Unit tests were adjusted accordingly.
This patch may cause uptick in unhadled exceptions,
as previously "hidden" issues become apparent.
Increase in the number of exceptions capture,
including potential hunk revert should be done with care however.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I24612700bcbd3e17685ae7a33a27f38a2055a0fb
Set OVNStaticBridgeMacMappings for standalone deployments
automatically unless the user provided an override.
This replaces the implementation in quickstart-extras:
https://review.opendev.org/783137
Change-Id: I79d141358ead2a2c90fdb728e17926d96d498a28
Closes-Bug: #1927556
Part of the docs immediatelly followin was
slightly malformed, as the rst syntax formatted it
as a quasi-note.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I4dc6e90ab488c1f291e4143b11dfb88883cb4f71
This patch begins to add support for using the ephemeral Heat process
to the overcloud deploy command.
The functionality is enabled with the newly added --heat-type cli arg,
which can be used to select the heat type to be used by the deployment
playbooks and modules. The options are:
installed: current behavior using Heat installed on the undercloud
pod: ephemeral Heat podman pod (heat-api/engine)
container: ephemeral Heat podman container (heat-all)
native: ephemeral Heat native heat-all process
The default is "installed" initially to preserve the existing
functionality.
Signed-off-by: James Slagle <jslagle@redhat.com>
Implements: blueprint ephemeral-heat-overcloud
Change-Id: I8fb6ca088b1052488ff4f9ada4d3ab29c0be4735
When
https://review.opendev.org/c/openstack/python-tripleoclient/+/775302
merged, it changed the function signature of
utils.archive_deploy_artifacts, but the tripleo deploy code was not
updated to pass the right arguments. This caused the templates directory
to be considered the working directory and the artifact tarball was
generated in that directory, and then promptly deleted during the
cleanup phase.
This patch updates tripleo deploy to pass the right arguments to
archive_deploy_artifacts, and also use a consistent working directory
based on the stack name under ~/tripleo-deploy instead of defaulting to
the home dir. This is a cleaner approach than just leaving all the files
in the home dir, especially given that tripleo deploy can deploy
multiple stacks, and if the same directory was used as the default,
there would be file collisions.
Closes-Bug: #1921975
Signed-off-by: James Slagle <jslagle@redhat.com>
Change-Id: Idded7faba1ff6c811b94503c559029aeeaca6a06
Set parameters RedisVirtualFixedIPs and OVNDBsVirtualFixedIPs
in the environment for standalone. Defaults to the address
specifed using the --control-virtual-ip parameter.
These parameters must be set so that the tripleo_service_vip
ansible module won't fail, i.e reuired to make
https://review.opendev.org/777259 work for standalone deployments
with OVN and/or Redis enabled.
Related: blueprint network-data-v2-ports
Change-Id: I959851dd6c6667621a466481c634626f4739c2ce
Related: blueprint network-data-v2-ports
As the change [1] changes the attribute name from
'install_tmp' to 'install_dir'.
This needs to be changed in the code as well.
So corrected the attribute name according to change [1]
[1]: https://review.opendev.org/c/openstack/python-tripleoclient/+/774572
Closes-Bug: bug/1917583
Change-Id: Ibe629c1e8e682d189d258ae843e9756d5f357108
In order to be re-used by post deployment action, this review
copy the ansible inventory into the output_dir as:
standalone-inventory.yaml.
If file exist it will replace the old one.
Change-Id: Ied14f40cf074755225abe1e8f1c859bacbe9022f
When loading user parameters the stack-vstate-dropin.yaml
is not yet available. It was ignored for the undercloud
case already, but not for the minion. This caused the
minion install to fail.
This changes it to ignore any file ending with
'-stack-vstate-dropin.yaml' to cover both undercloud and
minion cases.
Closes-Bug: #1913209
Change-Id: I464db87f8b2fa8c03ae9adea775c4567d44cd1e5
We've used this for many releases now and we're unlikely to change it
now. Let's drop the experimental warning.
Change-Id: Ib4c7520cc4dc12ca5967d638a15d74b14be5ca62
Users may want to skip the container prepare process to ensure they
don't update their containers. This change adds a
--disable-container-prepare flag to the following actions which should
skip the preparation actions.
- overcloud deploy (and updates)
- overcloud plan actions
- undercloud deploy (and upgrades)
- tripleo deploy (and standalone deploy)
Closes-Bug: #1896757
Depends-On: https://review.opendev.org/#/c/737522/
Change-Id: I30b448930f53aef108d9bdb544a6d02b18658b0d
Currently if you don't specify --deployment-user and for whatever reason
it's run as root (e.g. ansible as root using sudo), the deployment fails
because it attempts to write out to /home/root/. This change updates the
user home root lookup for clouds.yaml and throws a warning about setting
--deployment-user if it's root.
Change-Id: I284b374cc5e6d6a147286f0485832258f93f038f
We recently renamed the container prefixes from centos-binary to
openstack. Additionally this moves the version information of this into
constants that can be updated in stable branches if needed.
Blueprint: bp/switch-to-heat-all-container
Change-Id: I208a6ae5b314e8482ca5fc8d3e5695dbd7da5f1b
Set CtlplaneNetworkAttributes parameter in overcloud
environment. The parameter contains a map with network
and subnets data.
CtlplaneNetworkAttributes:
network:
dns_domain: ctlplane.localdomain.
mtu: 1442
name: ctlplane
tags: ['192.168.24.0/24', '192.168.25.0/24']
subnets:
ctlplane-leaf1:
cidr: 192.168.25.0/24
dns_nameservers: ['8.8.8.8', '8.8.4.4']
gateway_ip: 192.168.25.254
host_routes:
- {'destination': '192.168.24.0/24', 'nexthop': '192.168.25.254'}
ip_version: 4
name: ctlplane-leaf1
Also set the CtlplaneNetworkAttributes in the undercloud environment
from the data in undercloud.conf.
Also set the CtlplaneNetworkAttributes in the standalone environment.
Change-Id: I12f1ea965d489eb36353e988cc3ec947f72a35ad
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>
If the ephemeral heat stack wasn't created, raise a proper error message
explaining what happens and how to proceed instead of a python stack
trace.
Change-Id: I4c2e19e290751ea56f1b45aaebc56ea9a5d2c6d1
Closes-Bug: #1892248
Don't use return code from ansible_runner and manage with a flag.
This also removes the fail_on_rc flag from run_ansible_playbook()
and makes it consistent to raise RuntimeError if rc !=0
everywhere including _standalone_deploy().
Change-Id: Ia5971af601d1d9500f33045768b38ac7937117f5
Closes-Bug: #1889394
Previously were just getting the address+mask which doesn't work well
for some uses.
Related-Bug: #1883692
Change-Id: Ia32acda4f22d99ada07291aaf52c97c676d13dd4
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.
We previously dropped the support of python 2.7 and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.
Change-Id: I19fbdebe406575d2567f98a322ff68e6e992fac7
undercloud_enable_paunch isn't needed anymore since we retire Paunch
project.
There is no need of deprecating the option since it would have no effect
if set in undercloud.conf.
Change-Id: I9972d3e9826422cd6ab56c801ff93c4d2dfc8404
The new --transport argument allows for specifying a transport
configuration to have set in the generated ansible configuration file.
The default value of "local" matches the previous hardcoded value.
To deploy multiple nodes with tripleo deploy, "--transport ssh" can be
used.
blueprint tripleo-deploy-multinode
Change-Id: I75cbde83dda1a79ad65bf522e57c8ef326bbc54d
Signed-off-by: James Slagle <jslagle@redhat.com>
The only effect the argument had previously was to prevent the command
from throwing an exception when it was not passed.
However, the argument did not actually prevent non-standalone
deployments. It was still possible to deploy multinode or single remote
node deployments using tripleo deploy even when passing --standalone.
This patch deprecates the --standalone argument and adds help text to
indicate that it's no longer needed. Continuing to pass the argument
will have no change in behavior.
blueprint tripleo-deploy-multinode
Change-Id: I6d390f3b201ad681d977a12fd627e610ad7b65f0
Signed-off-by: James Slagle <jslagle@redhat.com>
With rc being set to 1 initially, it was never reset to 0 when using
--output-only. This meant when running tripleo deploy with
--output-only, it always exited 1, causing an exception.
This patch instead initially sets the value to 0. The only other place
where rc is used is to capture the return from running ansible, so if
that returns non-zero, rc will be updated accordingly so that the
deployment will fail.
blueprint tripleo-deploy-multinode
Change-Id: Ie116b4c600317d618a9e55b91a945d03e71fb780
Signed-off-by: James Slagle <jslagle@redhat.com>
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>