From c6106e6442e1ba2bdbbe625beb014694a37d7a34 Mon Sep 17 00:00:00 2001 From: Adam King Date: Sun, 5 Nov 2023 16:07:53 -0500 Subject: [PATCH] doc/cephadm: document regex based host pattern Signed-off-by: Adam King (cherry picked from commit 62bd0b9368d4a53b15d9ecb665444dd943dbcfcf) --- doc/cephadm/services/index.rst | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/doc/cephadm/services/index.rst b/doc/cephadm/services/index.rst index 32ad90b20b008..1ffe3ea8f39c3 100644 --- a/doc/cephadm/services/index.rst +++ b/doc/cephadm/services/index.rst @@ -347,7 +347,9 @@ Or in YAML: Placement by pattern matching ----------------------------- -Daemons can be placed on hosts as well: +Daemons can be placed on hosts using a host pattern as well. +By default, the host pattern is matched using fnmatch which supports +UNIX shell-style wildcards (see https://docs.python.org/3/library/fnmatch.html): .. prompt:: bash # @@ -375,6 +377,26 @@ Or in YAML: placement: host_pattern: "*" +The host pattern also has support for using a regex. To use a regex, you +must either add "regex: " to the start of the pattern when using the +command line, or specify a ``pattern_type`` field to be "regex" +when using YAML. + +On the command line: + +.. prompt:: bash # + + ceph orch apply prometheus --placement='regex:FOO[0-9]|BAR[0-9]' + +In YAML: + +.. code-block:: yaml + + service_type: prometheus + placement: + host_pattern: + pattern: 'FOO[0-9]|BAR[0-9]' + pattern_type: regex Changing the number of daemons ------------------------------ -- 2.39.5