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
This commit is contained in:
James Adams
2017-07-03 17:49:15 +01:00
committed by Paul Chaignon
parent e9ec699931
commit 8d178bfaed
23 changed files with 646 additions and 1 deletions

26
samples/Pan/osd-fetch.pan Normal file
View File

@@ -0,0 +1,26 @@
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;