Skip to content

Commit

Permalink
Merge pull request #630 from stackhpc/upstream/2024.1-2024-10-10
Browse files Browse the repository at this point in the history
Synchronise 2024.1 with upstream
  • Loading branch information
priteau authored Oct 11, 2024
2 parents d734b6d + 68036c1 commit d97e697
Show file tree
Hide file tree
Showing 15 changed files with 123 additions and 50 deletions.
29 changes: 5 additions & 24 deletions ansible/gather-facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,25 @@
# building their configurations.
- name: Gather facts for all hosts
hosts: all
any_errors_fatal: "{{ kolla_ansible_setup_any_errors_fatal | bool }}"
max_fail_percentage: >-
{{ gather_facts_max_fail_percentage |
default(kolla_max_fail_percentage) |
default(100) }}
serial: '{{ kolla_serial|default("0") }}'
gather_facts: false
tasks:
- name: Group hosts to determine when using --limit
group_by:
key: "all_using_limit_{{ (ansible_play_batch | length) != (groups['all'] | length) }}"
changed_when: false

- name: Gather facts
setup:
filter: "{{ kolla_ansible_setup_filter }}"
gather_subset: "{{ kolla_ansible_setup_gather_subset }}"
when:
# Don't gather if fact caching is in use
- not ansible_facts

- name: Gather package facts
package_facts:
when:
- "'packages' not in ansible_facts"
- kolla_action is defined
- kolla_action == "precheck"

- name: Group hosts to determine when using --limit
group_by:
key: "all_using_limit_{{ (ansible_play_batch | length) != (groups['all'] | length) }}"
changed_when: false
tags: always

