Files
linguist/samples/Pan/osd-fetch.pan
James Adams 8d178bfaed Improve Pan language support (#3691)
* Add a larger set of sample files for Pan

This is a fairly good cross section of Pan based on code from:
* https://github.com/quattor/template-library-examples
* https://github.com/quattor/template-library-core

* Add Pan language grammar
2017-07-03 18:49:15 +02:00

27 lines
766 B
Plaintext

unique template site/ceph/osdschemas/osd-fetch;
prefix '/software/components/ceph/clusters/ceph';
variable FETCHED_OSDS = {
t = dict();
rep = 2;
foreach(idx; host; CEPH_NODES) {
prof = replace('.data$', '.os', host);
d = value(format('%s:/software/components/ceph/localdaemons/osds', prof));
t[shorten_fqdn(host)] = dict(
'fqdn', host,
'osds', d
);
numosd = length(d);
if (numosd > rep){
rep = numosd;
};
};
all = dict('osdhosts', t, 'maxosd', rep);
};
'osdhosts' = FETCHED_OSDS['osdhosts'];
variable CEPH_OSD_DOWN_REPORTERS ?= FETCHED_OSDS['maxosd'] + 2;
variable CEPH_OSD_DOWN_REPORTS ?= CEPH_OSD_DOWN_REPORTERS + CEPH_OSD_DOWN_REPORTERS / 4 + 1;