Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bz2242346 prometheus port (backport #7613) #7614

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions infrastructure-playbooks/cephadm-adopt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
- (health_detail.stdout | default('{}', True) | from_json)['status'] == "HEALTH_WARN"
- "'POOL_APP_NOT_ENABLED' in (health_detail.stdout | default('{}', True) | from_json)['checks']"

- import_role:

Check warning on line 109 in infrastructure-playbooks/cephadm-adopt.yml

View workflow job for this annotation

GitHub Actions / build

jinja[spacing]

Jinja2 spacing could be improved: groups.get((grafana_server_group_name|default('grafana-server')), []) | length > 0 -> groups.get((grafana_server_group_name | default('grafana-server')), []) | length > 0
name: ceph-facts
tasks_from: convert_grafana_server_group_name.yml
when: groups.get((grafana_server_group_name|default('grafana-server')), []) | length > 0
Expand Down Expand Up @@ -495,7 +495,7 @@

- name: set_fact mirror_peer_found
set_fact:
mirror_peer_uuid: "{{ ((mirror_pool_info.stdout | default('{}') | from_json)['peers'] | selectattr('site_name', 'match', '^'+ceph_rbd_mirror_remote_cluster+'$') | map(attribute='uuid') | list) }}"

Check warning on line 498 in infrastructure-playbooks/cephadm-adopt.yml

View workflow job for this annotation

GitHub Actions / build

jinja[spacing]

Jinja2 spacing could be improved: {{ ((mirror_pool_info.stdout | default('{}') | from_json)['peers'] | selectattr('site_name', 'match', '^'+ceph_rbd_mirror_remote_cluster+'$') | map(attribute='uuid') | list) }} -> {{ ((mirror_pool_info.stdout | default('{}') | from_json)['peers'] | selectattr('site_name', 'match', '^' + ceph_rbd_mirror_remote_cluster + '$') | map(attribute='uuid') | list) }}

- name: remove current rbd mirror peer, add new peer into mon config store
when: mirror_peer_uuid | length > 0
Expand All @@ -520,7 +520,7 @@
loop: "{{ (quorum_status.stdout | default('{}') | from_json)['monmap']['mons'] }}"
run_once: true

- name: remove current mirror peer

Check warning on line 523 in infrastructure-playbooks/cephadm-adopt.yml

View workflow job for this annotation

GitHub Actions / build

jinja[spacing]

Jinja2 spacing could be improved: {{ admin_rbd_cmd }} mirror pool peer remove {{ ceph_rbd_mirror_pool }} {{ ((mirror_pool_info.stdout | default('{}') | from_json)['peers'] | selectattr('site_name', 'match', '^'+ceph_rbd_mirror_remote_cluster+'$') | map(attribute='uuid') | list)[0] }} -> {{ admin_rbd_cmd }} mirror pool peer remove {{ ceph_rbd_mirror_pool }} {{ ((mirror_pool_info.stdout | default('{}') | from_json)['peers'] | selectattr('site_name', 'match', '^' + ceph_rbd_mirror_remote_cluster + '$') | map(attribute='uuid') | list)[0] }}
command: "{{ admin_rbd_cmd }} mirror pool peer remove {{ ceph_rbd_mirror_pool }} {{ ((mirror_pool_info.stdout | default('{}') | from_json)['peers'] | selectattr('site_name', 'match', '^'+ceph_rbd_mirror_remote_cluster+'$') | map(attribute='uuid') | list)[0] }}"
delegate_to: "{{ groups.get(mon_group_name | default('mons'))[0] }}"
changed_when: false
Expand Down Expand Up @@ -1517,8 +1517,8 @@
environment:
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'

- name: with dashboard enabled
when: dashboard_enabled | bool
- name: With dashboard enabled
when: dashboard_enabled | bool and groups.get(monitoring_group_name, []) | length > 0
block:
- name: Update the placement of alertmanager hosts
ceph_orch_apply:
Expand All @@ -1528,6 +1528,7 @@
service_id: "{{ ansible_facts['hostname'] }}"
placement:
label: "{{ monitoring_group_name }}"
count: "{{ groups.get(monitoring_group_name, []) | length }}"
{% if grafana_server_addr is defined %}
networks:
- {{ grafana_server_addr }}
Expand All @@ -1542,8 +1543,19 @@
environment:
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'

- name: update the placement of prometheus hosts
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply prometheus --placement='{{ groups.get(monitoring_group_name, []) | length }} label:{{ monitoring_group_name }}'"
- name: Update the placement of prometheus hosts
ceph_orch_apply:
fsid: "{{ fsid }}"
spec: |
service_name: prometheus
service_id: "{{ ansible_facts['hostname'] }}"
placement:
label: {{ monitoring_group_name }}
count: {{ groups.get(monitoring_group_name, []) | length }}
{% if prometheus_port is defined and prometheus_port != 9095 %}
spec:
port: {{ prometheus_port }}
{% endif %}
changed_when: false
environment:
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
Expand Down
Loading