# NOTE(pbourke): This case covers deploying subsets of hosts using --limit. The
Expand All @@ -41,7 +33,6 @@
# the limit.
- name: Gather facts for all hosts (if using --limit)
hosts: all_using_limit_True
any_errors_fatal: "{{ kolla_ansible_setup_any_errors_fatal | bool }}"
max_fail_percentage: >-
{{ gather_facts_max_fail_percentage |
default(kolla_max_fail_percentage) |
Expand All @@ -68,14 +59,4 @@
- item not in groups["all_using_limit_True"]
# Don't gather if fact caching is in use
- not hostvars[item].ansible_facts

- name: Gather package facts
package_facts:
delegate_facts: True
delegate_to: "{{ item }}"
with_items: "{{ delegate_hosts }}"
when:
- "'packages' not in hostvars[item].ansible_facts"
- kolla_action is defined
- "kolla_action == 'precheck'"
tags: always
8 changes: 0 additions & 8 deletions ansible/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ kolla_ansible_setup_filter: "{{ omit }}"
# By default, we do not provide a gather subset.
kolla_ansible_setup_gather_subset: "{{ omit }}"

# This variable is used as "any_errors_fatal" setting for the setup (gather
# facts) plays.
# This is useful for weeding out failing hosts early to avoid late failures
# due to missing facts (especially cross-host).
# Do note this still supports host fact caching and it will not affect
# scenarios with all facts cached (as there is no task to fail).
kolla_ansible_setup_any_errors_fatal: false

###################
# Kolla options
###################
Expand Down
8 changes: 6 additions & 2 deletions ansible/module_utils/kolla_podman_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ def parse_volumes(self, volumes, mounts, filtered_volumes):
mounts.append(mount_item)
else:
try:
src, dest = item.split(':')
mode = 'rw'
if item.count(':') == 2:
src, dest, mode = item.split(':')
else:
src, dest = item.split(':')
except ValueError:
self.module.fail_json(
msg="Wrong format of volume: {}".format(item),
Expand All @@ -192,7 +196,7 @@ def parse_volumes(self, volumes, mounts, filtered_volumes):
else:
filtered_volumes[src] = dict(
bind=dest,
mode='rw'
mode=mode
)

def parse_dimensions(self, dimensions):
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/ironic/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ ironic_services:
enabled: true
cap_add:
- NET_ADMIN
- NET_RAW
image: "{{ ironic_dnsmasq_image_full }}"
volumes: "{{ ironic_dnsmasq_default_volumes + ironic_dnsmasq_extra_volumes }}"
dimensions: "{{ ironic_dnsmasq_dimensions }}"
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/openvswitch/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ openvswitch_ovs_vsctl_wrapper_enabled: false
#############

openvswitch_system_id: "{{ ansible_facts.hostname }}"
openvswitch_hostname: "{{ ansible_facts.hostname }}"
openvswitch_hostname: "{{ ansible_facts.fqdn }}"
openvswitch_hw_offload: "no"
2 changes: 2 additions & 0 deletions ansible/roles/rabbitmq/tasks/upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
- import_tasks: version-check.yml

- include_tasks: remove-ha-all-policy.yml
when:
- not om_enable_rabbitmq_high_availability | bool
Expand Down
59 changes: 59 additions & 0 deletions ansible/roles/rabbitmq/tasks/version-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
- block:
- name: Get current RabbitMQ version
vars:
service_name: "rabbitmq"
service: "{{ rabbitmq_services[service_name] }}"
become: true
command: "{{ kolla_container_engine }} exec {{ service.container_name }} rabbitmqctl --version"
register: rabbitmq_version_current
changed_when: false

- name: Get new RabbitMQ version
become: true
vars:
rabbitmq_container: "{{ rabbitmq_services['rabbitmq'] }}"
kolla_container:
action: "start_container"
command: "rabbitmqctl --version"
detach: false
environment:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
image: "{{ rabbitmq_container.image }}"
name: "rabbitmq_version_check"
restart_policy: oneshot
volumes: "{{ rabbitmq_default_volumes + rabbitmq_extra_volumes }}"
register: rabbitmq_version_new
failed_when: false
check_mode: false

# As an example, when the new RabbitMQ version is 3.13.6:
# new_major_version = 3
# new_minor_version = 13
# new_version = 3.13
# And if the current RabbitMQ version is 3.11.28:
# upgrade_version = 3.12
- name: Check if running RabbitMQ is at most one version behind
vars:
current_version_major: "{{ rabbitmq_version_current.stdout | regex_search('^[0-9]+') }}"
current_version_minor: "{{ rabbitmq_version_current.stdout | regex_search('(?<=.)[^.].') }}"
current_version: "{{ rabbitmq_version_current.stdout | regex_replace('.[^.]+$', '') }}"
new_version_major: "{{ rabbitmq_version_new.stdout | regex_search('^[0-9]+') }}"
new_version_minor: "{{ rabbitmq_version_new.stdout | regex_search('(?<=.)[^.].') }}"
new_version: "{{ rabbitmq_version_new.stdout | regex_replace('.[^.]+$', '') }}"
# Note: this assumes 3.13 will be the last release before 4.0.
upgrade_version: "{{ '4.0' if current_version == '3.13' else current_version_major + '.' + (current_version_minor | int + 1) | string }}"
assert:
that: (current_version_major == new_version_major and
new_version_minor | int - current_version_minor | int <= 1) or
(new_version | float == 4.0 and current_version | float == 3.13)
fail_msg: >
Looks like you're trying to run a skip-release upgrade!
RabbitMQ must be at most one version behind the target release version ({{ rabbitmq_version_new.stdout | trim }}) to run this upgrade.
You are running {{ rabbitmq_version_current.stdout }}.
Please first upgrade to {{ upgrade_version }} with the command ``kolla-ansible rabbitmq-upgrade {{ upgrade_version }}``.
See these docs for more details: https://docs.openstack.org/kolla-ansible/latest/reference/message-queues/rabbitmq.html#slurp
delegate_to: "{{ groups[role_rabbitmq_groups] | first }}"
run_once: true
tags: rabbitmq-version-check
5 changes: 3 additions & 2 deletions doc/source/reference/message-queues/rabbitmq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ additional steps needed to migrate from transient to durable queues.
.. warning::

Since the default changed from non-HA to Quorum queues in Bobcat release,
following procedure is required to be carried out before an upgrade.
following procedure is required to be carried out before a SLURP upgrade to
Caracal.

1. Stop all OpenStack services which use RabbitMQ, so that they will not
attempt to recreate any queues yet.
Expand Down Expand Up @@ -199,7 +200,7 @@ you must override the image. if you want to use version 3.12 change

.. code-block:: yaml
rabbitmq_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/rabbitmq-3.12"
rabbitmq_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/rabbitmq-3-12"
You can then upgrade RabbitMQ with the usual command:

Expand Down
10 changes: 10 additions & 0 deletions doc/source/user/operating-kolla.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ issues:
At a convenient time, the upgrade can now be run.

SLURP extra preparations
++++++++++++++++++++++++

RabbitMQ has two major version releases per year but does not support jumping
two versions in one upgrade. So if you want to perform a skip-level upgrade,
you must first upgrade RabbitMQ to an intermediary version. Please see the
`RabbitMQ SLURP section
<https://docs.openstack.org/kolla-ansible/latest/reference/message-queues/rabbitmq.html#slurp>`__
for details.

Perform the Upgrade
-------------------

Expand Down
10 changes: 1 addition & 9 deletions etc/kolla/globals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@
# Dummy variable to allow Ansible to accept this file.
workaround_ansible_issue_8743: yes

# This variable is used as "any_errors_fatal" setting for the setup (gather
# facts) plays.
# This is useful for weeding out failing hosts early to avoid late failures
# due to missing facts (especially cross-host).
# Do note this still supports host fact caching and it will not affect
# scenarios with all facts cached (as there is no task to fail).
#kolla_ansible_setup_any_errors_fatal: false

# This variable may be used to set the maximum failure percentage for all
# plays. More fine-grained control is possible via per-service variables, e.g.
# nova_max_fail_percentage. The default behaviour is to set a max fail
Expand Down Expand Up @@ -757,7 +749,7 @@ workaround_ansible_issue_8743: yes
#enable_prometheus_mysqld_exporter: "{{ enable_mariadb | bool }}"
#enable_prometheus_node_exporter: "{{ enable_prometheus | bool }}"
#enable_prometheus_cadvisor: "{{ enable_prometheus | bool }}"
#enable_prometheus_fluentd_integration: "{{ enable_prometheus | bool and enable fluentd | bool }}"
#enable_prometheus_fluentd_integration: "{{ enable_prometheus | bool and enable_fluentd | bool }}"
#enable_prometheus_memcached: "{{ enable_prometheus | bool }}"
#enable_prometheus_alertmanager: "{{ enable_prometheus | bool }}"
#enable_prometheus_alertmanager_external: "{{ enable_prometheus_alertmanager | bool }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
Fixes an issue with ironic dnsmasq failing to start in deployments
using podman because it requires the NET_RAW capability. See `LP#2055282
<https://bugs.launchpad.net/kolla-ansible/+bug/2055282>`__.
8 changes: 8 additions & 0 deletions releasenotes/notes/bug-2080552-714078144170a5bd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
fixes:
- |
Fixes #2080552.
``openvswitch`` role will now set ``external-ids:hostname`` to
``{{ ansible_facts.fqdn }}`` instead of ``{{ ansible_facts.hostname }}``
due to Neutron using FQDN based hostnames in ``requested-chassis`` field.
`LP#2080552 <https://launchpad.net/bugs/2080552>`__
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
Fixes an issue, when using podman, with named volumes that use a mode
specifier. See `LP#2054834
<https://bugs.launchpad.net/kolla-ansible/+bug/2054834>`_ for more details.
14 changes: 14 additions & 0 deletions releasenotes/notes/remove-any-errors-fatal-664fc2207074f0ef.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
upgrade:
- |
Support for failing execution early if fact collection fails on any of the
hosts by setting ``kolla_ansible_setup_any_errors_fatal`` to ``true`` has
been removed. This is due to Ansible's ``any_errors_fatal`` parameter not
being templated, resulting in the value always being interpreted as
``true``, even though the default value of
``kolla_ansible_setup_any_errors_fatal`` is ``false``.
Equivalent behaviour is possible by setting the maximum failure percentage
to 0. This may be done specifically for fact gathering using
``gather_facts_max_fail_percentage`` or globally using
``kolla_max_fail_percentage``.
5 changes: 1 addition & 4 deletions tests/templates/globals-default.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
ansible_python_interpreter: /usr/bin/python3
{% endif %}

# NOTE(yoctozepto): In CI it makes sense to always try to fail
# as early as possible.
kolla_ansible_setup_any_errors_fatal: true

kolla_base_distro: "{{ base_distro }}"
network_interface: "{{ api_interface_name }}"
network_address_family: "{{ address_family }}"
Expand Down Expand Up @@ -189,6 +185,7 @@ enable_octavia: "yes"
octavia_provider_drivers: "ovn:OVN provider"
octavia_provider_agents: "ovn"
enable_redis: "yes"
neutron_dns_domain: "example.org."
{% endif %}

{% if scenario == "prometheus-opensearch" %}
Expand Down

0 comments on commit d97e697

Please sign in to comment.