Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • very-demiurge-very-mindful/kolla-ansible
1 result
Show changes
Showing
with 167 additions and 119 deletions
......@@ -21,6 +21,7 @@ import sys
import yaml
from importlib.metadata import Distribution
from time import sleep
LOG = logging.getLogger(__name__)
......@@ -45,15 +46,20 @@ def _detect_install_prefix(path: os.path) -> str:
return prefix_path
def _get_direct_url(dist: Distribution) -> str:
def _get_direct_url_if_editable(dist: Distribution) -> str:
direct_url = os.path.join(dist._path, 'direct_url.json')
editable = None
if os.path.isfile(direct_url):
with open(direct_url, 'r') as f:
direct_url_content = json.loads(f.readline().strip())
url = direct_url_content['url']
prefix = 'file://'
if url.startswith(prefix):
return url[len(prefix):]
dir_info = direct_url_content.get('dir_info')
if dir_info is not None:
editable = dir_info.get('editable')
if editable:
url = direct_url_content['url']
prefix = 'file://'
if url.startswith(prefix):
return url[len(prefix):]
return None
......@@ -66,7 +72,7 @@ def _get_base_path() -> os.path:
kolla_ansible_dist = list(Distribution.discover(name="kolla_ansible"))
if kolla_ansible_dist:
direct_url = _get_direct_url(kolla_ansible_dist[0])
direct_url = _get_direct_url_if_editable(kolla_ansible_dist[0])
if direct_url:
return direct_url
......@@ -101,12 +107,24 @@ def galaxy_collection_install(requirements_file: str,
args += ["--requirements-file", requirements_file]
if force:
args += ["--force"]
try:
run_command("ansible-galaxy", args)
except subprocess.CalledProcessError as e:
LOG.error("Failed to install Ansible collections from %s via Ansible "
"Galaxy: returncode %d", requirements_file, e.returncode)
sys.exit(e.returncode)
for retry_count in range(1, 6):
try:
run_command("ansible-galaxy", args)
except subprocess.CalledProcessError as e:
if retry_count < 5:
LOG.warning(f"Failed to install Ansible collections from "
f"{requirements_file} using Ansible Galaxy "
f"(error: {e}) (retry: {retry_count}/5)")
sleep(2)
continue
else:
LOG.error(f"Failed to install Ansible collections from "
f"{requirements_file} using Ansible Galaxy "
f"(error: {e}) after 5 retries")
LOG.error("Exiting")
sys.exit(e.returncode)
break
def read_file(path: os.path, mode: str = "r") -> str | bytes:
......@@ -168,6 +186,6 @@ def run_command(executable: str,
if quiet:
kwargs["stdout"] = subprocess.DEVNULL
kwargs["stderr"] = subprocess.DEVNULL
subprocess.run(full_cmd, shell=False, **kwargs) # nosec
subprocess.run(full_cmd, check=True, shell=False, **kwargs) # nosec
else:
subprocess.run(full_cmd, shell=False, **kwargs) # nosec
subprocess.run(full_cmd, check=True, shell=False, **kwargs) # nosec
......@@ -2,6 +2,6 @@
features:
- |
Adds ``prometheus_node_exporter_targets_extra`` to add additional scrape
targets to the node exporter job. See kolla-ansible-doc:`documentation
<reference/logging-and-monitoring/prometheus-guide.html>` for more
information.
targets to the node exporter job. See `documentation
<https://docs.openstack.org/kolla-ansible/latest/reference/logging-and-monitoring/prometheus-guide.html>`__
for more information.
---
fixes:
- |
Fixes cases when fluentd parser fails on Python traceback.
OpenStack services regex has been reworked to include both
global_request_id and handling cases with Python traceback.
`LP#2044370 <https://launchpad.net/bugs/2044370>`_
---
fixes:
- |
Fixes external ceph cinder keyring is not imported into libvirt if
templated.
Per now, ansible/roles/nova-cell/tasks/external_ceph.yml looks
cinder_cephx_raw_key up as file from cinder_cephx_keyring_file.stat.path
To allow templated cinderkeyrings, the lookup is changed to "template"
Fixes `LP#2089229
<https://bugs.launchpad.net/kolla-ansible/+bug/2089229>`__
---
fixes:
- |
Fixes internal endpoint for the ``heat-cfn`` (CloudFormation) service.
`LP#2087537 <https://launchpad.net/bugs/2087537>`__
---
features:
- |
``kolla-ansible install-deps`` subcommand will now retry on Ansible Galaxy
collections installation failures.
---
features:
- |
Generates a system-scoped ``public-openrc-system.sh`` file. This allows
running Ironic commands against the public API, which is useful when access
to the internal API is unavailable.
`LP#2051837 <https://launchpad.net/bugs/2051837>`__
---
upgrade:
- |
Rewrite kolla-ansible CLI to python
Rewrite kolla-ansible CLI in Python. Moving the CLI to Python allows for
easier maintenance and larger feature set. The CLI was built using the
cliff package that is used in the ``openstack`` and ``kayobe`` commands.
Moving the CLI to python allows for easier
maintenance and larger feature set.
The CLI was built using the cliff package
that is used in openstack-cli and kayobe-cli.
This patch introduces a few breaking changes stemming from the nature of
the cliff package:
This patch introduces a few breaking changes.
The changes stem the nature of the cliff package.
1. the order of parameters must be
kolla-ansible <action> <arguments>
2. mariadb_backup and mariadb_recovery now are
mariadb-backup and mariadb-recovery
* the order of parameters must be ``kolla-ansible <action> <arguments>``
* ``mariadb_backup`` and ``mariadb_recovery`` now are ``mariadb-backup``
and ``mariadb-recovery``
The ``--key`` parameter has also been dropped as it was duplicating
``--vault-password-file``.
---
fixes:
- |
Adds a check to stop deploying/upgrading the RabbitMQ containers if it
will result in downgrading the version of RabbitMQ running.
---
fixes:
- |
Fixes a bug where the RabbitMQ version check would fail to pull the new
image due to lack of auth.
`LP#2086171 <https://bugs.launchpad.net/kolla-ansible/+bug/2086171>`__
---
features:
- |
Implements service-cert-copy role being able to
copy certs to non-HAProxy container.
`Partial Blueprint mariadb-ssl-support <https://blueprints.launchpad.net/kolla-ansible/+spec/mariadb-ssl-support>`
Implements service-cert-copy role being able to copy certs to non-HAProxy
container. `Partial Blueprint mariadb-ssl-support
<https://blueprints.launchpad.net/kolla-ansible/+spec/mariadb-ssl-support>`__
......@@ -2,4 +2,4 @@
collections:
- name: https://opendev.org/openstack/ansible-collection-kolla
type: git
version: master
version: stable/2024.2
......@@ -323,7 +323,7 @@
- name: Create TLS certificates for octavia
shell: |
source {{ kolla_ansible_venv_path }}/bin/activate
kolla-ansible octavia-certificates
kolla-ansible octavia-certificates -i {{ kolla_inventory_path }} -vvvv
when: scenario in ['octavia']
args:
executable: /bin/bash
......
......@@ -80,7 +80,15 @@ function prepare_images {
sudo tee -a /etc/kolla/kolla-build.conf <<EOF
[DEFAULT]
engine = ${CONTAINER_ENGINE}
EOF
if [[ $BASE_DISTRO == "debian" || $BASE_DISTRO == "ubuntu" ]]; then
sudo tee -a /etc/kolla/kolla-build.conf <<EOF
base_image = quay.io/openstack.kolla/${BASE_DISTRO}
EOF
fi
sudo tee -a /etc/kolla/kolla-build.conf <<EOF
[profiles]
gate = ${GATE_IMAGES}
EOF
......@@ -88,7 +96,7 @@ EOF
sudo mkdir -p /tmp/logs/build
sudo mkdir -p /opt/kolla_registry
sudo $CONTAINER_ENGINE run -d --net=host -e REGISTRY_HTTP_ADDR=0.0.0.0:4000 --restart=always -v /opt/kolla_registry/:/var/lib/registry --name registry registry:2
sudo $CONTAINER_ENGINE run -d --net=host -e REGISTRY_HTTP_ADDR=0.0.0.0:4000 --restart=always -v /opt/kolla_registry/:/var/lib/registry --name registry quay.io/libpod/registry:2.8.2
python3 -m venv ~/kolla-venv
......
[storage]
{% for host in hostvars %}
{% for host in hostvars | reject('equalto', 'localhost') %}
{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }}
{% endfor %}
......
......@@ -92,6 +92,7 @@ etcd_remove_deleted_members: "yes"
docker_configure_for_zun: "yes"
containerd_configure_for_zun: "yes"
enable_cinder: "yes"
cinder_cluster_skip_precheck: "yes"
# lvm backup driver for cinder-backup does not exist
enable_cinder_backup: "no"
enable_cinder_backend_lvm: "yes"
......@@ -114,6 +115,8 @@ enable_aodh: "yes"
{% if scenario == "ironic" %}
enable_ironic: "yes"
enable_prometheus: "yes"
enable_prometheus_openstack_exporter: "no"
ironic_dnsmasq_dhcp_ranges:
- range: "10.42.0.2,10.42.0.254,255.255.255.0"
{% endif %}
......@@ -149,7 +152,7 @@ enable_redis: "yes"
enable_ceph_rgw: "yes"
ceph_rgw_hosts:
{% for host in hostvars %}
{% for host in hostvars | reject('equalto', 'localhost') %}
- host: {{ host }}
ip: {{ hostvars[host]['ansible_host'] }}
port: 6780
......
......@@ -11,7 +11,7 @@
{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }}
{% endfor %}
{% else %}
{% for host in hostvars %}
{% for host in hostvars | reject('equalto', 'localhost') %}
{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }}
{% endfor %}
{% endif %}
......@@ -31,28 +31,28 @@ control
{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }}
{% endfor %}
{% else %}
{% for host in hostvars %}
{% for host in hostvars | reject('equalto', 'localhost') %}
{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }}
{% endfor %}
{% endif %}
[storage]
{% for host in hostvars %}
{% for host in hostvars | reject('equalto', 'localhost') %}
{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }}
{% endfor %}
[monitoring]
{% for host in hostvars %}
{% for host in hostvars | reject('equalto', 'localhost') %}
{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }}
{% endfor %}
[deployment]
{% for host in hostvars %}
{% for host in hostvars | reject('equalto', 'localhost') %}
{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }}
{% endfor %}
{% if scenario == 'cells' %}
{% for host in hostvars %}
{% for host in hostvars | reject('equalto', 'localhost') %}
{% set cell_name = 'cell' ~ loop.index %}
[{{ cell_name }}]
{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} mariadb_shard_id={{ loop.index0 % 2 }}
......@@ -123,7 +123,7 @@ storage
# In CI we want Pacemaker to run on primary and secondary (to test with HA).
[hacluster]
{% for host in hostvars %}
{% for host in hostvars | reject('equalto', 'localhost') %}
{% if host in ['primary', 'secondary'] %}
{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }}
{% endif %}
......
......@@ -11,7 +11,7 @@ export PYTHONUNBUFFERED=1
function check_certificate_expiry {
RAW_INVENTORY=/etc/kolla/inventory
source $KOLLA_ANSIBLE_VENV_PATH/bin/activate
kolla-ansible octavia-certificates --check-expiry 7
kolla-ansible octavia-certificates -i ${RAW_INVENTORY} --check-expiry 7
deactivate
}
......
......@@ -9,7 +9,7 @@ usedevelop = True
allowlist_externals = bash
find
rm
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.2}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
podman>=4.3.0,<5
......@@ -42,7 +42,7 @@ commands =
[testenv:venv]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.2}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands = {posargs}
......@@ -50,7 +50,7 @@ commands = {posargs}
[testenv:docs]
skip_install = true
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.2}
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build/html
......@@ -97,7 +97,7 @@ setenv =
ANSIBLE_ROLES_PATH = {toxinidir}/ansible/roles
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.2}
-r{toxinidir}/requirements.txt
-r{toxinidir}/lint-requirements.txt
allowlist_externals = bash
......@@ -154,7 +154,7 @@ setenv = {[testenv:linters]setenv}
deps = {[testenv:linters]deps}
commands =
python {toxinidir}/tools/validate-all-file.py
ansible-lint -p --exclude {toxinidir}/tests --exclude {toxinidir}/roles --exclude {toxinidir}/etc
ansible-lint -p --exclude tests --exclude roles --exclude etc --exclude zuul.d
[testenv:yamllint]
deps = {[testenv:linters]deps}
......
......@@ -74,13 +74,19 @@
- zuul: openstack/kolla
- job:
name: kolla-ansible-kvm-base
parent: kolla-ansible-base
voting: false
name: kolla-ansible-scenario-base
files:
- ^requirements-core.yml
- ^ansible/roles/(nova-cell)/
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/(pre|run).yml
- job:
name: kolla-ansible-kvm-base
parent: kolla-ansible-scenario-base
voting: false
files: !inherit
- ^ansible/roles/(nova-cell)/
- ^tests/templates/nova-compute-overrides.j2
vars:
virt_type: kvm
......@@ -102,25 +108,21 @@
- job:
name: kolla-ansible-bifrost-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/bifrost/
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-bifrost.sh
vars:
scenario: bifrost
- job:
name: kolla-ansible-ironic-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/(ironic|neutron|nova|nova-cell)/
- ^tests/deploy-tenks\.sh$
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/templates/ironic-overrides\.j2$
- ^tests/templates/tenks-deploy-config\.yml\.j2$
- ^tests/test-dashboard\.sh$
......@@ -132,13 +134,11 @@
- job:
name: kolla-ansible-zun-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/(zun|kuryr|etcd|cinder|iscsi)/
- ^tests/setup_disks.sh
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-core-openstack.sh
- ^tests/test-zun.sh
- ^tests/test-dashboard.sh
......@@ -147,14 +147,12 @@
- job:
name: kolla-ansible-swift-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/(glance|swift)/
- ^tests/setup_disks.sh
- ^tests/init-swift.sh
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-core-openstack.sh
- ^tests/test-dashboard.sh
- ^tests/test-swift.sh
......@@ -170,12 +168,10 @@
- job:
name: kolla-ansible-magnum-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/(designate|magnum|trove)/
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-dashboard.sh
- ^tests/test-magnum.sh
vars:
......@@ -183,12 +179,10 @@
- job:
name: kolla-ansible-octavia-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/(octavia|octavia-certificates)/
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-dashboard.sh
- ^tests/test-octavia.sh
vars:
......@@ -196,13 +190,11 @@
- job:
name: kolla-ansible-masakari-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/masakari/
- ^ansible/roles/hacluster/
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-masakari.sh
- ^tests/test-dashboard.sh
vars:
......@@ -210,24 +202,20 @@
- job:
name: kolla-ansible-mariadb-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: true
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/mariadb/
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-mariadb.sh
vars:
scenario: mariadb
- job:
name: kolla-ansible-scenario-nfv-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/(aodh|barbican|heat|mistral|redis|tacker)/
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-scenario-nfv.sh
- ^tests/test-dashboard.sh
vars:
......@@ -235,12 +223,10 @@
- job:
name: kolla-ansible-cells-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/nova/
- ^tests/templates/(inventory|globals-default.j2)
- ^ansible/roles/loadbalancer/
- ^tests/test-core-openstack.sh
- ^tests/test-proxysql.sh
......@@ -249,12 +235,10 @@
- job:
name: kolla-ansible-ovn-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/(neutron|octavia|openvswitch|ovn-controller|ovn-db)/
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-ovn.sh
- ^tests/test-core-openstack.sh
- ^tests/reconfigure.sh
......@@ -263,24 +247,20 @@
- job:
name: kolla-ansible-prometheus-opensearch-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/(common|opensearch|grafana|prometheus)/
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-prometheus-opensearch.sh
vars:
scenario: prometheus-opensearch
- job:
name: kolla-ansible-venus-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/(common|opensearch|venus)/
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-venus.sh
vars:
scenario: venus
......@@ -295,19 +275,19 @@
voting: false
files:
- ^requirements-core.yml
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/(pre|run).yml
- ^kolla_ansible/
- ^tests/run-hashi-vault.yml
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-hashicorp-vault-passwords.sh
- job:
name: kolla-ansible-haproxy-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
files: !inherit
- ^ansible/roles/haproxy/
- ^kolla_ansible/kolla_url.py
- ^tests/templates/(inventory|globals-default.j2)
vars:
external_api_interface_name: vxlan2
external_api_network_prefix: "192.0.3."
......@@ -317,13 +297,11 @@
- job:
name: kolla-ansible-lets-encrypt-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/common/templates/conf/input/11-letsencrypt.conf.j2
- ^ansible/roles/(letsencrypt|loadbalancer)/
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-core-openstack.sh
- ^tests/test-dashboard.sh
- ^tests/deploy.sh
......@@ -334,24 +312,20 @@
- job:
name: kolla-ansible-skyline-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
files: !inherit
- ^ansible/roles/skyline/
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-skyline.sh
vars:
scenario: skyline
- job:
name: kolla-ansible-skyline-sso-base
parent: kolla-ansible-base
parent: kolla-ansible-scenario-base
voting: false
files:
- ^requirements-core.yml
- ^ansible/roles/skyline/
- ^tests/templates/(inventory|globals-default.j2)
- ^tests/test-skyline-sso.sh
vars:
scenario: skyline-sso