Configuration

Client


Once pullconf is installed on the client system a client configuration file must be created on the server. This makes the client known to the server and pullconf can successfully connect to pullconfd.

First create a file $PULLCONF_RESOURCE_DIR/clients/$hostname.toml on the server. Here $hostname matches the output from running $ hostname --fqdn on the client.

For instance if

then the corresponding client configuration file must be created at /etc/pullconfd/resources/clients/my.example.com.toml.

Also note that a valid hostname:

Each client configuration file in $PULLCONF_RESOURCE_DIR/clients must adhere to this format in TOML:

	    
api-key = "<string>"
groups = [ "<group>", "<group>" ... ]

[variables]
...

[[resources]]
...

[[resources]]
...
	    
	  

After defining at least api-key, save the file and reload the server:

$ sudo systemctl reload pullconfd.service

The next time the pullconf.timer on the client executes pullconf.service, it will successfully connect to pullconfd, because the server is now able to identify the client by means of its API key and hostname.

To get a better sense of the structure of a common client configuration file, refer to the example below.

Example of a configuration file

	    
# general settings
api-key = "50d858e0985ecc7f60418aaf0cc5ab587f42c2570a884095a9e8ccacd0f6545c"
groups = [ "linux", "debian", "nginx", "ssh" ]

[variables]
my-ip-address = "192.168.1.55"

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

# some `file` resource
[[resources]]
type = "file"
ensure = "present"
path = "/etc/logrotate.d/apt"
content = """
/var/log/apt/term.log {
  rotate 12
  monthly
  compress
  missingok
  notifempty
}

/var/log/apt/history.log {
  rotate 12
  monthly
  compress
  missingok
  notifempty
}
"""