Configuration

Group


As mentioned in the section dealing with client configuration files, a client can be a member of multiple groups. The client inherits the collection of resources defined in group (in addition to those defined in its own configuration file). Some more detail on the relationships between clients and groups can be found in the concepts section.

In general resources that apply to multiple clients are suitable to be consolidated in a group. For instance when clients share the same set of entries in the /etc/hosts file via the host resource. Groups are thus the preferred way of de-duplicating resources in Pullconf.

Similar to the client configuration a group is just a file. The name of the file determines the group name.

To create a group add a file $PULLCONF_RESOURCE_DIR/groups/$group_name.toml on the server, replacing $group_name with the desired name.

For instance if

then the corresponding group configuration file must be created at /etc/pullconfd/resources/groups/ssh.toml.

Refer to the client configuration section for valid group names. Group names must follow the same rules as hostnames/client names.

The TOML files in $PULLCONF_RESOURCE_DIR/groups must adhere to this format:

	    
[[resources]]
...

[[resources]]
...
	    
	  

As you can see it is almost identical to a client configuration file. While clients require some top-level keys (e.g. api-key), groups are in fact just collections of resources.

The [[resources]] key is a TOML array-of-tables that defines various resources.

After the group file is created and every time it is modified a reload of pullconfd is required to re-read the configuration files.

$ sudo systemctl reload pullconfd.service

To get a better sense of the structure of a common group configuration file, refer to the following example:

Example of a configuration file

	    
# some `host` resource
[[resources]]
type = "host"
ensure = "present"
ip-address = "192.168.1.55"
hostname = "webserver"
aliases = [ "webserver.local" ]

# some `file` resource
[[resources]]
type = "file"
ensure = "present"
path = "/etc/logrotate.d/apt"
# download from `pullconfd`
source = "/common/logrotate.d/apt"