Examples:
Configures and install csync2 and also uses a preinstalled certificate and private key. Also a cronjob is needed to trigger the sync:
include csync2
cron { 'csync2':
command => "${::csync2::globals::csync2_bin} -x",
user => 'root',
}
The management of certificate and private key.
class { 'csync2':
ssl_cert => '-----BEGIN CERTIFICATE----- ...',
ssl_key => '----BEGIN RSA PRIVATE KEY----- ...',
}
Create two groups to sync. For more details have a look at defined resource ‘group’.
class { 'csync2':
groups => {
'cluster' => {
hosts => ['node1.example.org', 'node2.example.org'],
blocks => [{
'includes' => [ '/etc/csync2.cfg' ],
}],
key => 'supersecret',
},
'monitoring' => {
hosts => ['node1.example.org', 'node2.example.org'],
blocks => [{
'includes' => [ '/etc/icingaweb2' ],
'excludes' => [ '/etc/icingaweb2/modules/director', '/etc/icingaweb2/enabledModules/director' ],
}],
key => 'supersecret',
},
},
}