Add observability_data_only condition to node-exporter component

There are use cases where we'd like to take advantage of the unified
monitoring model in openstack, and the ceph cluster should provide a
set of deployed node exporters, but leave the data collection job to
a different component.
This patch introduces a new condition to allow a partial deployment
of the ceph monitoring stack: only node-exporter(s) are deployed
everywhere, but prometheus/grafana/alertmanager are skipped.

Change-Id: Ia1723394dae5ed03e50f2a236eb808f234e63331
This commit is contained in:
Francesco Pantano 2022-08-23 14:02:44 +02:00
parent a895c7ee94
commit 7974419c27
2 changed files with 21 additions and 16 deletions

View File

@ -35,6 +35,7 @@ tripleo_cephadm_mode: "0755"
tripleo_cephadm_keyring_permissions: "0644"
tripleo_ceph_client_config_home: "/etc/ceph"
tripleo_cephadm_dashboard_enabled: false
tripleo_cephadm_observability_data_only: false
tripleo_cephadm_wait_for_mons: true
tripleo_cephadm_wait_for_mons_retries: 10
tripleo_cephadm_wait_for_mons_delay: 20

View File

@ -14,6 +14,23 @@
# License for the specific language governing permissions and limitations
# under the License.
- name: Apply node-exporter(s)
become: true
ceph_mkspec:
service_type: "node-exporter"
service_id: "node-exporter"
service_name: "node-exporter"
cluster: "{{ tripleo_cephadm_cluster }}"
apply: true
host_pattern: "*"
render_path: "{{ tripleo_cephadm_spec_home }}"
networks: "{{ tripleo_cephadm_monitoring_address_block }}"
environment:
CEPH_CONTAINER_IMAGE: "{{ tripleo_cephadm_container_ns + '/' + tripleo_cephadm_container_image + ':' + tripleo_cephadm_container_tag }}"
CEPH_CONTAINER_BINARY: "{{ tripleo_cephadm_container_cli }}"
when: tripleo_cephadm_dashboard_enabled | default(false) | bool or
tripleo_cephadm_observability_data_only | default(false) | bool
- name: Build and apply the monitoring stack daemons
block:
# Using two tasks with a boolean due to the ansible bug: https://github.com/ansible/ansible/issues/68364
@ -29,21 +46,6 @@
with_items: "{{ groups['ceph_mgr'] }}"
when: not tripleo_cephadm_fqdn | bool
- name: Apply node-exporter(s)
become: true
ceph_mkspec:
service_type: "node-exporter"
service_id: "node-exporter"
service_name: "node-exporter"
cluster: "{{ tripleo_cephadm_cluster }}"
apply: true
host_pattern: "*"
render_path: "{{ tripleo_cephadm_spec_home }}"
networks: "{{ tripleo_cephadm_monitoring_address_block }}"
environment:
CEPH_CONTAINER_IMAGE: "{{ tripleo_cephadm_container_ns + '/' + tripleo_cephadm_container_image + ':' + tripleo_cephadm_container_tag }}"
CEPH_CONTAINER_BINARY: "{{ tripleo_cephadm_container_cli }}"
- name: Config ssl cert(s) and key(s) for the exposed components
become: true
block:
@ -82,7 +84,9 @@
- {"daemon": "grafana", "port": "{{ tripleo_cephadm_grafana_port | default(3100) }}"}
- {"daemon": "prometheus", "port": "{{ tripleo_cephadm_prometheus_port | default(9092) }}"}
- {"daemon": "alertmanager", "port": "{{ tripleo_cephadm_alertmanager_port | default(9093) }}"}
when: tripleo_cephadm_dashboard_enabled | bool
when:
- tripleo_cephadm_dashboard_enabled | default(false) | bool
- not tripleo_cephadm_observability_data_only | default(false) | bool
- include_tasks: dashboard/dashboard.yaml
when: tripleo_cephadm_dashboard_enabled | bool