diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index fc2cb22ff80d28..b1d950154d4612 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -7191,6 +7191,9 @@ def command_adopt_prometheus(ctx, daemon_id, fsid): # type: (CephadmContext, str, str) -> None daemon_type = 'prometheus' (uid, gid) = extract_uid_gid_monitoring(ctx, daemon_type) + # should try to set the ports we know cephadm defaults + # to for these services in the firewall. + ports = Monitoring.port_map['prometheus'] _stop_and_disable(ctx, 'prometheus') @@ -7212,7 +7215,7 @@ def command_adopt_prometheus(ctx, daemon_id, fsid): make_var_run(ctx, fsid, uid, gid) c = get_container(ctx, fsid, daemon_type, daemon_id) - deploy_daemon(ctx, fsid, daemon_type, daemon_id, c, uid, gid) + deploy_daemon(ctx, fsid, daemon_type, daemon_id, c, uid, gid, redeploy=True, ports=ports) update_firewalld(ctx, daemon_type) @@ -7221,6 +7224,9 @@ def command_adopt_grafana(ctx, daemon_id, fsid): daemon_type = 'grafana' (uid, gid) = extract_uid_gid_monitoring(ctx, daemon_type) + # should try to set the ports we know cephadm defaults + # to for these services in the firewall. + ports = Monitoring.port_map['grafana'] _stop_and_disable(ctx, 'grafana-server') @@ -7266,7 +7272,7 @@ def command_adopt_grafana(ctx, daemon_id, fsid): make_var_run(ctx, fsid, uid, gid) c = get_container(ctx, fsid, daemon_type, daemon_id) - deploy_daemon(ctx, fsid, daemon_type, daemon_id, c, uid, gid) + deploy_daemon(ctx, fsid, daemon_type, daemon_id, c, uid, gid, redeploy=True, ports=ports) update_firewalld(ctx, daemon_type) @@ -7275,6 +7281,9 @@ def command_adopt_alertmanager(ctx, daemon_id, fsid): daemon_type = 'alertmanager' (uid, gid) = extract_uid_gid_monitoring(ctx, daemon_type) + # should try to set the ports we know cephadm defaults + # to for these services in the firewall. + ports = Monitoring.port_map['alertmanager'] _stop_and_disable(ctx, 'prometheus-alertmanager') @@ -7296,7 +7305,7 @@ def command_adopt_alertmanager(ctx, daemon_id, fsid): make_var_run(ctx, fsid, uid, gid) c = get_container(ctx, fsid, daemon_type, daemon_id) - deploy_daemon(ctx, fsid, daemon_type, daemon_id, c, uid, gid) + deploy_daemon(ctx, fsid, daemon_type, daemon_id, c, uid, gid, redeploy=True, ports=ports) update_firewalld(ctx, daemon_type)