Debian Codegraph @

doc/man/man5/groups.conf.5

raw
1 .\" Man page generated from reStructuredText.
2 .
3 .
4 .nr rst2man-indent-level 0
5 .
6 .de1 rstReportMargin
7 \\$1 \\n[an-margin]
8 level \\n[rst2man-indent-level]
9 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10 -
11 \\n[rst2man-indent0]
12 \\n[rst2man-indent1]
13 \\n[rst2man-indent2]
14 ..
15 .de1 INDENT
16 .\" .rstReportMargin pre:
17 . RS \\$1
18 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19 . nr rst2man-indent-level +1
20 .\" .rstReportMargin post:
21 ..
22 .de UNINDENT
23 . RE
24 .\" indent \\n[an-margin]
25 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26 .nr rst2man-indent-level -1
27 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29 ..
30 .TH "GROUPS.CONF" 5 "2026-07-16" "1.10.1" "ClusterShell User Manual"
31 .SH NAME
32 groups.conf \- Configuration file for ClusterShell node groups
33 .SH DESCRIPTION
34 .sp
35 The ClusterShell library obtains its node groups configuration from the
36 following sources, in decreasing order of precedence:
37 .INDENT 0.0
38 .INDENT 3.5
39 .INDENT 0.0
40 .IP 1. 3
41 \fI$CLUSTERSHELL_CFGDIR/groups.conf\fP (only used when $CLUSTERSHELL_CFGDIR
42 is defined)
43 .IP 2. 3
44 user configuration file (\fI$XDG_CONFIG_HOME/clustershell/groups.conf\fP,
45 defaults to \fI$HOME/.config/clustershell/groups.conf\fP)
46 .IP 3. 3
47 Python virtual environment (\fI{sys.prefix}/etc/clustershell/groups.conf\fP)
48 .IP 4. 3
49 local pip user installation (\fI$HOME/.local/etc/clustershell/groups.conf\fP)
50 .IP 5. 3
51 system\-wide configuration file (\fI/etc/clustershell/groups.conf\fP)
52 .UNINDENT
53 .UNINDENT
54 .UNINDENT
55 .sp
56 For each parameter, the first obtained value will be used. If no \fIgroups.conf\fP
57 is found, group support will be disabled.
58 .sp
59 Additional configuration files are also read from the directories set by the
60 confdir option, if present. See the \fBconfdir\fP option below for further
61 details.
62 .sp
63 Configuration files have a format in the style of RFC 822 potentially composed
64 of several sections which may be present in any order. There are two types of
65 sections: Main and \fIGroup_source\fP:
66 .INDENT 0.0
67 .TP
68 .B Main
69 Global configuration options. There should be only one Main section.
70 .TP
71 .B \fIGroup_source\fP
72 The \fIGroup_source\fP section(s) define the configuration for each node group
73 source (or namespace). This configuration consists of external command
74 definitions (map, mapall, all, list and reverse).
75 .UNINDENT
76 .sp
77 Only \fIGroup_source\fP section(s) are allowed in additional configuration files.
78 .SS [Main] OPTIONS
79 .sp
80 Configuration parameters of the \fBMain\fP section are described below.
81 .INDENT 0.0
82 .TP
83 .B default
84 Specify the default group source (group namespace) used by the NodeSet parser
85 when the user does not explicitly specify the group source (e.g. \(dq@io\(dq).
86 .TP
87 .B confdir
88 Optional list of directories where the ClusterShell library should look for
89 \fB\&.conf\fP files which define group sources to use. Each file in these
90 directories with the .conf suffix should contain one or more \fIGroup_source\fP
91 sections as documented in [\fIGroup_source\fP] options below. These will be merged
92 with the group sources defined in \fI/etc/clustershell/groups.conf\fP to form the
93 complete set of group sources that ClusterShell will use. Duplicate
94 \fIGroup_source\fP sections are not allowed. Note: .conf files that are not
95 readable by the current user are ignored (except the one that defines the
96 default group source). The variable \fI$CFGDIR\fP is replaced by the path of the
97 highest priority configuration directory found (where groups.conf resides).
98 The default confdir value enables both system\-wide and any installed user
99 configuration (thanks to \fI$CFGDIR\fP). Duplicate directory paths are ignored.
100 \fBgroupsdir\fP is accepted as an alias for \fBconfdir\fP and takes precedence
101 when both are defined.
102 .TP
103 .B autodir
104 Optional list of directories where the ClusterShell library should look for
105 \fB\&.yaml\fP files that define in\-file group dictionaries. No need to call
106 external commands for these files, they are parsed by the ClusterShell library
107 itself. Multiple group source definitions in the same file are supported. The
108 variable \fI$CFGDIR\fP is replaced by the path of the highest priority
109 configuration directory found (where groups.conf resides). The default
110 autodir value enables both system\-wide and any installed user configuration
111 (thanks to \fI$CFGDIR\fP). Duplicate directory paths are ignored.
112 .UNINDENT
113 .SS [\fIGroup_source\fP] OPTIONS
114 .sp
115 Configuration parameters of each group source section are described below.
116 .INDENT 0.0
117 .TP
118 .B map
119 Specify the external shell command used to resolve a group name into a
120 nodeset, list of nodes or list of nodeset (separated by space characters or
121 by carriage returns). The variable \fI$GROUP\fP is replaced before executing the
122 command. Either \fBmap\fP or \fBmapall\fP must be defined.
123 .TP
124 .B mapall
125 Optional external shell command that should return all group\-to\-nodes
126 mappings for this group source in a single call, one \fIgroup: nodes\fP line
127 per group. Useful when the source can dump all its groups at once (e.g.
128 with \fIsinfo\fP or \fIansible\-inventory \-\-list\fP), as a single call then serves
129 both \fBmap\fP and \fBlist\fP queries from the cache. \fBmapall\fP output takes
130 precedence over the \fBlist\fP upcall. If \fBmap\fP is also defined, it is
131 used as a fallback for groups missing from the \fBmapall\fP output (or all
132 groups if caching is disabled); otherwise, missing groups resolve to an
133 empty nodeset.
134 The first \fB:\fP on each line separates the group name from the nodes, so
135 group names must be single words without \fB:\fP\&. Duplicate group lines are
136 merged. A malformed output line makes the whole \fBmapall\fP call fail
137 (nothing is cached and the next query retries), and a failing \fBmapall\fP
138 command does not fall back to \fBmap\fP\&.
139 .TP
140 .B all
141 Optional external shell command that should return a nodeset, list of
142 nodes or list of nodeset of all nodes for this group source. If not
143 specified, the library will try to resolve all nodes by using the \fBlist\fP
144 external command in the same group source followed by \fBmap\fP for each group.
145 .TP
146 .B list
147 Optional external shell command that should return the list of all groups
148 for this group source (separated by space characters or by carriage
149 returns). Not used when \fBmapall\fP is defined, unless caching is disabled.
150 .TP
151 .B reverse
152 Optional external shell command used to find the group(s) of a single
153 node. The variable $NODE is replaced beforehand. If this upcall is not
154 specified, the reverse operation is computed in memory by the library from
155 the \fIlist\fP and \fImap\fP external calls. Also, if the number of nodes to
156 reverse is greater than the number of available groups, the \fIreverse\fP
157 external command is avoided automatically.
158 .TP
159 .B cache_time
160 Number of seconds each upcall result is kept in cache, in memory only.
161 Default is 3600 seconds. This is useful only for daemons using nodegroups.
162 .UNINDENT
163 .sp
164 When the library executes a group source external shell command, the current
165 working directory is set beforehand to the corresponding confdir. This
166 allows the use of relative paths for third party files in the command. The
167 command\(aqs standard input is connected to \fI/dev/null\fP\&.
168 .sp
169 In addition to context\-dependent $GROUP and $NODE variables described above, the
170 two following variables are always available and also replaced before executing
171 shell commands:
172 .INDENT 0.0
173 .IP \(bu 2
174 \fI$CFGDIR\fP is replaced by groups.conf highest priority base directory path
175 .IP \(bu 2
176 \fI$SOURCE\fP is replaced by current source name
177 .UNINDENT
178 .sp
179 Each external command might return a non\-zero return code when the operation
180 is not doable. But if the call returns zero, for instance, for a non\-existing
181 group, the user will not receive any error when trying to resolve such an
182 unknown group. The desired behavior is up to the system administrator.
183 .SH RESOURCE USAGE
184 .sp
185 All external command results are cached in memory to avoid multiple calls. Each
186 result is kept for a limited amount of time. See cache_time option to tune
187 this behavior.
188 .SH EXAMPLES
189 .sp
190 Simple configuration file for local groups and Slurm partitions binding.
191 .SS \fIgroups.conf\fP
192 .nf
193 [Main]
194 default: local
195 confdir: /etc/clustershell/groups.conf.d $CFGDIR/groups.conf.d
196 autodir: /etc/clustershell/groups.d $CFGDIR/groups.d
197
198 [local]
199 map: sed \-n \(aqs/^$GROUP:\e(.*\e)/\e1/p\(aq /etc/clustershell/groups
200 list: sed \-n \(aqs/^\e([0\-9A\-Za\-z_\-]*\e):.*/\e1/p\(aq /etc/clustershell/groups
201
202 [slurm]
203 map: sinfo \-h \-o \(dq%N\(dq \-p $GROUP
204 all: sinfo \-h \-o \(dq%N\(dq
205 list: sinfo \-h \-o \(dq%P\(dq
206 reverse: sinfo \-h \-N \-o \(dq%P\(dq \-n $NODE
207 .fi
208 .sp
209 .SH FILES
210 .INDENT 0.0
211 .TP
212 .B \fI$CLUSTERSHELL_CFGDIR/groups.conf\fP (defaults to \fI/etc/clustershell/groups.conf\fP)
213 Global node groups configuration file.
214 .TP
215 .B \fI$CLUSTERSHELL_CFGDIR/groups.conf.d/\fP (defaults to \fI/etc/clustershell/groups.conf.d/\fP)
216 Recommended directory for additional configuration files.
217 .TP
218 .B \fI$CLUSTERSHELL_CFGDIR/groups.d/\fP (defaults to \fI/etc/clustershell/groups.d/\fP)
219 Recommended directory for \fIautodir\fP, where native group definition files
220 (.yaml files) are found.
221 .TP
222 .B \fI$XDG_CONFIG_HOME/clustershell/groups.conf\fP
223 Main user groups.conf configuration file. If $XDG_CONFIG_HOME is not defined,
224 \fI$HOME/.config/clustershell/groups.conf\fP is used instead.
225 .TP
226 .B \fI{sys.prefix}/etc/clustershell/groups.conf\fP
227 Configuration file when ClusterShell is installed in a Python virtual
228 environment.
229 .TP
230 .B \fI$HOME/.local/etc/clustershell/groups.conf\fP
231 Local groups.conf user configuration file (default installation for pip \-\-user)
232 .UNINDENT
233 .SH SEE ALSO
234 .sp
235 \fBclubak\fP(1), \fBcluset\fP(1), \fBclush\fP(1), \fBnodeset\fP(1)
236 .sp
237 \fI\%https://clustershell.readthedocs.io/\fP
238 .SH AUTHOR
239 Stephane Thiell
240 .SH COPYRIGHT
241 GNU Lesser General Public License version 2.1 or later (LGPLv2.1+)
242 .\" Generated by docutils manpage writer.
243 .