From e0b7d325db7d8b5cceb2c7edd7eb6c0d7cc61c0a 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 82f83bfac8e..c1da5d15f89 100644 --- a/doc/cephadm/services/index.rst +++ b/doc/cephadm/services/index.rst @@ -357,7 +357,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 # @@ -385,6 +387,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