aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWill Szumski <will@stackhpc.com>2023-09-08 16:31:35 +0000
committerMichal Nasiadka <mnasiadka@gmail.com>2023-11-07 14:52:06 +0000
commit37c2ab2aaafa06b40ba1c32a29699fbd8ee17b87 (patch)
treea80327245804c03c20d2cdbfc2781c9bbe5447f9 /tests
parent1235c7253d2e29d089aa2810f9db6fab5b45121f (diff)
downloadkolla-ansible-37c2ab2aaafa06b40ba1c32a29699fbd8ee17b87.tar.gz
kolla-ansible-37c2ab2aaafa06b40ba1c32a29699fbd8ee17b87.zip
Support exposing prometheus_server externally
This avoids the need to use a proxy, or some other means, to connect to Prometheus. This is disabled by default and can be enabled by setting enable_prometheus_server_external to true. Change-Id: Ia0af044ff436c2a204b357750a16ff49fcdfec45
Diffstat (limited to 'tests')
-rwxr-xr-xtests/j2lint.py4
-rw-r--r--tests/run-hashi-vault.yml6
-rwxr-xr-xtests/test-prometheus-opensearch.sh3
3 files changed, 11 insertions, 2 deletions
diff --git a/tests/j2lint.py b/tests/j2lint.py
index 65189c38f..d9cc6e8bf 100755
--- a/tests/j2lint.py
+++ b/tests/j2lint.py
@@ -23,6 +23,7 @@ Simple j2 linter, useful for checking jinja2 template syntax
Adapted for OpenStack Kolla/Kolla-Ansible purposes
"""
+from ansible.plugins.filter.core import get_encrypted_password
from ansible.plugins.filter.core import to_json
from functools import reduce
from jinja2 import BaseLoader
@@ -51,6 +52,9 @@ def check(template, out, err, env=Environment(loader=AbsolutePathLoader(),
env.filters['bool'] = bool
env.filters['hash'] = hash
env.filters['to_json'] = to_json
+ # NOTE(wszumski): password_hash is mapped to the function:
+ # get_encrypted_password in ansible.filters.core.
+ env.filters['password_hash'] = get_encrypted_password
env.filters['kolla_address'] = kolla_address
env.filters['put_address_in_context'] = put_address_in_context
env.get_template(template)
diff --git a/tests/run-hashi-vault.yml b/tests/run-hashi-vault.yml
index 2fa79663b..cbeb4aa15 100644
--- a/tests/run-hashi-vault.yml
+++ b/tests/run-hashi-vault.yml
@@ -36,10 +36,12 @@
- name: install kolla-ansible and dependencies
pip:
- name:
- - "{{ kolla_ansible_src_dir }}"
executable: "pip3"
extra_args: "-c {{ upper_constraints_file }} --user"
+ name:
+ - "{{ kolla_ansible_src_dir }}"
+ - "ansible-core{{ ansible_core_version_constraint }}"
+ - "ansible{{ ansible_version_constraint }}"
- name: copy passwords.yml file
copy:
diff --git a/tests/test-prometheus-opensearch.sh b/tests/test-prometheus-opensearch.sh
index 9ce8a7663..c1f8272c1 100755
--- a/tests/test-prometheus-opensearch.sh
+++ b/tests/test-prometheus-opensearch.sh
@@ -79,11 +79,14 @@ function check_prometheus {
# Query prometheus graph, and check that the returned page looks like a
# prometheus page.
PROMETHEUS_URL=${OS_AUTH_URL%:*}:9091/graph
+ prometheus_password=$(awk '$1 == "prometheus_password:" { print $2 }' /etc/kolla/passwords.yml)
output_path=$1
args=(
--include
--location
--fail
+ --user
+ admin:$prometheus_password
)
if [[ "$TLS_ENABLED" = "True" ]]; then
args+=(--cacert $OS_CACERT)