AideMemoire
How to use ncm-metaconfig ?
The official documentation can be found here.
Here is an example ready to be included into a machine profile for test purposes :
# first, you need to deploy the tt file on the machine # (the standard way is to include tt files in the the ncm-metaconfig rpm....) variable CONTENTS = <<EOF; name = { [% FILTER indent -%] hosts = [% hosts.join(',') %] port = [% port %] master = [% master ? "TRUE" : "FALSE" %] description = "[% description %]" [% IF option.defined -%] option = "[% option %]" [% END -%] [% END -%] } EOF '/software/components/filecopy/services' = npush( escape('/usr/share/templates/quattor/metaconfig/example/main.tt'), nlist('config', CONTENTS, 'perms', '0644') ); # below, the real metaconfig work include 'components/metaconfig/config'; include 'metaconfig/example/config'; prefix '/software/components/metaconfig/services/{/etc/example/exampled.conf}/contents'; 'hosts' = list('server1', 'server3'); 'port' = 800; 'master' = false; 'description' = 'My example'; # the tt file must be created before ncm-metaconfig runs '/software/components/metaconfig/dependencies/pre' = push('filecopy');