When docker was used, its "create host directory tree" feature was
used. It apparently created directories with "container_var_lib_t"
type, and this prevents podman container to access the content with
AVC errors (permission denied).
The following patch ensures we get a recursive chcon running.
We're using "command" instead of "file" module because ansible doesn't
like broken symlink (in fact, they are symlink with relative path
within containers).
Change-Id: I20d00c79fc898b0c4e535662ee6a70472e075b36
With the current configuration, HAProxy logs are in the host journal.
This isn't really friendly when you want to debug issues with this service.
This patches ensures HAProxy logs are in a dedicated file, using the syslog
facility set in its configuration.
Depends-On: I8fee040287940188f6bc6bc35bdbdaf6c234cbfd
Change-Id: Ia615ac07d0c559deb65e307bb6254127e989794d
When a role count is 0, we can create the deployment resources
conditionally.
Closes-Bug: #1671859
Change-Id: I467b9ded1a1b33d520cb69aa86b253a0552643f7
We use update_identifier ansible variable to check if we need to
re-run deployment tasks. Though there is no bug as we use
DeployIdentifier heat param for it, it's little confusing
(UpdateIdentifier was meant for package updates).
This also removes usage of UpdateIdentifier/update_identifier in
all_nodes_config.j2.yaml. We can deprecate/remove the heat param in a
subsequent patch.
Change-Id: I36ed62ae605a2d8f8f139b50646144b143d5e5f4
Because we call ansible to run heat to execute ansible for the HostPrep
and RoleConfig, we need to be able to pass the
ansible_python_interpreter to be used for the ansible-playbook execution
via the ansible heat hook. This change adds an PythonInterpreter
heat configuration than can be used to config it from the default
/usr/bin/python to something like /usr/bin/python3
Change-Id: Idfefe1959e5b95b7d54ce8cb5c2a569225d50847
Related-Blueprint: python3-support
HostPrepConfig was using the old way (Heat) to run Ansible. We don't
need it anymore thanks to config-download.
It removes some technical debt and reduce our number of interfaces to
configure software.
Change-Id: I2041e6892de76b0ed04d7497e3f9064bfaf58270
This can be used to control whether puppet modules are consumed
from the baremetal host or from the container. Our default
is to consume these from the host so that deployment
archive tarballs can be used to extra puppet modules from
the host.
Since I61e35d8118c1de4c2976f496e8a6c9c529f3d91f we've had
puppet-tripleo in our containers however so using this
location would be possible as well.
Change-Id: I73026e66bcfafd1c582916141b5b1cf0ce0dc36c
There was also a special flag for FFU that triggered repo setup only
on the bootstrap node, so switch this to use the per-service bootstrap
name instead.
Change-Id: I32f963a002399af4911acbf507312f378aac3599
Partial-Bug: #1792613
When we were upgrading multiple nodes at the same time,
e.g. controllers, and a taks on one of the nodes failed, the other
nodes would keep upgrading. This is undersirable and can be fixed by
adding any_errors_fatal to the Ansible plays.
Change-Id: Iad2b5e32e955da41af4d2b8dd8ad8aa1eb5dffa9
Closes-Bug: #1804468
To continue the work that was done in
I711dbb00a9c34dbd96ef179ef41bff281b0001d1, we also need to skip the common
deploy tasks if --skip-deploy-identifier is passed by the operator.
When using --skip-deploy-identifier, the UpdateIdentifier is set to
None.
Ansible doesn't see None as "", so we really need to test if the
variable is defined or not. That patches changes the logic to test that.
We also support the case where the variable is set to "", and consider
is as empty which means we want to skip the deploy/updates.
It is also doing it for the update playbooks which includes tasks from
commont deploy.
It is not replicating the exact condition as in deploy_steps_playbook.
There is no need to also check if /var/lib/docker-container-startup-configs.json
file is here because it has been created during the initial deployment.
This fix the bug where --skip-deploy-identifier wasn't honored during
stack updates.
Co-Authored-By: Thomas Hervé <therve@redhat.com>
Co-Authored-By: Sam Doran <sdoran@redhat.com>
Change-Id: Ibab17dcaeebea65135fca4f40562109c90f36c27
Related-Bug: #1796924
Allow running docker-puppet.py in
debug mode, depending on the value
of the ansible variable docker_puppet_debug.
This variable takes its value from DockerPuppetDebug,
which is set to true in the env file
environments/config-debug.yaml.
Change-Id: I7c88aa22dce3396c6a79843ac13db479ed987f9d
Now that we are running this at fedora28 with python3 we need to use
python3 to run python scripts at playbooks
Depends-On: I2c471724374da44eeddc4680b268bc362572ee27
Closes-Bug: #1802531
Change-Id: I42b18b228bfe361d19b580a853328c1a6c896257
container_cli will be used later by update, upgrade and post upgrade tasks.
This patch is separated from actual tasks, so we can quickly iterate in
multiple patches.
Change-Id: I1ed7dec0019113f1259bce986f354723237f6a25
These tasks should have check_mode:no set so that they run in check
mode, as the variables they register are used in later tasks. Otherwise,
ansible in check mode fails with undefined variable errors.
Also, some tasks may fail due to not all requirements being available
since those requirements were not created by previous tasks that were
also ran in check mode.
This adds ignore_errors to these tasks, and sets the value to the
boolean ansible_check_mode which is provided by ansible and set based on
whether or not --check was passed to the ansible command line.
Change-Id: I84bc3c14ede37959a4078fd14ce4661b7bd23f84
We should pass in the common vars to all the common plays in
deploy-steps.j2 so that tasks will have them available. Some of these
parameter driven variables were never actually wired up, so they didn't
work to begin with (such as enable_puppet/enable_debug).
Change-Id: I830e1ae21fe3e278a5f7591065d066c0a6883a9a
Closes-Bug: #1785635
This change adds a stack output to services/common.yaml that acts
as an interface for Ansible group variables. Ansible vars provided
via this interface will be consumed by config-download and written
under $config-download-dir/group_vars/ where they can be accessed
by ansible commands.
Part of blueprint ansible-tasks-to-role.
Change-Id: Ib70e7dda13b4a3ed30af88906ba42c25cdc93038
With this patch, we're able to deploy a "standalone" stack using
podman on a fully-enabled SELinux system.
Change-Id: I4bfa2e1d3fe6c968c4d4a2ee1c2d4fb00a1667a1
To match the previous functionality when not using config-download, the
common deploy step tasks should be skipped for already deployed nodes
when using --skip-deploy-identifier.
This patch adds a task to check if one of the json configuration files
created by the common tasks already exists. If it does, and
--skip-deploy-identifier has caused an empty DeployIdentifier parameter
value, the tasks will be skipped for that node.
Change-Id: I711dbb00a9c34dbd96ef179ef41bff281b0001d1
Closes-Bug: #1796924
This has been unused for a while, and even deprecation was scheduled
(although the patch never merged [1]). So, in order to stop folks
getting confused with this, it's being removed.
[1] https://review.openstack.org/#/c/543871/
Change-Id: Iada64874432146ef311682f26af5990469790ed2
So far the tasks for external update/upgrade were not using the step
mechanism as other tasks, we had a single step. As external
deploy/update/upgrade tasks are being used for more things nowadays,
it's likely that we'll need to go towards a similar model like we have
for deploy/update/upgrade tasks -- proper usage of steps.
For now we have just 2:
* Step 0 for setting global facts, and performing validations.
* Step 1 for actual update/upgrade tasks. (There's an upcoming change
to run online data migrations in step 1).
Change-Id: I1933bd0eedab71caab56c0e5d93ba7927fb7c20f
Partial-Bug: #1793332
Adds initial check mode support for the paunch container startup
configuration and kolla config files. This cleans up the formatting of
the generated files so that the diff shown duing check mode with --diff
is useful.
We can't actually run paunch during check mode as it doesn't yet have
any support for a dry run mode.
Change-Id: I9add7b9fda50847c111e91735bd55a1ddf32f696
Adds check mode support for docker_puppet_tasks.
Since it's not possible to reliably determine what these tasks do, we
can't actually run them to get an idea of what might be changed. We can
however show the diff of the json file to get an idea of what would be
run.
Change-Id: I19e8bc9eb93d8acc8ee7d737770f9cc7e63f7a27
Adds check mode support for docker_puppet. The updated json file is
written to /var/lib/docker-puppet/check-mode/docker-puppet.json
during check mode and then diffed with the existing version at
/var/lib/docker-puppet/docker-puppet.json.
When docker-puppet.py is run during check mode, the updated json file
under the check-mode directory is passed to the command. All generated
config files are then written under /var/lib/config-data/check-mode,
which is then recursively diffed with the existing config under just
/var/lib/config-data to report on all changed config files.
Change-Id: I5c831e9546f8b6edaf3b0fda6c9fbef86c825a4c
Adds check mode support for puppet host tasks.
This works by writing the new puppet host manifest under
/var/lib/tripleo-config/check-mode, and diffing it against the existing
version of the manifest.
Puppet is also run with --noop, so that it only reports on what changes
would have been made.
It also uses the check mode hiera configuration at
/etc/puppet/check-mode/hiera.yaml if it exists so that the updated hiera
data is also accounted for when puppet runs with --noop.
Depends-On: Ibe0c2ab79c35f04ce51e7a1ade0e8ff72b430163
Change-Id: I112b63096c8dce05176b0939a7678bec02987294
with_dict is replaced by ansible's loop:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html#with-dict
This migrates tasks using with_dict over to use loop instead.
Additionally, when using loop (or with_dict), the entire loop item is
logged by default. This makes these tasks very verbose since we're
looping over large json/yaml files. Instead, use loop_control and label
ot only log the item key. The entire data structure already exists in
the config-download directory anyway, so there's no need to log the
whole thing to the console.
Change-Id: I1fc7431dfc662212b6ca64f4f738760f25b0c30b
Adds the following tags to relevant tasks in deploy-steps-tasks.yaml
that are common to all roles:
- host_config
- container_config
- container_config_tasks
- container_config_scripts
- container_startup_configs
The tags are tool agnostic, so hopefully they won't have to be updated
over time. They allow users to run only specific parts of the common
tasks.
Change-Id: Ia7476da222218411caddae887f99c029b4bccf23
This commit removes the "when failed" from the task title to eliminate
confusion.
These tasks always run to show the debug output for the previous task,
regardless of whether the the previous task failed or not. They will
show the debug output as long as the previous task finished (success or
failure).
Change-Id: I4e52bdc18885f13793550e5032fb1316a13b248c
This adds a tag step[1-5] to each of the plays within the jinja2 loop to
create our 5 deployment steps. Using these tags, it's possible to run
these plays individually if desired.
Change-Id: Ic705afbf174b4597d98c2b83041ff88dd8d6664c
As Podman doesn't create host location for bind-mount, we have to ensure
directories actually exists.
SELinux labels are also important, since Podman has selinux enabled by default,
and there is currently no way to disable it like in Docker.
Change-Id: Ic1bede203e8199a296944273cb334027dab940fe
Create a new parameter in TripleO: ContainerCli.
The default is set to 'docker' for backward compatibility but it allows
to also set to 'podman'.
When podman is selected, the right commands will be run so docker-puppet
can configure the containers when Podman is the selected container
library backend.
It removes the tripleo_logs:/var/log/tripleo/ mount that was used
by tripleo-ui but we shouldn't do that here. We'll create a bind mount
in tripleo-ui container later.
It run puppet with FACTER_hostname only if NET_HOST is disabled.
Change-Id: I240b15663b720d6bd994d5114d43d51fa26d76cc
Co-Authored-by: Martin André <m.andre@redhat.com>