AideMemoire: Difference between revisions

From T2B Wiki
Jump to navigation Jump to search
m (Created page with " === How to use ncm-metaconfig ? === The official documentation can be found [https://github.com/quattor/configuration-modules-core/blob/master/ncm-metaconfig/src/main/perl/m...")
 
Line 3: Line 3:
The official documentation can be found [https://github.com/quattor/configuration-modules-core/blob/master/ncm-metaconfig/src/main/perl/metaconfig.pod here].
The official documentation can be found [https://github.com/quattor/configuration-modules-core/blob/master/ncm-metaconfig/src/main/perl/metaconfig.pod here].


Here is an example ready to be included into a machine profile for test purposes :
<pre>
# 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');
</pre>




{{TracNotice|{{PAGENAME}}}}
{{TracNotice|{{PAGENAME}}}}

Revision as of 14:11, 2 August 2016

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');


Template:TracNotice