openstack-operator/playbooks/functional/tests/rabbitmq.yaml

42 lines
1.5 KiB
YAML
Executable File

---
# Copyright (c) 2020 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create Rabbitmq custom resource
command: kubectl apply -f {{ zuul.project.src_dir }}/config/samples/infrastructure_v1alpha1_rabbitmq.yaml
- name: Wait for all pods to become Ready
include_role:
name: wait-for-pods
- name: Get all pod IPs for Rabbitmq
command: kubectl get pods -l app.kubernetes.io/name=rabbitmq,app.kubernetes.io/instance=sample -o=jsonpath='{range .items[*]}{.status.podIP}{"\n"}{end}'
register: _rabbitmq_ips
until: _rabbitmq_ips is success
retries: 10
delay: 5
failed_when: "{{ _rabbitmq_ips.stdout_lines | length == 0 }}"
- name: Send request to Rabbitmq exporter
uri:
url: "http://{{ item }}:15692/metrics"
return_content: yes
register: _metrics
loop: "{{ _rabbitmq_ips.stdout_lines }}"
until: _metrics is success
retries: 10
delay: 5
failed_when: "'rabbitmq_erlang_uptime_seconds' not in _metrics.content"