From f1659bc30e9e1292520858c42154366119b5a346 Mon Sep 17 00:00:00 2001 From: James Adams Date: Mon, 12 Jun 2017 10:10:26 +0100 Subject: [PATCH] Trim lint from examples * Add missing component dependencies * Add missing spaces after semicolons * Ensure all files use unix line-endings * Fix whitespace around operators * Reflow indentation in all templates * Remove curly braces from include statements * Remove trailing slashes from left hand paths * Remove whitespace before commas * Remove whitespace before semicolons * Replace nlists with dicts * Replace tabs with spaces * Strip trailing whitespace * Use file_contents modernise nagios apache config example * Use filecontents to include bash scripts rather than HEREDOC * Use format strings to generate all repository URLs * Use format strings to replace to_string where possible --- .../umd4/profiles/se-dpm-disk.example.org.pan | 2 +- .../profiles/se-dpm-disk2.example.org.pan | 2 +- .../profiles/se-dpm-server.example.org.pan | 3 +- .../grid/umd4/profiles/ui.example.org.pan | 12 +- clusters/grid/umd4/site/cluster_info.pan | 2 +- clusters/misc/nagios/repository/config.pan | 7 +- clusters/misc/nagios/site/cluster_info.pan | 4 +- non-grid/basic/common/opennebula/common.pan | 13 +- non-grid/basic/common/opennebula/mysql.pan | 9 +- non-grid/basic/common/opennebula/node.pan | 19 +- non-grid/basic/common/opennebula/one_auth.pan | 2 + non-grid/basic/common/opennebula/oneadmin.pan | 2 +- sites/example/drivers/dell_openmanage.pan | 127 +++--- .../drivers/dell_openmanage_sas_driver.sh | 6 + .../hardware/machine/200/48/Dell2/32.pan | 27 +- .../hardware/machine/200/48/Dell2/33.pan | 27 +- .../hardware/machine/200/48/Dell2/34.pan | 27 +- .../hardware/machine/200/48/Dell2/35.pan | 27 +- .../hardware/machine/200/48/Dell2/36.pan | 27 +- .../hardware/machine/200/48/Dell2/37.pan | 27 +- .../hardware/machine/200/48/Dell2/38.pan | 27 +- .../hardware/machine/200/48/Dell2/39.pan | 27 +- .../hardware/machine/200/48/Dell2/40.pan | 27 +- .../hardware/machine/200/48/Dell2/41.pan | 27 +- .../hardware/machine/200/48/Dell2/42.pan | 27 +- .../hardware/machine/200/48/Dell2/43.pan | 29 +- .../hardware/machine/200/48/Dell2/44.pan | 27 +- .../hardware/machine/200/49/Hp1/30.pan | 22 +- .../hardware/machine/200/49/Hp1/31.pan | 22 +- .../hardware/machine/200/49/Hp1/32.pan | 22 +- .../hardware/machine/200/49/Hp1/33.pan | 22 +- .../hardware/machine/200/49/Hp1/34.pan | 20 +- .../hardware/machine/200/49/Ibm1/39.pan | 31 +- .../hardware/machine/200/49/Ibm1/40.pan | 31 +- .../hardware/machine/200/49/Ibm1/41.pan | 31 +- .../hardware/machine/200/49/Ibm1/42.pan | 31 +- .../hardware/machine/200/49/Ibm1/43.pan | 31 +- .../machine/one/base_not_so_small.pan | 19 +- sites/example/hardware/machine/xen/base.pan | 6 +- sites/example/machine-types/ceph-server.pan | 13 +- .../example/machine-types/example/se_dpm.pan | 2 +- sites/example/machine-types/example/wn.pan | 6 +- .../monitoring/nagios/services/load.pan | 17 +- sites/example/site/aii-config.pan | 2 +- sites/example/site/ceph/basic/cluster.pan | 34 +- sites/example/site/ceph/basic/config.pan | 8 +- sites/example/site/ceph/basic/deploy.pan | 7 +- sites/example/site/ceph/basic/mdss.pan | 12 +- sites/example/site/ceph/basic/mons.pan | 11 +- .../site/ceph/basic/osdlist-simple.pan | 12 +- sites/example/site/ceph/building/config.pan | 4 +- sites/example/site/ceph/client/admin.pan | 11 +- sites/example/site/ceph/client/cephfs.pan | 12 +- sites/example/site/ceph/client/config.pan | 5 +- sites/example/site/ceph/client/configfile.pan | 7 +- sites/example/site/ceph/client/libvirt.pan | 11 +- .../example/site/ceph/common/ceph-deploy.pan | 4 +- sites/example/site/ceph/common/config.pan | 23 +- .../site/ceph/osdlocal/osd-fs-ec-cc-md.pan | 29 +- .../site/ceph/osdlocal/osd-kv-ec-cc-md.pan | 21 +- sites/example/site/ceph/osdlocal/simple.pan | 11 +- .../site/ceph/osdschemas/crushmap-cache.pan | 16 +- .../ceph/osdschemas/crushmap-ec-md-cache.pan | 22 +- .../site/ceph/osdschemas/osd-fetch.pan | 12 +- sites/example/site/ceph/server/config.pan | 33 +- .../site/ceph/server/extra_config_mds.pan | 16 +- sites/example/site/ceph/server/infernalis.pan | 22 +- sites/example/site/config.pan | 55 +-- sites/example/site/config/network.pan | 19 +- sites/example/site/databases.pan | 132 +++--- sites/example/site/dcache/batch.pan | 104 ++--- sites/example/site/dcache/link.pan | 59 ++- sites/example/site/dcache/node_config.pan | 78 ++-- sites/example/site/dcache/pnfs.pan | 202 ++++++---- sites/example/site/dcache/pools.pan | 94 +++-- sites/example/site/dcache/sitename.pan | 4 +- sites/example/site/dcache/unit.pan | 48 +-- sites/example/site/filesystems/base.pan | 55 +-- .../site/filesystems/ce_nfs_server.pan | 22 +- sites/example/site/filesystems/ceph-basic.pan | 37 +- sites/example/site/filesystems/ceph-cache.pan | 11 +- .../example/site/filesystems/ceph-common.pan | 80 ++-- sites/example/site/filesystems/ceph-meta.pan | 11 +- sites/example/site/filesystems/ceph-raid.pan | 41 +- sites/example/site/filesystems/extended.pan | 165 ++++---- sites/example/site/filesystems/glite.pan | 108 +++-- sites/example/site/filesystems/ral-wn.pan | 81 ++-- sites/example/site/filesystems/sw_raid.pan | 369 +++++++++-------- sites/example/site/filesystems/wn.pan | 115 +++--- sites/example/site/glite/config.pan | 291 +++++++------- sites/example/site/glite/dpm_config.pan | 3 - sites/example/site/glite/lfc_config.pan | 2 +- sites/example/site/glite/maui.pan | 70 ++-- sites/example/site/global_variables.pan | 2 +- sites/example/site/misc/fix_fqan_accounts.pan | 62 +-- sites/example/site/misc/fix_fqan_accounts.sh | 31 ++ sites/example/site/misc/fix_fqan_dirs.pan | 42 +- sites/example/site/misc/fix_fqan_dirs.sh | 11 + .../example/site/misc/purge_fqan_accounts.pan | 37 +- .../example/site/misc/purge_fqan_accounts.sh | 8 + sites/example/site/nagios/OCP_setup.pan | 30 +- sites/example/site/nagios/common.pan | 51 +-- sites/example/site/nagios/config/apache.pan | 379 +----------------- sites/example/site/nagios/config/httpd.conf | 239 +++++++++++ sites/example/site/nagios/config/nagios.conf | 50 +++ sites/example/site/nagios/config/ssl.conf | 31 ++ .../site/nagios/config/webinterface.pan | 57 +-- sites/example/site/nagios/hostgroups/all.pan | 4 +- .../site/nagios/hostgroups/cluster-A.pan | 2 +- .../site/nagios/hostgroups/cluster-B.pan | 2 +- sites/example/site/nagios/hosts/all.pan | 4 +- .../site/nagios/hosts/quattor_host.pan | 4 +- sites/example/site/nagios/master.pan | 12 +- sites/example/site/nagios/nsca.pan | 2 +- sites/example/site/nagios/site-commands.pan | 7 +- sites/example/site/nagios/slave-A.pan | 14 +- sites/example/site/nagios/slave-B.pan | 14 +- sites/example/site/named.pan | 2 +- sites/example/site/one/frontend.pan | 55 +-- sites/example/site/one/onevm.pan | 4 +- sites/example/site/one/rubygems.pan | 2 +- sites/example/site/openstack/config.pan | 2 +- sites/example/site/os/version_db.pan | 5 +- sites/example/site/wmslb/vos.pan | 9 +- sites/example/site/xen/db.pan | 4 +- sites/example/vo/site/vos_base_gids.pan | 2 +- 126 files changed, 2574 insertions(+), 2096 deletions(-) create mode 100644 sites/example/drivers/dell_openmanage_sas_driver.sh create mode 100644 sites/example/site/misc/fix_fqan_accounts.sh create mode 100644 sites/example/site/misc/fix_fqan_dirs.sh create mode 100644 sites/example/site/misc/purge_fqan_accounts.sh create mode 100644 sites/example/site/nagios/config/httpd.conf create mode 100644 sites/example/site/nagios/config/nagios.conf create mode 100644 sites/example/site/nagios/config/ssl.conf diff --git a/clusters/grid/umd4/profiles/se-dpm-disk.example.org.pan b/clusters/grid/umd4/profiles/se-dpm-disk.example.org.pan index 50e187d..21bc1bf 100644 --- a/clusters/grid/umd4/profiles/se-dpm-disk.example.org.pan +++ b/clusters/grid/umd4/profiles/se-dpm-disk.example.org.pan @@ -11,7 +11,7 @@ variable DPM_CONFIG_SITE ?= 'site/glite/dpm_config'; # Configure as a DPM disk server include 'machine-types/example/se_dpm'; -# +# # software repositories # include PKG_REPOSITORY_CONFIG; diff --git a/clusters/grid/umd4/profiles/se-dpm-disk2.example.org.pan b/clusters/grid/umd4/profiles/se-dpm-disk2.example.org.pan index e20d8b3..df4124b 100644 --- a/clusters/grid/umd4/profiles/se-dpm-disk2.example.org.pan +++ b/clusters/grid/umd4/profiles/se-dpm-disk2.example.org.pan @@ -11,7 +11,7 @@ variable DPM_CONFIG_SITE ?= 'site/glite/dpm_config'; # Configure as a DPM disk server include 'machine-types/example/se_dpm'; -# +# # software repositories # include PKG_REPOSITORY_CONFIG; diff --git a/clusters/grid/umd4/profiles/se-dpm-server.example.org.pan b/clusters/grid/umd4/profiles/se-dpm-server.example.org.pan index 83781f8..d733ba6 100644 --- a/clusters/grid/umd4/profiles/se-dpm-server.example.org.pan +++ b/clusters/grid/umd4/profiles/se-dpm-server.example.org.pan @@ -16,6 +16,7 @@ include 'machine-types/example/se_dpm'; # Tune MySQL parameters (recommended) include 'components/mysql/config'; + '/software/components/mysql/servers' = { SELF[FULL_HOSTNAME]['options'] = dict( 'innodb_buffer_pool_size', '2048M', @@ -24,7 +25,7 @@ include 'components/mysql/config'; SELF; }; -# +# # software repositories # include PKG_REPOSITORY_CONFIG; diff --git a/clusters/grid/umd4/profiles/ui.example.org.pan b/clusters/grid/umd4/profiles/ui.example.org.pan index 8d288ba..a49f158 100644 --- a/clusters/grid/umd4/profiles/ui.example.org.pan +++ b/clusters/grid/umd4/profiles/ui.example.org.pan @@ -1,6 +1,6 @@ -object template ui.example.org; - -include 'machine-types/grid/ui'; - -include PKG_REPOSITORY_CONFIG; - +object template ui.example.org; + +include 'machine-types/grid/ui'; + +include PKG_REPOSITORY_CONFIG; + diff --git a/clusters/grid/umd4/site/cluster_info.pan b/clusters/grid/umd4/site/cluster_info.pan index ae73324..45854eb 100644 --- a/clusters/grid/umd4/site/cluster_info.pan +++ b/clusters/grid/umd4/site/cluster_info.pan @@ -15,7 +15,7 @@ variable OS_FLAVOUR_ENABLED ?= true; # YUM Repository snapshots variable YUM_SNAPSHOT_DATE ?= '20140304'; -variable AII_OSINSTALL_ROOT = '/yum/snapshots/' + YUM_SNAPSHOT_DATE; +variable AII_OSINSTALL_ROOT = format('/yum/snapshots/%s', YUM_SNAPSHOT_DATE); # Set to true to enable MPI support variable ENABLE_MPI ?= false; diff --git a/clusters/misc/nagios/repository/config.pan b/clusters/misc/nagios/repository/config.pan index f11cb54..e01167f 100644 --- a/clusters/misc/nagios/repository/config.pan +++ b/clusters/misc/nagios/repository/config.pan @@ -18,9 +18,10 @@ variable YUM_SITE_SNAPSHOT_NS ?= YUM_SNAPSHOT_NS; variable SITE_REPOSITORY_LIST ?= list(); variable SITE_REPOSITORY_CONFIG ?= dict(); variable DEBUG = debug( - 'OS_REPOSITORY_LIST = ' + to_string(OS_REPOSITORY_LIST) + "\n" + - 'SITE_REPOSITORY_LIST = ' + to_string(SITE_REPOSITORY_LIST) + "\n" + - 'SITE_REPOSITORY_CONFIG = ' + to_string(SITE_REPOSITORY_CONFIG) + "\n" + "OS_REPOSITORY_LIST = %s\nSITE_REPOSITORY_LIST = %s\nSITE_REPOSITORY_CONFIG = %s", + OS_REPOSITORY_LIST, + SITE_REPOSITORY_LIST, + SITE_REPOSITORY_CONFIG, ); include 'quattor/functions/repository'; '/software/repositories' = add_repositories(SITE_REPOSITORY_LIST); diff --git a/clusters/misc/nagios/site/cluster_info.pan b/clusters/misc/nagios/site/cluster_info.pan index 23a3ff8..c6788f3 100644 --- a/clusters/misc/nagios/site/cluster_info.pan +++ b/clusters/misc/nagios/site/cluster_info.pan @@ -15,7 +15,7 @@ variable OS_FLAVOUR_ENABLED ?= true; # YUM Repository snapshots variable YUM_SNAPSHOT_DATE ?= '20140304'; -variable AII_OSINSTALL_ROOT = '/yum/snapshots/'+YUM_SNAPSHOT_DATE; +variable AII_OSINSTALL_ROOT = format('/yum/snapshots/', YUM_SNAPSHOT_DATE); # Set to true if you want to deploy machines in these clusster with an # AII server running Quattor 13.1.x. @@ -38,6 +38,6 @@ variable PKG_REPOSITORY_CONFIG ?= 'repository/config'; # # set root password on machines # -include { 'components/accounts/config' }; +include 'components/accounts/config'; "/software/components/accounts/rootpwd" ?= "$1$57qRuCXe$NPngMkg4BrLBf5hfJzJh21"; "/software/components/accounts/shadowpwd" = true; diff --git a/non-grid/basic/common/opennebula/common.pan b/non-grid/basic/common/opennebula/common.pan index 8246f46..691bd3f 100644 --- a/non-grid/basic/common/opennebula/common.pan +++ b/non-grid/basic/common/opennebula/common.pan @@ -1,16 +1,17 @@ unique template common/opennebula/common; +include 'components/useraccess/config'; + variable OPENNEBULA_VERSION ?= '4.12.1'; -'/software/packages' = pkg_repl('opennebula*', format("%s-*",OPENNEBULA_VERSION), 'x86_64'); +'/software/packages' = pkg_repl('opennebula*', format("%s-*", OPENNEBULA_VERSION), 'x86_64'); variable OS_REPOSITORY_LIST = { append('opennebula'); }; "/software/components/useraccess/users/oneadmin/ssh_keys" = { - foreach(idx;pubkey;ONEADMIN_PUBKEYS) { - append(pubkey); - }; - SELF; + foreach(idx; pubkey; ONEADMIN_PUBKEYS) { + append(pubkey); + }; + SELF; }; - diff --git a/non-grid/basic/common/opennebula/mysql.pan b/non-grid/basic/common/opennebula/mysql.pan index eefbb47..7950d41 100644 --- a/non-grid/basic/common/opennebula/mysql.pan +++ b/non-grid/basic/common/opennebula/mysql.pan @@ -1,10 +1,11 @@ unique template common/opennebula/mysql; +include 'components/chkconfig/config'; +include 'components/mysql/config'; + prefix "/software/packages"; "{mysql-server}" = dict(); -include 'components/mysql/config'; - prefix "/software/components/mysql"; "serviceName" = { if (RPM_BASE_FLAVOUR_VERSIONID == 7) { @@ -21,9 +22,9 @@ prefix "/software/components/mysql/servers/one"; prefix "/software/components/mysql/databases/opennebula"; "server" = "one"; "users/oneadmin/password" = OPENNEBULA_MYSQL_ONEADMIN; -"users/oneadmin/rights" = list("ALL PRIVILEGES"); +"users/oneadmin/rights" = list("ALL PRIVILEGES"); "createDb" = false; # if false, run script "initScript/file" = "/dev/null"; prefix "/software/components/chkconfig/service"; -"mysqld" = dict("on", "","startstop", true); +"mysqld" = dict("on", "", "startstop", true); diff --git a/non-grid/basic/common/opennebula/node.pan b/non-grid/basic/common/opennebula/node.pan index 5c4d888..a4db2ce 100644 --- a/non-grid/basic/common/opennebula/node.pan +++ b/non-grid/basic/common/opennebula/node.pan @@ -1,7 +1,7 @@ unique template common/opennebula/node; +include 'components/filecopy/config'; include 'components/opennebula/sudo'; -include 'components/useraccess/config'; prefix "/software/packages"; "{opennebula-node-kvm}" = dict(); @@ -11,10 +11,15 @@ prefix "/software/packages"; '/software/components/filecopy/services' = { if (is_defined(CEPH_LIBVIRT_UUID)) { SELF[escape("/var/lib/one/templates/secret/secret_ceph.xml")] = dict( - 'config',format("%s%s secret", - CEPH_LIBVIRT_UUID, "client.libvirt"), - 'owner','oneadmin:oneadmin', - 'perms', '0600'); - }; - SELF; + 'config', join("", list( + "", + format("%s", CEPH_LIBVIRT_UUID), + format("%s secret", "client.libvirt"), + "", + )), + 'owner', 'oneadmin:oneadmin', + 'perms', '0600', + ); + }; + SELF; }; diff --git a/non-grid/basic/common/opennebula/one_auth.pan b/non-grid/basic/common/opennebula/one_auth.pan index fc823b7..417784d 100644 --- a/non-grid/basic/common/opennebula/one_auth.pan +++ b/non-grid/basic/common/opennebula/one_auth.pan @@ -1,5 +1,7 @@ unique template common/opennebula/one_auth; +include 'components/filecopy/config'; + '/software/components/filecopy/services/{/var/lib/one/.one/one_auth.new}' = dict( 'config', format("oneadmin:%s\n", OPENNEBULA_ONEADMIN), 'owner', 'oneadmin:oneadmin', diff --git a/non-grid/basic/common/opennebula/oneadmin.pan b/non-grid/basic/common/opennebula/oneadmin.pan index 1960c95..d50108b 100644 --- a/non-grid/basic/common/opennebula/oneadmin.pan +++ b/non-grid/basic/common/opennebula/oneadmin.pan @@ -9,7 +9,7 @@ prefix '/software/components/accounts'; "users/oneadmin" = dict( "uid", 9869, "groups", list("oneadmin"), - "comment","oneadmin", + "comment", "oneadmin", "shell", "/bin/bash", "homeDir", "/var/lib/one", "createHome", true, diff --git a/sites/example/drivers/dell_openmanage.pan b/sites/example/drivers/dell_openmanage.pan index 33cf6ef..1ca37a3 100644 --- a/sites/example/drivers/dell_openmanage.pan +++ b/sites/example/drivers/dell_openmanage.pan @@ -1,95 +1,88 @@ unique template drivers/dell_openmanage; -"/software/packages"={ - kernel=""; - if(KERNEL_VARIANT!="") kernel="kernel-" + KERNEL_VARIANT + "-devel" - else kernel="kernel-devel"; - pkg_repl(kernel,KERNEL_VERSION_NUM,PKG_ARCH_KERNEL); - }; +include 'components/filecopy/config'; + +"/software/packages" = { + kernel = ""; + if (KERNEL_VARIANT != "") kernel = "kernel-" + KERNEL_VARIANT + "-devel" + else kernel = "kernel-devel"; + pkg_repl(kernel, KERNEL_VERSION_NUM, PKG_ARCH_KERNEL); +}; #install RPMs # # OS Packages necessaires # -#"/software/packages"=pkg_repl("libxml2","2.6.26-2.1.2.7","i386"); -#"/software/packages"=pkg_repl("zlib","1.2.3-3","i386"); -#"/software/packages"=pkg_repl("compat-libstdc33","3.2.3-61","i386"); -#"/software/packages"=pkg_repl("pam","0.99.6.2-3.27.el5","i386"); -#"/software/packages"=pkg_repl("audit-libs","1.6.5-9.el5","i386"); -#"/software/packages"=pkg_repl("cracklib","2.8.9-3.3","i386"); -#"/software/packages"=pkg_repl("libselinux","1.33.4-5.el5","i386"); -#"/software/packages"=pkg_repl("libsepol","1.15.2-1.el5","i386"); -#"/software/packages"=pkg_repl("ncurses","5.5-24.20060715","i386"); +#"/software/packages" = pkg_repl("libxml2", "2.6.26-2.1.2.7", "i386"); +#"/software/packages" = pkg_repl("zlib", "1.2.3-3", "i386"); +#"/software/packages" = pkg_repl("compat-libstdc33", "3.2.3-61", "i386"); +#"/software/packages" = pkg_repl("pam", "0.99.6.2-3.27.el5", "i386"); +#"/software/packages" = pkg_repl("audit-libs", "1.6.5-9.el5", "i386"); +#"/software/packages" = pkg_repl("cracklib", "2.8.9-3.3", "i386"); +#"/software/packages" = pkg_repl("libselinux", "1.33.4-5.el5", "i386"); +#"/software/packages" = pkg_repl("libsepol", "1.15.2-1.el5", "i386"); +#"/software/packages" = pkg_repl("ncurses", "5.5-24.20060715", "i386"); # # Dell OpenManage Version # -"/software/packages"=pkg_add("srvadmin-omilcore","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-syscheck","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-deng","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-racser","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-omauth","5.5.0-364.rhel4","i386"); -"/software/packages"=pkg_add("srvadmin-omacore","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-jre","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-odf","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-racadm4","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-racsvc","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-ipmi","5.5.0-364.rhel4","i386"); -"/software/packages"=pkg_add("srvadmin-hapi","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-rac5-components","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-isvc","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-rac3-components","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-rac4-components","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-cm","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-iws","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-old","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-omhip","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-racadm5","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-racdrsc3","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-racdrsc4","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-racdrsc5","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-racser-devel","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-racvnc","5.5.0-364","i386"); -"/software/packages"=pkg_add("srvadmin-storage","5.5.0-364","i386"); +"/software/packages" = pkg_add("srvadmin-omilcore", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-syscheck", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-deng", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-racser", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-omauth", "5.5.0-364.rhel4", "i386"); +"/software/packages" = pkg_add("srvadmin-omacore", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-jre", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-odf", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-racadm4", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-racsvc", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-ipmi", "5.5.0-364.rhel4", "i386"); +"/software/packages" = pkg_add("srvadmin-hapi", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-rac5-components", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-isvc", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-rac3-components", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-rac4-components", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-cm", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-iws", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-old", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-omhip", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-racadm5", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-racdrsc3", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-racdrsc4", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-racdrsc5", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-racser-devel", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-racvnc", "5.5.0-364", "i386"); +"/software/packages" = pkg_add("srvadmin-storage", "5.5.0-364", "i386"); #installation de dkms -"/software/packages"=pkg_add("dkms","2.0.19-1","noarch"); +"/software/packages" = pkg_add("dkms", "2.0.19-1", "noarch"); #openipmi installation: -"/software/packages"=pkg_add("openipmi","33.13.RHEL4-1dkms","noarch"); +"/software/packages" = pkg_add("openipmi", "33.13.RHEL4-1dkms", "noarch"); #driver installation -"/software/packages"=pkg_add("megaraid_sas","v00.00.03.21-4","noarch"); +"/software/packages" = pkg_add("megaraid_sas", "v00.00.03.21-4", "noarch"); #Install and run setup script -variable CONFIG_FILE="/usr/bin/setup_dell_openmanage.sh"; -variable RESTART_COMMAND=CONFIG_FILE; -variable MACHINE_KERNEL_VERSION={ - if(KERNEL_VARIANT!="") return(KERNEL_VERSION_NUM+KERNEL_VARIANT) - else return(KERNEL_VERSION_NUM); +variable CONFIG_FILE = "/usr/bin/setup_dell_openmanage.sh"; +variable RESTART_COMMAND = CONFIG_FILE; +variable MACHINE_KERNEL_VERSION = { + if (KERNEL_VARIANT != "") return(KERNEL_VERSION_NUM + KERNEL_VARIANT) + else return(KERNEL_VERSION_NUM); }; - -variable CONTENTS=<= 0){ + if (index(OBJECT, CEPH_MON_HOSTS) >= 0){ append("ceph-mons"); }; SELF; }; -include { +include { if (CEPH_MAJOR_VERSION >= 9) { 'site/ceph/server/infernalis'; }; }; -include { if_exists('site/ceph/cluster/extra_config')}; -include {if (MACHINETYPE_TOP_INSTANCE == 'ceph-server') { - 'machine-types/post/ceph-server'; # Else this should be included on higer level +include if_exists('site/ceph/cluster/extra_config'); +include { + if (MACHINETYPE_TOP_INSTANCE == 'ceph-server') { + 'machine-types/post/ceph-server'; # Else this should be included on higer level }; }; diff --git a/sites/example/machine-types/example/se_dpm.pan b/sites/example/machine-types/example/se_dpm.pan index 9109a51..3fdfd2f 100644 --- a/sites/example/machine-types/example/se_dpm.pan +++ b/sites/example/machine-types/example/se_dpm.pan @@ -9,5 +9,5 @@ variable SEDPM_CONFIG_SITE = "site/glite/dpm_config"; #variable GLITE_UPDATE_VERSION ?= '45-1'; # Include base machine type -include { 'machine-types/grid/se_dpm' }; +include 'machine-types/grid/se_dpm'; diff --git a/sites/example/machine-types/example/wn.pan b/sites/example/machine-types/example/wn.pan index 3a10654..c653119 100644 --- a/sites/example/machine-types/example/wn.pan +++ b/sites/example/machine-types/example/wn.pan @@ -3,18 +3,18 @@ unique template machine-types/example/wn; variable FILESYSTEM_LAYOUT_CONFIG_SITE ?= 'site/filesystems/wn'; variable GLEXEC_ARGUS_PEPD_ENDPOINTS ?= list('https://polgrid30.in2p3.fr:8154/authz'); -include { 'machine-types/grid/wn' }; +include 'machine-types/grid/wn'; ################## # Include Pakiti # ################## -#include { 'features/pakiti/config' }; +#include 'features/pakiti/config'; ################################# # Include tmpdir cleanup script # ################################# variable WN_CLEANUP_TMPDIR_TEMPLATE ?= if_exists('glite/wn/cleanup-tmpdir'); variable WN_CLEANUP_TMPDIR_TEMPLATE ?= if_exists('personality/wn/cleanup-tmpdir'); -include { WN_CLEANUP_TMPDIR_TEMPLATE }; +include WN_CLEANUP_TMPDIR_TEMPLATE; diff --git a/sites/example/monitoring/nagios/services/load.pan b/sites/example/monitoring/nagios/services/load.pan index 2fc04ec..eb1dffe 100644 --- a/sites/example/monitoring/nagios/services/load.pan +++ b/sites/example/monitoring/nagios/services/load.pan @@ -1,13 +1,16 @@ structure template monitoring/nagios/services/load; -include { NAGIOS_DEFAULT_SERVICE_TEMPLATE }; +include NAGIOS_DEFAULT_SERVICE_TEMPLATE; -'service_description'='Host load local'; -'check_command'= list ( -'check_nrpe_load', - '4,3,2.5', - '5,4.3,3.6'); -'hostgroup_name' = list( 'quattor-nodes' ); +'service_description' = 'Host load local'; +'check_command' = list( + 'check_nrpe_load', + '4, 3, 2.5', + '5, 4.3, 3.6', +); +'hostgroup_name' = list( + 'quattor-nodes', +); # show performance metrics 'action_url' = PNP4NAGIOS_SERVICE_ACTION_URL; diff --git a/sites/example/site/aii-config.pan b/sites/example/site/aii-config.pan index de298fe..e388f60 100644 --- a/sites/example/site/aii-config.pan +++ b/sites/example/site/aii-config.pan @@ -8,7 +8,7 @@ unique template site/aii-config; -include { 'pan/functions' }; +include 'pan/functions'; # Name of tftp server used by PXE installation variable AII_KS_SRV ?= "quattorsrv.example.org"; diff --git a/sites/example/site/ceph/basic/cluster.pan b/sites/example/site/ceph/basic/cluster.pan index 47a10a7..981c9cd 100644 --- a/sites/example/site/ceph/basic/cluster.pan +++ b/sites/example/site/ceph/basic/cluster.pan @@ -1,5 +1,7 @@ unique template site/ceph/basic/cluster; +include 'components/ceph/config'; + variable CEPH_HOSTS = shorten_fqdns(CEPH_NODES); include 'site/ceph/common/ceph-deploy'; @@ -9,32 +11,32 @@ prefix '/software/components/ceph'; 'ceph_version' = CEPH_VERSION; variable CEPH_OSD_LIST ?= 'site/ceph/basic/osdlist-simple'; -include {CEPH_OSD_LIST } ; +include CEPH_OSD_LIST; variable CEPH_OSD_SCHEMA ?= 'osds-simple'; -include {format('site/ceph/osdschemas/%s', CEPH_OSD_SCHEMA)}; +include format('site/ceph/osdschemas/%s', CEPH_OSD_SCHEMA); include 'site/ceph/basic/mons'; include 'site/ceph/basic/mdss'; include 'site/ceph/basic/deploy'; prefix '/software/components/ceph/clusters/ceph'; -variable CEPH_GLOBAL_CONFIG_EXTRA ?= nlist(); +variable CEPH_GLOBAL_CONFIG_EXTRA ?= dict(); variable CEPH_ENABLE_EXP ?= list(); variable CEPH_OSD_DOWN_REPORTERS ?= false; variable CEPH_OSD_DOWN_REPORTS ?= false; -variable CEPH_GLOBAL_CONFIG ?= { - cfg = nlist ( - 'fsid' , CEPH_FSID, - 'mon_initial_members', MON_NAMES, - 'public_network', CEPH_NETWORK, - 'cluster_network', CEPH_CLUSTER_NETWORK, - 'osd_pool_default_size', 3, - 'osd_pool_default_min_size', 2, - 'osd_pool_default_pg_num', 512, - 'osd_pool_default_pgp_num', 512, +variable CEPH_GLOBAL_CONFIG ?= { + cfg = dict ( + 'fsid', CEPH_FSID, + 'mon_initial_members', MON_NAMES, + 'public_network', CEPH_NETWORK, + 'cluster_network', CEPH_CLUSTER_NETWORK, + 'osd_pool_default_size', 3, + 'osd_pool_default_min_size', 2, + 'osd_pool_default_pg_num', 512, + 'osd_pool_default_pgp_num', 512, ); if(length(CEPH_ENABLE_EXP) > 0) { cfg['enable_experimental_unrecoverable_data_corrupting_features'] = CEPH_ENABLE_EXP; @@ -43,8 +45,8 @@ variable CEPH_GLOBAL_CONFIG ?= { cfg['mon_osd_min_down_reporters'] = CEPH_OSD_DOWN_REPORTERS; cfg['mon_osd_min_down_reports'] = CEPH_OSD_DOWN_REPORTS; }; - if (is_nlist(CEPH_GLOBAL_CONFIG_EXTRA)) { - cfg= merge(cfg, CEPH_GLOBAL_CONFIG_EXTRA); + if (is_dict(CEPH_GLOBAL_CONFIG_EXTRA)) { + cfg = merge(cfg, CEPH_GLOBAL_CONFIG_EXTRA); }; cfg; }; @@ -53,4 +55,4 @@ variable CEPH_GLOBAL_CONFIG ?= { 'config' = CEPH_GLOBAL_CONFIG; variable CEPH_CRUSHMAP ?= null; -include { CEPH_CRUSHMAP }; +include CEPH_CRUSHMAP; diff --git a/sites/example/site/ceph/basic/config.pan b/sites/example/site/ceph/basic/config.pan index e51c868..2782555 100644 --- a/sites/example/site/ceph/basic/config.pan +++ b/sites/example/site/ceph/basic/config.pan @@ -2,8 +2,10 @@ unique template site/ceph/basic/config; include 'site/ceph/server/config'; -variable IS_CEPH_DEPLOYHOST = { DEPLOY_FQDNS[0] == format('%s.%s', value('/system/network/hostname'), value('/system/network/domainname'))}; +variable IS_CEPH_DEPLOYHOST = { + DEPLOY_FQDNS[0] == format('%s.%s', value('/system/network/hostname'), value('/system/network/domainname')); +}; -include { if (IS_CEPH_DEPLOYHOST) { 'components/ceph/config' }}; +include if (IS_CEPH_DEPLOYHOST) { 'components/ceph/config' }; -include { if (IS_CEPH_DEPLOYHOST) { 'site/ceph/basic/cluster' }}; +include if (IS_CEPH_DEPLOYHOST) { 'site/ceph/basic/cluster' }; diff --git a/sites/example/site/ceph/basic/deploy.pan b/sites/example/site/ceph/basic/deploy.pan index 4f42364..c06bb56 100644 --- a/sites/example/site/ceph/basic/deploy.pan +++ b/sites/example/site/ceph/basic/deploy.pan @@ -1,14 +1,15 @@ unique template site/ceph/basic/deploy; +include 'components/ceph/config'; + variable DEPLOY_NAMES = shorten_fqdns(DEPLOY_FQDNS); prefix '/software/components/ceph/clusters/ceph'; 'deployhosts' = { - ml = nlist(); - foreach(idx;host;DEPLOY_NAMES) { + ml = dict(); + foreach(idx; host; DEPLOY_NAMES) { ml[host] = DEPLOY_FQDNS[idx]; }; ml; }; - diff --git a/sites/example/site/ceph/basic/mdss.pan b/sites/example/site/ceph/basic/mdss.pan index a4c66d5..2ca8b3b 100644 --- a/sites/example/site/ceph/basic/mdss.pan +++ b/sites/example/site/ceph/basic/mdss.pan @@ -1,20 +1,22 @@ unique template site/ceph/basic/mdss; +include 'components/ceph/config'; + #variable MDS_NAMES = shorten_fqdns(MDS_FQDNS); prefix '/software/components/ceph/clusters/ceph'; 'mdss' = { - ml = nlist(); - foreach(idx;host;MDS_FQDNS) { - config = nlist(); + ml = dict(); + foreach(idx; host; MDS_FQDNS) { + config = dict(); if (is_defined(CEPH_MDS_CACHE_SIZE)){ config['mds_cache_size'] = CEPH_MDS_CACHE_SIZE; }; - l = nlist('config', config); + l = dict('config', config); l['fqdn'] = host; - ml[host] = l; + ml[host] = l; }; ml; }; diff --git a/sites/example/site/ceph/basic/mons.pan b/sites/example/site/ceph/basic/mons.pan index 3f6ab8e..cb69763 100644 --- a/sites/example/site/ceph/basic/mons.pan +++ b/sites/example/site/ceph/basic/mons.pan @@ -1,5 +1,7 @@ unique template site/ceph/basic/mons; +include 'components/ceph/config'; + variable MON_FQDNS = CEPH_MON_HOSTS; variable MON_NAMES = shorten_fqdns(MON_FQDNS); @@ -7,12 +9,11 @@ prefix '/software/components/ceph/clusters/ceph'; 'monitors' = { - ml = nlist(); - foreach(idx;host;MON_NAMES) { - l = nlist(); + ml = dict(); + foreach(idx; host; MON_NAMES) { + l = dict(); l['fqdn'] = MON_FQDNS[idx]; - ml[host] = l; + ml[host] = l; }; ml; }; - diff --git a/sites/example/site/ceph/basic/osdlist-simple.pan b/sites/example/site/ceph/basic/osdlist-simple.pan index 55a4251..712d369 100644 --- a/sites/example/site/ceph/basic/osdlist-simple.pan +++ b/sites/example/site/ceph/basic/osdlist-simple.pan @@ -1,13 +1,12 @@ unique template site/ceph/basic/osdlist-simple; -# This is very basic and can only be used when using only all equal sized disks +# This is very basic and can only be used when using only all equal sized disks variable CEPH_OSD_IGNORE_LIST ?= CEPH_SSD_DISKS; variable CEPH_OSD_DISKS = { - hosts = nlist(); - foreach(idx;host;CEPH_NODES) { + hosts = dict(); + foreach(idx; host; CEPH_NODES) { osds = list(); - foreach (disk;data;value(format('%s:/hardware/harddisks', host))) { - # foreach (disk;data;value('/hardware/harddisks')) { + foreach (disk; data; value(format('%s:/hardware/harddisks', host))) { if (index(disk, CEPH_OSD_IGNORE_LIST) == -1) { append(osds, disk); }; @@ -17,5 +16,4 @@ variable CEPH_OSD_DISKS = { hosts; }; variable TMP_OSDS = CEPH_OSD_DISKS[CEPH_HOSTS[0]]; -variable CEPH_DEFAULT_OSD_WEIGHT ?= to_double(value(format('/hardware/harddisks/%s/capacity', TMP_OSDS[0]))) / (1024*1024); - +variable CEPH_DEFAULT_OSD_WEIGHT ?= to_double(value(format('/hardware/harddisks/%s/capacity', TMP_OSDS[0]))) / 1048576; diff --git a/sites/example/site/ceph/building/config.pan b/sites/example/site/ceph/building/config.pan index 0f734cc..2d98f08 100644 --- a/sites/example/site/ceph/building/config.pan +++ b/sites/example/site/ceph/building/config.pan @@ -7,8 +7,8 @@ variable IS_CEPH_DEPLOYHOST = { match(DEPLOY_FQDNS[0], value('/system/network/ho include 'components/ceph/config'; variable CEPH_OSD_LIST ?= 'site/ceph/osdlocal/simple'; -include {CEPH_OSD_LIST } ; +include CEPH_OSD_LIST; variable CEPH_OSD_SCHEMA = 'osd-fetch'; -include { if (IS_CEPH_DEPLOYHOST) { 'site/ceph/basic/cluster' }}; +include if (IS_CEPH_DEPLOYHOST) { 'site/ceph/basic/cluster' }; diff --git a/sites/example/site/ceph/client/admin.pan b/sites/example/site/ceph/client/admin.pan index d30ca67..a6e6a94 100644 --- a/sites/example/site/ceph/client/admin.pan +++ b/sites/example/site/ceph/client/admin.pan @@ -1,15 +1,18 @@ unique template site/ceph/client/admin; +include 'components/metaconfig/config'; + include 'site/ceph/client/config'; prefix '/software/components/metaconfig/services/{/etc/ceph/ceph.client.admin.keyring}'; "contents" = if (is_defined(CEPH_ADMIN_SECRET)) { - nlist("client.admin", nlist( - "key", CEPH_ADMIN_SECRET, + dict( + "client.admin", dict( + "key", CEPH_ADMIN_SECRET, ) - ); + ); } else { - nlist(); + dict(); }; 'module' = 'tiny'; 'mode' = 0600; diff --git a/sites/example/site/ceph/client/cephfs.pan b/sites/example/site/ceph/client/cephfs.pan index d771eb5..bc4efd8 100644 --- a/sites/example/site/ceph/client/cephfs.pan +++ b/sites/example/site/ceph/client/cephfs.pan @@ -1,5 +1,7 @@ unique template site/ceph/client/cephfs; +include 'components/metaconfig/config'; + include 'site/ceph/client/config'; variable CEPH_CEPHFS_USER ?= 'root'; @@ -8,15 +10,15 @@ variable CEPH_CEPHFS_GROUP ?= CEPH_CEPHFS_USER; prefix '/software/components/metaconfig/services/{/etc/ceph/ceph.client.cephfs.keyring}'; "contents" = if (is_defined(CEPH_CEPHFS_SECRET)) { - nlist("client.cephfs", nlist( - "key", CEPH_CEPHFS_SECRET, + dict( + "client.cephfs", dict( + "key", CEPH_CEPHFS_SECRET, ) - ); + ); } else { - nlist(); + dict(); }; 'module' = 'tiny'; 'mode' = 0600; 'owner' = CEPH_CEPHFS_USER; 'group' = CEPH_CEPHFS_GROUP; - diff --git a/sites/example/site/ceph/client/config.pan b/sites/example/site/ceph/client/config.pan index d5a7981..776d6b7 100644 --- a/sites/example/site/ceph/client/config.pan +++ b/sites/example/site/ceph/client/config.pan @@ -5,13 +5,12 @@ include 'repository/config/ceph'; include 'site/ceph/client/params'; prefix '/software/packages'; -'ceph-fuse' = nlist(); +'ceph-fuse' = dict(); variable CEPH_CLIENT_SET_CONFIG ?= true; include { if(CEPH_CLIENT_SET_CONFIG){ - 'site/ceph/client/configfile'; + 'site/ceph/client/configfile'; }; }; - diff --git a/sites/example/site/ceph/client/configfile.pan b/sites/example/site/ceph/client/configfile.pan index bdae02a..3ea01b1 100644 --- a/sites/example/site/ceph/client/configfile.pan +++ b/sites/example/site/ceph/client/configfile.pan @@ -1,11 +1,12 @@ unique template site/ceph/client/configfile; +include 'components/metaconfig/config'; + prefix '/software/components/metaconfig/services/{/etc/ceph/ceph.conf}/contents'; -"global" = nlist( +"global" = dict( "mon_host", join(', ', CEPH_MON_HOSTS), - ); +); prefix '/software/components/metaconfig/services/{/etc/ceph/ceph.conf}'; 'module' = 'tiny'; - diff --git a/sites/example/site/ceph/client/libvirt.pan b/sites/example/site/ceph/client/libvirt.pan index 34aad6a..fe67146 100644 --- a/sites/example/site/ceph/client/libvirt.pan +++ b/sites/example/site/ceph/client/libvirt.pan @@ -1,5 +1,7 @@ unique template site/ceph/client/libvirt; +include 'components/metaconfig/config'; + include 'site/ceph/client/config'; variable CEPH_LIBVIRT_USER ?= 'oneadmin'; @@ -7,12 +9,13 @@ variable CEPH_LIBVIRT_GROUP ?= CEPH_LIBVIRT_USER; prefix '/software/components/metaconfig/services/{/etc/ceph/ceph.client.libvirt.keyring}'; "contents" = if (is_defined(CEPH_LIBVIRT_SECRET)) { - nlist("client.libvirt", nlist( - "key", CEPH_LIBVIRT_SECRET, + dict( + "client.libvirt", dict( + "key", CEPH_LIBVIRT_SECRET, ) - ); + ); } else { - nlist(); + dict(); }; 'module' = 'tiny'; 'mode' = 0600; diff --git a/sites/example/site/ceph/common/ceph-deploy.pan b/sites/example/site/ceph/common/ceph-deploy.pan index 9f971bf..c1537a8 100644 --- a/sites/example/site/ceph/common/ceph-deploy.pan +++ b/sites/example/site/ceph/common/ceph-deploy.pan @@ -8,7 +8,7 @@ variable CEPH_DEPLOY_VERSION ?= { }; }; -'/software/packages' = { - pkg_repl("ceph-deploy",format("%s-*",CEPH_DEPLOY_VERSION),'noarch'); +'/software/packages' = { + pkg_repl("ceph-deploy", format("%s-*", CEPH_DEPLOY_VERSION), 'noarch'); }; diff --git a/sites/example/site/ceph/common/config.pan b/sites/example/site/ceph/common/config.pan index 98b2b10..9d37126 100644 --- a/sites/example/site/ceph/common/config.pan +++ b/sites/example/site/ceph/common/config.pan @@ -23,16 +23,15 @@ variable OS_REPOSITORY_LIST = { }; '/software/packages' = { - v=format("%s-*",CEPH_VERSION); - pkg_repl("ceph*",v,'x86_64'); - pkg_repl("librbd1*",v,'x86_64'); - pkg_repl("libradosstriper1*",v,'x86_64'); - pkg_repl("librados2*",v,'x86_64'); - pkg_repl("libcephfs1*",v,'x86_64'); - pkg_repl("libcephfs_jni1*",v,'x86_64'); - pkg_repl("python-ceph-compat*",v,'x86_64'); - pkg_repl("python-cephfs*",v,'x86_64'); - pkg_repl("python-rados*",v,'x86_64'); - pkg_repl("python-rbd*",v,'x86_64'); + v = format("%s-*", CEPH_VERSION); + pkg_repl("ceph*", v, 'x86_64'); + pkg_repl("librbd1*", v, 'x86_64'); + pkg_repl("libradosstriper1*", v, 'x86_64'); + pkg_repl("librados2*", v, 'x86_64'); + pkg_repl("libcephfs1*", v, 'x86_64'); + pkg_repl("libcephfs_jni1*", v, 'x86_64'); + pkg_repl("python-ceph-compat*", v, 'x86_64'); + pkg_repl("python-cephfs*", v, 'x86_64'); + pkg_repl("python-rados*", v, 'x86_64'); + pkg_repl("python-rbd*", v, 'x86_64'); }; - diff --git a/sites/example/site/ceph/osdlocal/osd-fs-ec-cc-md.pan b/sites/example/site/ceph/osdlocal/osd-fs-ec-cc-md.pan index 59e2a9c..b57b6f2 100644 --- a/sites/example/site/ceph/osdlocal/osd-fs-ec-cc-md.pan +++ b/sites/example/site/ceph/osdlocal/osd-fs-ec-cc-md.pan @@ -1,38 +1,37 @@ unique template site/ceph/osdlocal/osd-fs-ec-cc-md; -variable CEPH_JOURNAL_PART ?= nlist(); +variable CEPH_JOURNAL_PART ?= dict(); prefix '/software/components/ceph'; 'localdaemons/osds' = { - d=nlist(); - foreach(idx;osdmnt;value('/system/filesystems')) { + d = dict(); + foreach(idx; osdmnt; value('/system/filesystems')) { part = osdmnt['block_device']; disk = replace('\S+/([a-z0A-Z]+)[0-9]*$', '$1', unescape(part)); - if (match(osdmnt['mountpoint'], '/var/lib/ceph/osd/cache/\w+')){ - d[escape(osdmnt['mountpoint'])] = nlist( + if (match(osdmnt['mountpoint'], '/var/lib/ceph/osd/cache/\w+')) { + d[escape(osdmnt['mountpoint'])] = dict( 'journal_path', format('/dev/%s%d', disk, CEPH_JOURNAL_PART['cache']), 'crush_weight', weight_of(part), 'labels', list('cache'), - ); - } else if (match(osdmnt['mountpoint'], '/var/lib/ceph/osd/meta/\w+')){ - d[escape(osdmnt['mountpoint'])] = nlist( + ); + } else if (match(osdmnt['mountpoint'], '/var/lib/ceph/osd/meta/\w+')) { + d[escape(osdmnt['mountpoint'])] = dict( 'journal_path', format('/dev/%s%d', disk, CEPH_JOURNAL_PART['md']), 'crush_weight', weight_of(part), 'labels', list('md'), - ); - } else if (match(osdmnt['mountpoint'], '/var/lib/ceph/osd/\w+')){ - part_coded = replace('md/(.+)*$', '$1', part); + ); + } else if (match(osdmnt['mountpoint'], '/var/lib/ceph/osd/\w+')) { + part_coded = replace('md/(.+)*$', '$1', part); raiddev = value(format('/system/blockdevices/md/%s', part_coded)); part = raiddev['device_list'][0]; disk = replace('^([a-zA-Z]+)0\S+$', '$1', disk); - d[escape(osdmnt['mountpoint'])] = nlist( + d[escape(osdmnt['mountpoint'])] = dict( 'journal_path', format('/dev/%s%d', disk, CEPH_JOURNAL_PART['data']), - 'crush_weight', 2*weight_of(part), + 'crush_weight', 2 * weight_of(part), 'labels', list('ec'), - ); + ); }; }; d; }; - diff --git a/sites/example/site/ceph/osdlocal/osd-kv-ec-cc-md.pan b/sites/example/site/ceph/osdlocal/osd-kv-ec-cc-md.pan index 81a58a9..5af3ea1 100644 --- a/sites/example/site/ceph/osdlocal/osd-kv-ec-cc-md.pan +++ b/sites/example/site/ceph/osdlocal/osd-kv-ec-cc-md.pan @@ -1,36 +1,35 @@ unique template site/ceph/osdlocal/osd-kv-ec-cc-md; -variable CEPH_JOURNAL_PART ?= nlist(); +variable CEPH_JOURNAL_PART ?= dict(); prefix '/software/components/ceph'; 'localdaemons/osds' = { - d=nlist(); - foreach(idx;osdmnt;value('/system/filesystems')) { + d = dict(); + foreach(idx; osdmnt; value('/system/filesystems')) { part = osdmnt['block_device']; disk = replace('([a-zA-Z]+)[0-9]*$', '$1', part); if (match(osdmnt['mountpoint'], '/var/lib/ceph/osd/cache/\w+')){ - d[escape(osdmnt['mountpoint'])] = nlist( + d[escape(osdmnt['mountpoint'])] = dict( 'journal_path', format('/dev/%s%d', disk, CEPH_JOURNAL_PART['cache']), 'crush_weight', weight_of(part), 'labels', list('cache'), - ); + ); } else if (match(osdmnt['mountpoint'], '/var/lib/ceph/osd/md/\w+')){ - d[escape(osdmnt['mountpoint'])] = nlist( + d[escape(osdmnt['mountpoint'])] = dict( 'journal_path', format('/dev/%s%d', disk, CEPH_JOURNAL_PART['md']), 'crush_weight', weight_of(part), 'labels', list('md'), - ); + ); } else if (match(osdmnt['mountpoint'], '/var/lib/ceph/osd/\w+')){ - d[escape(osdmnt['mountpoint'])] = nlist( + d[escape(osdmnt['mountpoint'])] = dict( 'crush_weight', weight_of(part), 'labels', list('ec'), - 'config', nlist( + 'config', dict( 'osd_objectstore', 'keyvaluestore' ) - ); + ); }; }; d; }; - diff --git a/sites/example/site/ceph/osdlocal/simple.pan b/sites/example/site/ceph/osdlocal/simple.pan index 595305d..342dd86 100644 --- a/sites/example/site/ceph/osdlocal/simple.pan +++ b/sites/example/site/ceph/osdlocal/simple.pan @@ -1,21 +1,20 @@ unique template site/ceph/osdlocal/simple; -variable CEPH_JOURNAL_PART ?= nlist(); +variable CEPH_JOURNAL_PART ?= dict(); prefix '/software/components/ceph'; 'localdaemons/osds' = { - d=nlist(); - foreach(idx;osdmnt;value('/system/filesystems')) { + d = dict(); + foreach(idx; osdmnt; value('/system/filesystems')) { part = osdmnt['block_device']; disk = replace('\S+/([a-zA-Z]+)[0-9]*$', '$1', part); if (match(osdmnt['mountpoint'], '/var/lib/ceph/osd/\w+')){ - d[escape(osdmnt['mountpoint'])] = nlist( + d[escape(osdmnt['mountpoint'])] = dict( 'journal_path', format('/dev/%s%d', disk, CEPH_JOURNAL_PART['data']), 'crush_weight', weight_of(part), - ); + ); }; }; d; }; - diff --git a/sites/example/site/ceph/osdschemas/crushmap-cache.pan b/sites/example/site/ceph/osdschemas/crushmap-cache.pan index c19ed83..7057822 100644 --- a/sites/example/site/ceph/osdschemas/crushmap-cache.pan +++ b/sites/example/site/ceph/osdschemas/crushmap-cache.pan @@ -1,16 +1,18 @@ unique template site/ceph/osdschemas/crushmap-cache; +include 'components/ceph/config'; + prefix '/software/components/ceph/clusters/ceph/crushmap'; variable BASE_CHOICES ?= list( - nlist( + dict( 'chtype', 'chooseleaf firstn', 'bktype', 'host', ), ); -'types' = list('osd','host','root'); -'tunables' = nlist( +'types' = list('osd', 'host', 'root'); +'tunables' = dict( 'choose_local_tries', 0, 'choose_local_fallback_tries', 0, 'choose_total_tries', 50, @@ -32,14 +34,12 @@ variable BASE_CHOICES ?= list( 'buckets/0/defaultalg' = 'straw'; 'buckets/0/labels' = list('sas', 'ssd'); 'buckets/0/buckets' = { - t= list(); + t = list(); foreach (idx; host; CEPH_HOSTS) { - append(t, nlist( + append(t, dict( 'name', host, 'type', 'host', - ), - ); + )); }; t; }; - diff --git a/sites/example/site/ceph/osdschemas/crushmap-ec-md-cache.pan b/sites/example/site/ceph/osdschemas/crushmap-ec-md-cache.pan index 829d7b1..dac97e0 100644 --- a/sites/example/site/ceph/osdschemas/crushmap-ec-md-cache.pan +++ b/sites/example/site/ceph/osdschemas/crushmap-ec-md-cache.pan @@ -1,22 +1,24 @@ unique template site/ceph/osdschemas/crushmap-ec-md-cache; +include 'components/ceph/config'; + prefix '/software/components/ceph/clusters/ceph/crushmap'; variable BASE_CHOICES ?= list( - nlist( + dict( 'chtype', 'chooseleaf firstn', 'bktype', 'host', ), ); variable EC_CHOICES ?= list( - nlist( + dict( 'chtype', 'chooseleaf indep', 'bktype', 'host', - ), + ), ); -'types' = list('osd','host','root'); -'tunables' = nlist( +'types' = list('osd', 'host', 'root'); +'tunables' = dict( 'choose_local_tries', 0, 'choose_local_fallback_tries', 0, 'choose_total_tries', 50, @@ -44,16 +46,14 @@ variable EC_CHOICES ?= list( 'buckets/0/name' = 'default'; 'buckets/0/type' = 'root'; -'buckets/0/labels' = list('md','ec','cache'); +'buckets/0/labels' = list('md', 'ec', 'cache'); 'buckets/0/buckets' = { - t= list(); + t = list(); foreach (idx; host; CEPH_HOSTS) { - append(t, nlist( + append(t, dict( 'name', host, 'type', 'host', - ), - ); + )); }; t; }; - diff --git a/sites/example/site/ceph/osdschemas/osd-fetch.pan b/sites/example/site/ceph/osdschemas/osd-fetch.pan index 9eecced..c0c9d4a 100644 --- a/sites/example/site/ceph/osdschemas/osd-fetch.pan +++ b/sites/example/site/ceph/osdschemas/osd-fetch.pan @@ -1,14 +1,16 @@ unique template site/ceph/osdschemas/osd-fetch; +include 'components/ceph/config'; + prefix '/software/components/ceph/clusters/ceph'; variable FETCHED_OSDS = { - t=nlist(); + t = dict(); rep = 2; - foreach(idx;host;CEPH_NODES) { + foreach(idx; host; CEPH_NODES) { prof = replace('.data$', '.os', host); d = value(format('%s:/software/components/ceph/localdaemons/osds', prof)); - t[shorten_fqdn(host)] = nlist( + t[shorten_fqdn(host)] = dict( 'fqdn', host, 'osds', d ); @@ -18,9 +20,9 @@ variable FETCHED_OSDS = { rep = numosd; }; }; - all = nlist('osdhosts', t, 'maxosd', rep); + 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; +variable CEPH_OSD_DOWN_REPORTS ?= CEPH_OSD_DOWN_REPORTERS + CEPH_OSD_DOWN_REPORTERS / 4 + 1; diff --git a/sites/example/site/ceph/server/config.pan b/sites/example/site/ceph/server/config.pan index bba3be7..0ea968a 100644 --- a/sites/example/site/ceph/server/config.pan +++ b/sites/example/site/ceph/server/config.pan @@ -13,7 +13,7 @@ include 'components/ceph/ceph-user'; include 'components/ceph/sudo'; "/software/components/useraccess/users/ceph/ssh_keys" = { - foreach(idx;pubkey;CEPH_DEPLOY_PUBKEYS) { + foreach(idx; pubkey; CEPH_DEPLOY_PUBKEYS) { append(pubkey); }; SELF; @@ -29,38 +29,37 @@ include 'components/ceph/sudo'; }; prefix "/software/packages"; -"{xfsprogs}" = nlist(); -"{xfsdump}" = nlist(); -'mdadm' = nlist(); +"{xfsprogs}" = dict(); +"{xfsdump}" = dict(); +'mdadm' = dict(); function shorten_fqdn = { fqdn = ARGV[0]; short = split('\.', fqdn); short[0]; -}; +}; function shorten_fqdns = { - fqdns = ARGV[0]; - h = list(); - foreach(idx;host;fqdns) { - append(h,shorten_fqdn(host)); - }; - h; + fqdns = ARGV[0]; + h = list(); + foreach(idx; host; fqdns) { + append(h, shorten_fqdn(host)); + }; + h; }; -function weight_of = { +function weight_of = { weight = 0; part = replace('partitions/(\w+)$', '$1', ARGV[0]); if(exists(format('/system/blockdevices/partitions/%s/size', part))) { weight = value(format('/system/blockdevices/partitions/%s/size', part)); } else { - disk = replace('([a-zA-Z]+)\d*', '$1', part); + disk = replace('([a-zA-Z]+)\d*', '$1', part); if(exists(format('/hardware/harddisks/%s/capacity', disk))) { weight = value(format('/hardware/harddisks/%s/capacity', disk)); } else { - error(format("Could not determine weight for osd %s", part)); + error("Could not determine weight for osd %s", part); }; - }; - return(to_double(weight)/(1024*1024)); + }; + to_double(weight) / 1048576; }; - diff --git a/sites/example/site/ceph/server/extra_config_mds.pan b/sites/example/site/ceph/server/extra_config_mds.pan index d2f4327..67dde84 100644 --- a/sites/example/site/ceph/server/extra_config_mds.pan +++ b/sites/example/site/ceph/server/extra_config_mds.pan @@ -1,12 +1,10 @@ unique template site/ceph/server/extra_config_mds; -include { 'components/cron/config' }; -"/software/components/cron/entries" = { - push(nlist( - "name","radosdf", - "user","root", - "frequency", "7,22,37,52 * * * *", - "command", "(date --iso-8601=seconds --utc; /usr/bin/rados df; /usr/bin/ceph df; /bin/ps -F -C ceph-mds) >> /var/log/radosdf.log 2>&1", - )); -}; +include 'components/cron/config'; +"/software/components/cron/entries" = append(dict( + "name", "radosdf", + "user", "root", + "frequency", "7, 22, 37, 52 * * * *", + "command", "date --iso-8601=seconds --utc; /usr/bin/rados df; /usr/bin/ceph df; /bin/ps -F -C ceph-mds", +)); diff --git a/sites/example/site/ceph/server/infernalis.pan b/sites/example/site/ceph/server/infernalis.pan index de5da99..7f344e1 100644 --- a/sites/example/site/ceph/server/infernalis.pan +++ b/sites/example/site/ceph/server/infernalis.pan @@ -1,16 +1,19 @@ unique template site/ceph/server/infernalis; -"/software/components/dirperm/paths" = { +include 'components/dirperm/config'; +include 'components/metaconfig/config'; + +"/software/components/dirperm/paths" = { foreach (idx; mp; value('/system/filesystems')) { - if (match(mp['mountpoint'], format('^%s', CEPH_OSD_MP_BASE))){ - append(dict( - "path", mp['mountpoint'], - "owner", "ceph:ceph", - "perm", "0755", - "type", "d", - )); + if (match(mp['mountpoint'], format('^%s', CEPH_OSD_MP_BASE))) { + append(SELF, dict( + "path", mp['mountpoint'], + "owner", "ceph:ceph", + "perm", "0755", + "type", "d", + )); }; - }; + }; SELF; }; @@ -18,4 +21,3 @@ include 'common/sysctl/service'; prefix "/software/components/metaconfig/services/{/etc/sysctl.conf}/contents"; 'kernel.pid_max' = 4194303; - diff --git a/sites/example/site/config.pan b/sites/example/site/config.pan index ad4ec4e..8a477bd 100644 --- a/sites/example/site/config.pan +++ b/sites/example/site/config.pan @@ -1,7 +1,7 @@ unique template site/config; -include { 'quattor/functions/filesystem' }; +include 'quattor/functions/filesystem'; # # The host for the quattor server. @@ -21,35 +21,38 @@ variable OS_BASE_CONFIG_SITE ?= 'site/config/network'; # ntpd -# ---------------------------------------------------------------------------- -include { 'components/ntpd/config' }; +# ---------------------------------------------------------------------------- +include 'components/ntpd/config'; "/software/components/ntpd/servers" = list("orsay1.lal.in2p3.fr"); # chkconfig -# ---------------------------------------------------------------------------- -include { 'components/chkconfig/config' }; +# ---------------------------------------------------------------------------- +include 'components/chkconfig/config'; "/software/components/chkconfig/service/ntpd/on" = ""; #"/software/components/chkconfig/service/yum/off" = ""; # logrotate -# ---------------------------------------------------------------------------- -include { 'components/altlogrotate/config' }; - -"/software/components/altlogrotate/entries/global" = - nlist("global", true, - "frequency", "weekly", - "rotate", 4, - "create", true, - "compress", true, - "include", "/etc/logrotate.d"); - -"/software/components/altlogrotate/entries/wtmp" = - nlist("global", true, - "pattern", "/var/log/wtmp", - "frequency", "monthly", - "rotate", 1, - "create", true, - "createparams", - nlist("mode", "0664", - "owner", "root", - "group", "utmp")); +# ---------------------------------------------------------------------------- +include 'components/altlogrotate/config'; + +"/software/components/altlogrotate/entries/global" = dict( + "global", true, + "frequency", "weekly", + "rotate", 4, + "create", true, + "compress", true, + "include", "/etc/logrotate.d", +); + +"/software/components/altlogrotate/entries/wtmp" = dict( + "global", true, + "pattern", "/var/log/wtmp", + "frequency", "monthly", + "rotate", 1, + "create", true, + "createparams", dict( + "mode", "0664", + "owner", "root", + "group", "utmp", + ), +); diff --git a/sites/example/site/config/network.pan b/sites/example/site/config/network.pan index 1ec9f10..e53027a 100644 --- a/sites/example/site/config/network.pan +++ b/sites/example/site/config/network.pan @@ -5,7 +5,7 @@ unique template site/config/network; # Defined to true by OS templates supporting it variable OS_BASE_CONFIGURE_NETWORK ?= false; -include { 'quattor/functions/filesystem' }; +include 'quattor/functions/filesystem'; # # Network (IP) configuration @@ -13,13 +13,10 @@ include { 'quattor/functions/filesystem' }; # the network (old generation OS templates) # variable SITE_NETWORK_CONFIG_TEMPLATE = if ( !OS_BASE_CONFIGURE_NETWORK ) { - # To work around OS base config that don't configure - # the network (old generation OS templates) - 'os/network/config'; - } else { - null; - }; -include { SITE_NETWORK_CONFIG_TEMPLATE }; - - - + # To work around OS base config that don't configure + # the network (old generation OS templates) + 'os/network/config'; +} else { + null; +}; +include SITE_NETWORK_CONFIG_TEMPLATE; diff --git a/sites/example/site/databases.pan b/sites/example/site/databases.pan index 7b27abe..6583311 100644 --- a/sites/example/site/databases.pan +++ b/sites/example/site/databases.pan @@ -11,78 +11,78 @@ unique template site/databases; -# Defines the mapping between the full hostname and the IP -# address. +# Defines the mapping between the full hostname and the IP +# address. final variable DB_IP = dict( - escape("apel.example.org"),"192.168.0.4", - escape("bdii.example.org"),"192.168.0.1", - escape("ce.example.org"),"192.168.0.2", - escape("dcache-head.example.org"),"192.168.0.17", - escape("dcache-pool.example.org"),"192.168.0.18", - escape("lfc.example.org"),"192.168.0.3", - escape("px.example.org"),"192.168.0.6", - escape("rb.example.org"),"192.168.0.7", - escape("se-dpm-disk.example.org"),"192.168.0.9", - escape("se-dpm-disk2.example.org"),"192.168.0.10", - escape("se-dpm-server.example.org"),"192.168.0.11", - escape("topbdii.example.org"),"192.168.0.12", - escape("ui.example.org"),"192.168.0.13", - escape("wmslb.example.org"),"192.168.0.14", - escape("wn.example.org"),"192.168.0.15", - escape("wn2.example.org"),"192.168.0.16", - escape("wn3.example.org"),"192.168.0.21", - escape("xen-host.example.org"),"192.168.0.17", - escape("xen-guest.example.org"),"192.168.0.18", - escape("nagios-master.example.org"),"192.168.0.19", - escape("nagios-slave-A.example.org"),"192.168.0.20", - escape("nagios-slave-B.example.org"),"192.168.0.25", - escape("hydra.example.org"),"192.168.0.21", - escape("cream.example.org"),"192.168.0.22", - escape("argus.example.org"),"192.168.0.23", - escape("one.example.org"),"192.168.0.24", - escape("hyp01.example.org"), "192.168.0.25", - escape("vm.example.org"), "192.168.0.26", - escape("cloud-controller.example.org"),"192.168.10.8", - escape("network-node.example.org"),"192.168.0.30", - escape("compute-node.example.org"),"192.168.0.32", + escape("apel.example.org"), "192.168.0.4", + escape("bdii.example.org"), "192.168.0.1", + escape("ce.example.org"), "192.168.0.2", + escape("dcache-head.example.org"), "192.168.0.17", + escape("dcache-pool.example.org"), "192.168.0.18", + escape("lfc.example.org"), "192.168.0.3", + escape("px.example.org"), "192.168.0.6", + escape("rb.example.org"), "192.168.0.7", + escape("se-dpm-disk.example.org"), "192.168.0.9", + escape("se-dpm-disk2.example.org"), "192.168.0.10", + escape("se-dpm-server.example.org"), "192.168.0.11", + escape("topbdii.example.org"), "192.168.0.12", + escape("ui.example.org"), "192.168.0.13", + escape("wmslb.example.org"), "192.168.0.14", + escape("wn.example.org"), "192.168.0.15", + escape("wn2.example.org"), "192.168.0.16", + escape("wn3.example.org"), "192.168.0.21", + escape("xen-host.example.org"), "192.168.0.17", + escape("xen-guest.example.org"), "192.168.0.18", + escape("nagios-master.example.org"), "192.168.0.19", + escape("nagios-slave-A.example.org"), "192.168.0.20", + escape("nagios-slave-B.example.org"), "192.168.0.25", + escape("hydra.example.org"), "192.168.0.21", + escape("cream.example.org"), "192.168.0.22", + escape("argus.example.org"), "192.168.0.23", + escape("one.example.org"), "192.168.0.24", + escape("hyp01.example.org"), "192.168.0.25", + escape("vm.example.org"), "192.168.0.26", + escape("cloud-controller.example.org"), "192.168.10.8", + escape("network-node.example.org"), "192.168.0.30", + escape("compute-node.example.org"), "192.168.0.32", ); # Defines the mapping between the full hostname and the -# physical machine. +# physical machine. # A different hardware template must be used for each machine final variable DB_MACHINE = dict( - escape("apel.example.org"),"hardware/machine/200/48/Dell2/33", - escape("argus.example.org"),"hardware/machine/200/49/Ibm1/43", - escape("bdii.example.org"),"hardware/machine/200/49/Hp1/30", - escape("ce.example.org"),"hardware/machine/200/49/Ibm1/39", - escape("cream.example.org"),"hardware/machine/200/49/Ibm1/42", - escape("dcache-head.example.org"),"hardware/machine/200/49/Ibm1/40", - escape("dcache-pool.example.org"),"hardware/machine/200/49/Ibm1/41", - escape("hydra.example.org"),"hardware/machine/200/48/Dell2/32", - escape("lfc.example.org"),"hardware/machine/200/48/Dell2/32", - escape("nagios-master.example.org"),"hardware/machine/200/49/Hp1/30", - escape("nagios-slave-A.example.org"),"hardware/machine/200/49/Hp1/30", - escape("nagios-slave-B.example.org"),"hardware/machine/200/49/Hp1/30", - escape("px.example.org"),"hardware/machine/200/48/Dell2/35", - escape("rb.example.org"),"hardware/machine/200/48/Dell2/36", - escape("se-classic.example.org"),"hardware/machine/200/48/Dell2/37", - escape("se-dpm-disk.example.org"),"hardware/machine/200/48/Dell2/38", - escape("se-dpm-disk2.example.org"),"hardware/machine/200/48/Dell2/39", - escape("se-dpm-server.example.org"),"hardware/machine/200/48/Dell2/40", - escape("topbdii.example.org"),"hardware/machine/200/48/Dell2/41", - escape("ui.example.org"),"hardware/machine/200/49/Hp1/31", - escape("wmslb.example.org"),"hardware/machine/200/49/Hp1/32", - escape("wn.example.org"),"hardware/machine/200/49/Hp1/32", - escape("wn2.example.org"),"hardware/machine/200/49/Hp1/33", - escape("wn3.example.org"),"hardware/machine/200/49/Hp1/34", - escape("xen-host.example.org"),"hardware/machine/200/49/Hp1/33", - escape("xen-guest.example.org"),"hardware/machine/xen/base", - escape("one.example.org"),"hardware/machine/ibm/x3550/x_KDXXXX", - escape("hyp01.example.org"),"hardware/machine/ibm/hs21xm/blade_99HXXXX", - escape("vm.example.org"), "hardware/machine/one/example", - escape("cloud-controller.example.org"),"hardware/machine/200/48/Dell2/42", - escape("network-node.example.org"),"hardware/machine/200/48/Dell2/43", - escape("compute-node.example.org"),"hardware/machine/200/48/Dell2/44", + escape("apel.example.org"), "hardware/machine/200/48/Dell2/33", + escape("argus.example.org"), "hardware/machine/200/49/Ibm1/43", + escape("bdii.example.org"), "hardware/machine/200/49/Hp1/30", + escape("ce.example.org"), "hardware/machine/200/49/Ibm1/39", + escape("cream.example.org"), "hardware/machine/200/49/Ibm1/42", + escape("dcache-head.example.org"), "hardware/machine/200/49/Ibm1/40", + escape("dcache-pool.example.org"), "hardware/machine/200/49/Ibm1/41", + escape("hydra.example.org"), "hardware/machine/200/48/Dell2/32", + escape("lfc.example.org"), "hardware/machine/200/48/Dell2/32", + escape("nagios-master.example.org"), "hardware/machine/200/49/Hp1/30", + escape("nagios-slave-A.example.org"), "hardware/machine/200/49/Hp1/30", + escape("nagios-slave-B.example.org"), "hardware/machine/200/49/Hp1/30", + escape("px.example.org"), "hardware/machine/200/48/Dell2/35", + escape("rb.example.org"), "hardware/machine/200/48/Dell2/36", + escape("se-classic.example.org"), "hardware/machine/200/48/Dell2/37", + escape("se-dpm-disk.example.org"), "hardware/machine/200/48/Dell2/38", + escape("se-dpm-disk2.example.org"), "hardware/machine/200/48/Dell2/39", + escape("se-dpm-server.example.org"), "hardware/machine/200/48/Dell2/40", + escape("topbdii.example.org"), "hardware/machine/200/48/Dell2/41", + escape("ui.example.org"), "hardware/machine/200/49/Hp1/31", + escape("wmslb.example.org"), "hardware/machine/200/49/Hp1/32", + escape("wn.example.org"), "hardware/machine/200/49/Hp1/32", + escape("wn2.example.org"), "hardware/machine/200/49/Hp1/33", + escape("wn3.example.org"), "hardware/machine/200/49/Hp1/34", + escape("xen-host.example.org"), "hardware/machine/200/49/Hp1/33", + escape("xen-guest.example.org"), "hardware/machine/xen/base", + escape("one.example.org"), "hardware/machine/ibm/x3550/x_KDXXXX", + escape("hyp01.example.org"), "hardware/machine/ibm/hs21xm/blade_99HXXXX", + escape("vm.example.org"), "hardware/machine/one/example", + escape("cloud-controller.example.org"), "hardware/machine/200/48/Dell2/42", + escape("network-node.example.org"), "hardware/machine/200/48/Dell2/43", + escape("compute-node.example.org"), "hardware/machine/200/48/Dell2/44", ); include "site/xen/db"; diff --git a/sites/example/site/dcache/batch.pan b/sites/example/site/dcache/batch.pan index 9829ae5..aff387f 100644 --- a/sites/example/site/dcache/batch.pan +++ b/sites/example/site/dcache/batch.pan @@ -1,5 +1,7 @@ unique template site/dcache/batch; +include 'components/dcache/config'; + ## config file to modify batch files variable DCACHE_GRIDFTP_PARALLEL_STREAMS = "10"; variable DCACHE_BUFFERSIZE = "2097152"; @@ -10,53 +12,57 @@ variable SET_PRIVATE_IF_CONV ?= false; ## configure the gsiftpdoor adaptor for the gridftp doors "/software/components/dcache/batch/create" = { - result = list(); - if (DOOR_GRIDFTP == 'yes') { - if (SET_PRIVATE_IF_CONV) { - result[length(result)] = - nlist('batchname','gridftpdoor', - 'cell','dmg.cells.services.login.LoginManager', - 'name','GFTP-${thisHostname}', - 'context', - nlist('gsiftpAdapterInternalInterface',DB_IP[escape(FULL_HOSTNAME)]), - 'opt', - nlist('listen','${gsiftpAdapterInternalInterface}'), - ) - ; - }; - result[length(result)] = - nlist('batchname','gridftpdoor', - 'cell','dmg.cells.services.login.LoginManager', - 'name','GFTP-${thisHostname}', - 'context',nlist('gsiftpIoQueue','""', - 'gsiftpMaxStreamsPerClient',DCACHE_GRIDFTP_PARALLEL_STREAMS) - ); - }; - - if (DOOR_SRM == 'yes') { - result[length(result)] = - nlist('batchname','srm', - 'cell','diskCacheV111.util.ThreadManager', - 'name','ThreadManager', - 'context',nlist('remoteGsiftpIoQueue','""', - 'remoteGsiftpMaxTransfers', '100', - 'parallelStreams',DCACHE_GRIDFTP_PARALLEL_STREAMS, - 'srmBufferSize' , DCACHE_BUFFERSIZE, - 'srmTcpBufferSize', DCACHE_TCP_BUFFERSIZE, - ) - ); - }; - - if (DCACHE_NODE_TYPE == 'pool') { - result[length(result)] = - nlist('batchname','pool', - 'cell','diskCacheV111.pools.MultiProtocolPool2', - 'name','${0}', - 'context',nlist('poolIoQueue','"default,gsiftp,dcap"' - ) - ); - }; - - return(result); -}; + result = list(); + if (DOOR_GRIDFTP == 'yes') { + if (SET_PRIVATE_IF_CONV) { + result[length(result)] = dict( + 'batchname', 'gridftpdoor', + 'cell', 'dmg.cells.services.login.LoginManager', + 'name', 'GFTP-${thisHostname}', + 'context', dict( + 'gsiftpAdapterInternalInterface', DB_IP[escape(FULL_HOSTNAME)], + ), + 'opt', dict( + 'listen', '${gsiftpAdapterInternalInterface}', + ), + ); + }; + result[length(result)] = dict( + 'batchname', 'gridftpdoor', + 'cell', 'dmg.cells.services.login.LoginManager', + 'name', 'GFTP-${thisHostname}', + 'context', dict( + 'gsiftpIoQueue', '""', + 'gsiftpMaxStreamsPerClient', DCACHE_GRIDFTP_PARALLEL_STREAMS, + ) + ); + }; + + if (DOOR_SRM == 'yes') { + result[length(result)] = dict( + 'batchname', 'srm', + 'cell', 'diskCacheV111.util.ThreadManager', + 'name', 'ThreadManager', + 'context', dict( + 'remoteGsiftpIoQueue', '""', + 'remoteGsiftpMaxTransfers', '100', + 'parallelStreams', DCACHE_GRIDFTP_PARALLEL_STREAMS, + 'srmBufferSize', DCACHE_BUFFERSIZE, + 'srmTcpBufferSize', DCACHE_TCP_BUFFERSIZE, + ), + ); + }; + if (DCACHE_NODE_TYPE == 'pool') { + result[length(result)] = dict( + 'batchname', 'pool', + 'cell', 'diskCacheV111.pools.MultiProtocolPool2', + 'name', '${0}', + 'context', dict( + 'poolIoQueue', '"default, gsiftp, dcap"' + ), + ); + }; + + return(result); +}; diff --git a/sites/example/site/dcache/link.pan b/sites/example/site/dcache/link.pan index ffd758a..1655875 100644 --- a/sites/example/site/dcache/link.pan +++ b/sites/example/site/dcache/link.pan @@ -1,20 +1,55 @@ unique template site/dcache/link; +include 'components/dcache/config'; ## links ## default preference value "/software/components/dcache/link/def_pref" = "10"; ## list of links that will be ignored during configuration "/software/components/dcache/link/ignore_link" = list(); -## -"/software/components/dcache/link/links"= nlist( - ## out_buf_write: all outside to write to the storage through this buffer - "out",nlist("ugroup",list("all_net","any_store"),"pgroup",list("out_buf"),"read","10","write","10","cache","10"), - "in",nlist("ugroup",list("in_net","any_store"),"pgroup",list("priv"),"read","20","write","20","cache","20"), - "dteam",nlist("ugroup",list("dteam_store"),"pgroup",list("out_buf"),"read","10","write","10","cache","10"), - "ops",nlist("ugroup",list("ops_store"),"pgroup",list("out_buf"),"read","10","write","10","cache","10"), - "cms",nlist("ugroup",list("cms_store"),"pgroup",list("out_buf"),"read","10","write","10","cache","10"), - "test",nlist("ugroup",list("test_store"),"pgroup",list("behar_test"),"read","10","write","10","cache","10"), -); - - +## +"/software/components/dcache/link/links" = dict( + ## out_buf_write: all outside to write to the storage through this buffer + "out", dict( + "ugroup", list("all_net", "any_store"), + "pgroup", list("out_buf"), + "read", "10", + "write", "10", + "cache", "10", + ), + "in", dict( + "ugroup", list("in_net", "any_store"), + "pgroup", list("priv"), + "read", "20", + "write", "20", + "cache", "20", + ), + "dteam", dict( + "ugroup", list("dteam_store"), + "pgroup", list("out_buf"), + "read", "10", + "write", "10", + "cache", "10", + ), + "ops", dict( + "ugroup", list("ops_store"), + "pgroup", list("out_buf"), + "read", "10", + "write", "10", + "cache", "10", + ), + "cms", dict( + "ugroup", list("cms_store"), + "pgroup", list("out_buf"), + "read", "10", + "write", "10", + "cache", "10", + ), + "test", dict( + "ugroup", list("test_store"), + "pgroup", list("behar_test"), + "read", "10", + "write", "10", + "cache", "10", + ), +); diff --git a/sites/example/site/dcache/node_config.pan b/sites/example/site/dcache/node_config.pan index bf67541..8443ea1 100644 --- a/sites/example/site/dcache/node_config.pan +++ b/sites/example/site/dcache/node_config.pan @@ -1,55 +1,55 @@ unique template site/dcache/node_config; +include 'components/dcache/config'; + ## ## General dcache config info ## -## for the adventurous people, make sure to also change PNFS_ROOT ;) +## for the adventurous people, make sure to also change PNFS_ROOT; ) #"/software/components/dcache/config/dc_dir" = "/opt/d-cache"; "/software/components/dcache/config/node_config_def" = list("etc/node_config.template"); -variable NODE_CF ?= nlist( - "node_type",DCACHE_NODE_TYPE, - "server_id",DCACHE_SERVER_ID, - "admin_node",SE_DCACHE, - "gsidcap",DOOR_GSIDCAP, - "gridftp",DOOR_GRIDFTP, - "srm",DOOR_SRM, - "dcap",DOOR_DCAP, - "xrootd",DOOR_XROOTD, +variable NODE_CF ?= dict( + "node_type", DCACHE_NODE_TYPE, + "server_id", DCACHE_SERVER_ID, + "admin_node", SE_DCACHE, + "gsidcap", DOOR_GSIDCAP, + "gridftp", DOOR_GRIDFTP, + "srm", DOOR_SRM, + "dcap", DOOR_DCAP, + "xrootd", DOOR_XROOTD, ); -variable NOT_AN_ADMIN_NODE ?= nlist( - "lmDomain" , "no", - "httpDomain" , "no", - "pnfsManager" , "no", - "adminDoor" , "no", - "poolManager" , "no", - "utilityDomain" , "no", - "dirDomain" , "no", - "gPlazmaService" , "no", - "infoProvider", "no", -); +variable NOT_AN_ADMIN_NODE ?= dict( + "lmDomain", "no", + "httpDomain", "no", + "pnfsManager", "no", + "adminDoor", "no", + "poolManager", "no", + "utilityDomain", "no", + "dirDomain", "no", + "gPlazmaService", "no", + "infoProvider", "no", +); "/software/components/dcache/config/node_config" = { - if(DCACHE_NODE_TYPE == "admin") { - return( - merge(NODE_CF,nlist( - "infoProvider", "yes", - "gPlazmaService" , "yes", - ))); - } else { - list = NODE_CF; - list2 = NOT_AN_ADMIN_NODE; - ok = first(list2,k,v); - while(ok) { - list[k] = v; - ok = next(list2,k,v); - }; - return(list); - }; -}; - + if(DCACHE_NODE_TYPE == "admin") { + return(merge(NODE_CF, dict( + "infoProvider", "yes", + "gPlazmaService", "yes", + ))); + } else { + list = NODE_CF; + list2 = NOT_AN_ADMIN_NODE; + ok = first(list2, k, v); + while(ok) { + list[k] = v; + ok = next(list2, k, v); + }; + return(list); + }; +}; diff --git a/sites/example/site/dcache/pnfs.pan b/sites/example/site/dcache/pnfs.pan index e8d5b3b..37396e6 100644 --- a/sites/example/site/dcache/pnfs.pan +++ b/sites/example/site/dcache/pnfs.pan @@ -1,11 +1,13 @@ unique template site/dcache/pnfs; +include 'components/dcache/config'; + ## currently, this is the only possible value ## variable PNFS_ROOT = "/pnfs"; -## in case you really want to change it, make sure to modify it in +## in case you really want to change it, make sure to modify it in ## pnfs/pnfs_config, pnfs/exports, config/node_config, config/dCacheSetup -## +## ## pnfs config ## @@ -15,86 +17,146 @@ unique template site/dcache/pnfs; ## the default values are parsed before the new ones, so current files can be used "/software/components/dcache/pnfs/pnfs_config_def" = list("etc/pnfs_config.template"); -"/software/components/dcache/pnfs/pnfs_config" = nlist( -# "pnfs_root",PNFS_ROOT - "pnfs_log",DCACHE_LOG_DIR, +"/software/components/dcache/pnfs/pnfs_config" = dict( + # "pnfs_root", PNFS_ROOT + "pnfs_log", DCACHE_LOG_DIR, ); "/software/components/dcache/pnfs/pnfs_setup_def" = list("pnfsSetup"); -"/software/components/dcache/pnfs/pnfs_setup" = nlist( - "shmservers","20" +"/software/components/dcache/pnfs/pnfs_setup" = dict( + "shmservers", "20" ); ## for exports: ip either is host-address or subnet (+netmask) "/software/components/dcache/pnfs/exports" = list( - nlist("ip","193.190.246.0", - "netmask","255.255.255.0", - "rule",list(nlist("mount","/pnfs","path","/0/root/fs/usr/","perm","30","opt","nooptions") - )), - nlist("ip","192.168.10.0", - "netmask","255.255.255.0", - "rule",list(nlist("mount","/pnfsdoors","path","/0/root/fs/usr/","perm","0","opt","nooptions") - )), - nlist("ip","193.190.246.232", - "rule",list(nlist("mount","/pnfsdoors","path","/0/root/fs/usr/","perm","0","opt","nooptions") - )), - nlist("ip","193.190.246.222", - "rule",list(nlist("mount","/pnfsdoors","path","/0/root/fs/usr/","perm","0","opt","nooptions") - )), - nlist("ip","193.190.246.281", - "rule",list(nlist("mount","/pnfsdoors","path","/0/root/fs/usr/","perm","0","opt","nooptions") - )), - nlist("ip","193.190.246.202", - "rule",list(nlist("mount","/pnfsdoors","path","/0/root/fs/usr/","perm","0","opt","nooptions") - )), - nlist("ip","193.190.246.92", - "rule",list(nlist("mount","/pnfsdoors","path","/0/root/fs/usr/","perm","0","opt","nooptions") - )), - nlist("ip","193.190.246.203", - "rule",list(nlist("mount","/pnfsdoors","path","/0/root/fs/usr/","perm","0","opt","nooptions") - )), - nlist("ip","192.168.10.6", - "rule",list(nlist("mount","/pnfs","path","/0/root/fs/usr/","perm","30","opt","nooptions") - )), - nlist("ip","192.168.10.16", - "rule",list(nlist("mount","/pnfs","path","/0/root/fs/usr/","perm","30","opt","nooptions") - )), - nlist("ip","192.168.10.18", - "rule",list(nlist("mount","/pnfs","path","/0/root/fs/usr/","perm","30","opt","nooptions") - )), - nlist("ip","192.168.10.19", - "rule",list(nlist("mount","/pnfs","path","/0/root/fs/usr/","perm","30","opt","nooptions") - )), - nlist("ip","192.168.0.0", - "netmask","255.255.0.0", - "rule",list(nlist("mount","/pnfs","path","/0/root/fs/usr/","perm","30","opt","nooptions") - )), - nlist("ip","127.0.0.1", - "rule",list(nlist("mount","/fs","path","/0/root/fs","perm","0","opt","nooptions"), - nlist("mount","/admin","path","/0/root/fs/admin","perm","0","opt","nooptions"))) -); + dict( + "ip", "193.190.246.0", + "netmask", "255.255.255.0", + "rule", list( + dict("mount", "/pnfs", "path", "/0/root/fs/usr/", "perm", "30", "opt", "nooptions"), + ), + ), + dict( + "ip", "192.168.10.0", + "netmask", "255.255.255.0", + "rule", list( + dict("mount", "/pnfsdoors", "path", "/0/root/fs/usr/", "perm", "0", "opt", "nooptions"), + ), + ), + dict( + "ip", "193.190.246.232", + "rule", list( + dict("mount", "/pnfsdoors", "path", "/0/root/fs/usr/", "perm", "0", "opt", "nooptions"), + ), + ), + dict( + "ip", "193.190.246.222", + "rule", list( + dict("mount", "/pnfsdoors", "path", "/0/root/fs/usr/", "perm", "0", "opt", "nooptions"), + ), + ), + dict( + "ip", "193.190.246.281", + "rule", list( + dict("mount", "/pnfsdoors", "path", "/0/root/fs/usr/", "perm", "0", "opt", "nooptions"), + ), + ), + dict( + "ip", "193.190.246.202", + "rule", list( + dict("mount", "/pnfsdoors", "path", "/0/root/fs/usr/", "perm", "0", "opt", "nooptions"), + ), + ), + dict( + "ip", "193.190.246.92", + "rule", list( + dict("mount", "/pnfsdoors", "path", "/0/root/fs/usr/", "perm", "0", "opt", "nooptions"), + ), + ), + dict( + "ip", "193.190.246.203", + "rule", list( + dict("mount", "/pnfsdoors", "path", "/0/root/fs/usr/", "perm", "0", "opt", "nooptions"), + ), + ), + dict( + "ip", "192.168.10.6", + "rule", list( + dict("mount", "/pnfs", "path", "/0/root/fs/usr/", "perm", "30", "opt", "nooptions"), + ), + ), + dict( + "ip", "192.168.10.16", + "rule", list( + dict("mount", "/pnfs", "path", "/0/root/fs/usr/", "perm", "30", "opt", "nooptions"), + ), + ), + dict( + "ip", "192.168.10.18", + "rule", list( + dict("mount", "/pnfs", "path", "/0/root/fs/usr/", "perm", "30", "opt", "nooptions"), + ), + ), + dict( + "ip", "192.168.10.19", + "rule", list( + dict("mount", "/pnfs", "path", "/0/root/fs/usr/", "perm", "30", "opt", "nooptions"), + ), + ), + dict( + "ip", "192.168.0.0", + "netmask", "255.255.0.0", + "rule", list( + dict("mount", "/pnfs", "path", "/0/root/fs/usr/", "perm", "30", "opt", "nooptions"), + ), + ), + dict( + "ip", "127.0.0.1", + "rule", list( + dict("mount", "/fs", "path", "/0/root/fs", "perm", "0", "opt", "nooptions"), + dict("mount", "/admin", "path", "/0/root/fs/admin", "perm", "0", "opt", "nooptions"), + ), + ), +); ## databases for pnfs ## path: either relative (from /PNFS_ROOT/DCACHE_SERVER_ID/) or absolute. ## for all vo: vo + vo/generated ## the generated part is overkill atm -#variable VOS_TMP = list("betest","becms","beapps","cms","dteam"); +#variable VOS_TMP = list("betest", "becms", "beapps", "cms", "dteam"); "/software/components/dcache/pnfs/databases" = { - list = VOS; - if (exists(SELF) && is_list(SELF)) { - tbl = SELF; - } else { - tbl = list(); - }; - ok = first(list,k,v); - while (ok) { - tbl[length(tbl)] = nlist("name",v,"path",v,"user",VO_INFO[v]['prefix']+"001","group",v,"perm","0755"); - tbl[length(tbl)] = nlist("name",v+"-gen","path",v+"/generated","user",VO_INFO[v]['prefix']+"001","group",v,"perm","0755"); - ok = next(list,k,v); - }; - return(tbl); + list = VOS; + if (exists(SELF) && is_list(SELF)) { + tbl = SELF; + } else { + tbl = list(); + }; + ok = first(list, k, v); + while (ok) { + tbl[length(tbl)] = dict( + "name", v, + "path", v, + "user", VO_INFO[v]['prefix'] + "001", + "group", v, + "perm", "0755", + ); + tbl[length(tbl)] = dict( + "name", v + "-gen", + "path", v + "/generated", + "user", VO_INFO[v]['prefix'] + "001", + "group", v, + "perm", "0755", + ); + ok = next(list, k, v); + }; + return(tbl); }; -"/software/components/dcache/pnfs/databases" = push( - nlist("name","cms-phedex","path","cms/ph","user","cms001","group","cms","perm","0755") -); + +"/software/components/dcache/pnfs/databases" = push(dict( + "name", "cms-phedex", + "path", "cms/ph", + "user", "cms001", + "group", "cms", + "perm", "0755", +)); diff --git a/sites/example/site/dcache/pools.pan b/sites/example/site/dcache/pools.pan index e58faf3..97cee26 100644 --- a/sites/example/site/dcache/pools.pan +++ b/sites/example/site/dcache/pools.pan @@ -1,10 +1,12 @@ unique template site/dcache/pools; +include 'components/dcache/config'; + ## ## Pool config ## -## ulimit_n can also be set per pool +## ulimit_n can also be set per pool ## (only the last value of every list of pools per poolnode is taken into account!!) "/software/components/dcache/pool/default_ulimit_n" = "16384"; @@ -14,51 +16,65 @@ unique template site/dcache/pools; ## if not set, the default is 950 (=95%) "/software/components/dcache/pool/max_true_pool_size_prom" = "990"; -## ignore_pgroup are pgroups that are ignored during config. +## ignore_pgroup are pgroups that are ignored during config. ## pgroups that are not in this list or configured here otherwise, will be deleted. variable CMS_VOS = list("cms"); variable NON_CMS_VOS = { - tbl = VOS; - tbl2 = CMS_VOS; - tbl3 = list(); - ok = first(tbl,k,v); - while (ok) { - ok2 = first(tbl2,k2,v2); - while (ok2) { - add = true; - if(match(v,v2)) { - add = false; - }; - if(add) { - tbl3[length(tbl)] = v; - }; - ok2 = next(tbl2,k2,v2); - }; - ok = next(tbl,k,v); - }; - return(tbl3); - }; + tbl = VOS; + tbl2 = CMS_VOS; + tbl3 = list(); + ok = first(tbl, k, v); + while (ok) { + ok2 = first(tbl2, k2, v2); + while (ok2) { + add = true; + if(match(v, v2)) { + add = false; + }; + if(add) { + tbl3[length(tbl)] = v; + }; + ok2 = next(tbl2, k2, v2); + }; + ok = next(tbl, k, v); + }; + return(tbl3); +}; "/software/components/dcache/pool/ignore_pgroup" = list("default"); -"/software/components/dcache/pool/pools"=nlist( - ## out_buf pgroup: for outside buffer reading and writing - #"behar",list(nlist("path","/storage/1","pgroup",merge(CMS_VOS,list("out_buf")),"mover_max","1000"), - # nlist("path","/storage/2","pgroup",merge(CMS_VOS,list("out_buf")),"mover_max","1000"), - # nlist("path","/storage/3","pgroup",merge(CMS_VOS,list("out_buf")),"mover_max","1000")), - "dcache-pool",list(nlist("path","/storage/1","pgroup",merge(list("out_buf","behar_test")),"mover_max","1000"), - nlist("path","/storage/2","pgroup",merge(list("out_buf","behar_test")),"mover_max","1000"), - ), - +"/software/components/dcache/pool/pools" = dict( + ## out_buf pgroup: for outside buffer reading and writing + #"behar", list(dict("path", "/storage/1", "pgroup", merge(CMS_VOS, list("out_buf")), "mover_max", "1000"), + # dict("path", "/storage/2", "pgroup", merge(CMS_VOS, list("out_buf")), "mover_max", "1000"), + # dict("path", "/storage/3", "pgroup", merge(CMS_VOS, list("out_buf")), "mover_max", "1000")), + "dcache-pool", list( + dict( + "path", "/storage/1", + "pgroup", merge(SELF, list( + "out_buf", + "behar_test", + )), + "mover_max", "1000", + ), + dict( + "path", "/storage/2", + "pgroup", merge(SELF, list( + "out_buf", + "behar_test", + )), + "mover_max", "1000", + ), + ), ); #"/software/components/dcache/pool/pools"= { -# tbl = SELF; -# list = WN_DACHE_POOLS; -# ok = first(list,k,v); -# while (ok) { -# m = matches(v,"([^\\.]+)(\\.(.*))?"); -# tbl[m[1]] = list(nlist("path","/scratch/1","size","125","pgroup",list("wn_pool","ResilientPools"),"mover_max","1000")); -# ok = next(list,k,v); -# }; +# tbl = SELF; +# list = WN_DACHE_POOLS; +# ok = first(list, k, v); +# while (ok) { +# m = matches(v, "([^\\.]+)(\\.(.*))?"); +# tbl[m[1]] = list(dict("path", "/scratch/1", "size", "125", "pgroup", list("wn_pool", "ResilientPools"), "mover_max", "1000")); +# ok = next(list, k, v); +# }; # return(tbl); #}; diff --git a/sites/example/site/dcache/sitename.pan b/sites/example/site/dcache/sitename.pan index 03df4c9..1ae3d8f 100644 --- a/sites/example/site/dcache/sitename.pan +++ b/sites/example/site/dcache/sitename.pan @@ -1,12 +1,12 @@ unique template site/dcache/sitename; -## set this in the variable +## set this in the variable ## variable SEDCACHE_CONFIG_SITE = "dcache/sitename"; ## name of the admin node variable SE_DCACHE = "dcache-head.example.org"; -## /pnfs/DCACHE_SERVER_ID +## /pnfs/DCACHE_SERVER_ID variable DCACHE_SERVER_ID = "example"; ## namespace to look for DCACHE_SITE_NS + [dcache/pnfs, dcache/unit, dcache/pools, dcache/link and dcache/node_config] diff --git a/sites/example/site/dcache/unit.pan b/sites/example/site/dcache/unit.pan index 3365cde..039cb59 100644 --- a/sites/example/site/dcache/unit.pan +++ b/sites/example/site/dcache/unit.pan @@ -1,30 +1,32 @@ unique template site/dcache/unit; +include 'components/dcache/config'; ## unit/ugroups ## list of ugroups that will be ignored during configuration "/software/components/dcache/unit/ignore_ugroup" = list(); -"/software/components/dcache/unit/units" = nlist( - "protocol",list( - nlist("cond","*/*","ugroup",list("default_protocol")) - ), - "net",list( - nlist("cond","192.168.0.0/255.255.0.0","ugroup",list("in_net","all_net")), - nlist("cond","192.168.10.0/255.255.255.0","ugroup",list("in_server","in_net","all_net")), - nlist("cond","192.168.11.0/255.255.255.0","ugroup",list("in_wn","in_net","all_net")), - nlist("cond","192.168.12.0/255.255.255.0","ugroup",list("in_wn","in_net","all_net")), - nlist("cond","192.168.13.0/255.255.255.0","ugroup",list("in_wn","in_net","all_net")), - nlist("cond","192.168.14.0/255.255.255.0","ugroup",list("in_wn","in_net","all_net")), - nlist("cond","192.168.15.0/255.255.255.0","ugroup",list("in_wn","in_net","all_net")), - nlist("cond","192.168.16.0/255.255.255.0","ugroup",list("in_wn","in_net","all_net")), - nlist("cond","192.168.17.0/255.255.255.0","ugroup",list("in_wn","in_net","all_net")), - nlist("cond","0.0.0.0/0.0.0.0","ugroup",list("all_net")), - ), - "store",list(nlist("cond","*@*","ugroup",list("any_store")), - nlist("cond","myStore:STRING@osm","ugroup",list("default_store","any_store")), - nlist("cond","dteam:dteam-base@osm","ugroup",list("dteam_store","any_store")), - nlist("cond","ops:ops-base@osm","ugroup",list("ops_store","any_store")), - nlist("cond","cms:cms-base@osm","ugroup",list("cms_store","any_store")), - nlist("cond","test:cms-test@osm","ugroup",list("test_store")), - ), +"/software/components/dcache/unit/units" = dict( + "protocol", list( + dict("cond", "*/*", "ugroup", list("default_protocol")) + ), + "net", list( + dict("cond", "192.168.0.0/255.255.0.0", "ugroup", list("in_net", "all_net")), + dict("cond", "192.168.10.0/255.255.255.0", "ugroup", list("in_server", "in_net", "all_net")), + dict("cond", "192.168.11.0/255.255.255.0", "ugroup", list("in_wn", "in_net", "all_net")), + dict("cond", "192.168.12.0/255.255.255.0", "ugroup", list("in_wn", "in_net", "all_net")), + dict("cond", "192.168.13.0/255.255.255.0", "ugroup", list("in_wn", "in_net", "all_net")), + dict("cond", "192.168.14.0/255.255.255.0", "ugroup", list("in_wn", "in_net", "all_net")), + dict("cond", "192.168.15.0/255.255.255.0", "ugroup", list("in_wn", "in_net", "all_net")), + dict("cond", "192.168.16.0/255.255.255.0", "ugroup", list("in_wn", "in_net", "all_net")), + dict("cond", "192.168.17.0/255.255.255.0", "ugroup", list("in_wn", "in_net", "all_net")), + dict("cond", "0.0.0.0/0.0.0.0", "ugroup", list("all_net")), + ), + "store", list( + dict("cond", "*@*", "ugroup", list("any_store")), + dict("cond", "myStore:STRING@osm", "ugroup", list("default_store", "any_store")), + dict("cond", "dteam:dteam-base@osm", "ugroup", list("dteam_store", "any_store")), + dict("cond", "ops:ops-base@osm", "ugroup", list("ops_store", "any_store")), + dict("cond", "cms:cms-base@osm", "ugroup", list("cms_store", "any_store")), + dict("cond", "test:cms-test@osm", "ugroup", list("test_store")), + ), ); diff --git a/sites/example/site/filesystems/base.pan b/sites/example/site/filesystems/base.pan index 812696b..a30a690 100644 --- a/sites/example/site/filesystems/base.pan +++ b/sites/example/site/filesystems/base.pan @@ -10,36 +10,41 @@ template site/filesystems/base; -include { 'quattor/functions/filesystem' }; +include 'quattor/functions/filesystem'; # An ordered list of partition. Index will be used to build device name (index+1). # Value is an arbitrary string. variable DISK_BOOT_PARTS = list( - 'boot', - 'swap', - 'root', + 'boot', + 'swap', + 'root', ); -variable DISK_GLITE_BOOT_SIZE ?= 256*MB; -variable DISK_GLITE_ROOT_SIZE ?= -1; -variable DISK_GLITE_SWAP_SIZE ?= 8192*MB; - -variable DISK_VOLUME_PARAMS = nlist ( - 'boot', nlist('size', DISK_GLITE_BOOT_SIZE, - 'mountpoint', '/boot', - 'fstype', 'ext3', - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(index('boot',DISK_BOOT_PARTS)+1)), - 'swap', nlist('size', DISK_GLITE_SWAP_SIZE, - 'mountpoint', 'swap', - 'fstype', 'swap', - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(index('swap',DISK_BOOT_PARTS)+1)), - 'root', nlist('size', DISK_GLITE_ROOT_SIZE, - 'mountpoint', '/', - 'fstype', 'ext4', - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(index('root',DISK_BOOT_PARTS)+1)), +variable DISK_GLITE_BOOT_SIZE ?= 256 * MB; +variable DISK_GLITE_ROOT_SIZE ?= -1; +variable DISK_GLITE_SWAP_SIZE ?= 8192 * MB; + +variable DISK_VOLUME_PARAMS = dict ( + 'boot', dict( + 'size', DISK_GLITE_BOOT_SIZE, + 'mountpoint', '/boot', + 'fstype', 'ext3', + 'type', 'partition', + 'device', format('%s%s%s', DISK_BOOT_DEV, DISK_BOOT_PART_PREFIX, index('boot', DISK_BOOT_PARTS) + 1), + ), + 'swap', dict( + 'size', DISK_GLITE_SWAP_SIZE, + 'mountpoint', 'swap', + 'fstype', 'swap', + 'type', 'partition', + 'device', format('%s%s%s', DISK_BOOT_DEV, DISK_BOOT_PART_PREFIX, index('swap', DISK_BOOT_PARTS) + 1), + ), + 'root', dict( + 'size', DISK_GLITE_ROOT_SIZE, + 'mountpoint', '/', + 'fstype', 'ext4', + 'type', 'partition', + 'device', format('%s%s%s', DISK_BOOT_DEV, DISK_BOOT_PART_PREFIX, index('root', DISK_BOOT_PARTS) + 1), + ), ); - diff --git a/sites/example/site/filesystems/ce_nfs_server.pan b/sites/example/site/filesystems/ce_nfs_server.pan index 7dfe1f5..8996c76 100644 --- a/sites/example/site/filesystems/ce_nfs_server.pan +++ b/sites/example/site/filesystems/ce_nfs_server.pan @@ -1,11 +1,11 @@ -# This template defines configuration specific to TORQUE CE at GRIF -# Called by standard pro_ce_torque.tpl template - -template site/filesystems/ce_nfs_server; - -variable DISK_GLITE_HOME_SIZE ?= 60*GB; -variable DISK_GLITE_SWAREAS_SIZE ?= 60*GB; -variable DISK_GLITE_VAR_SIZE = -1; - -include { 'site/filesystems/glite' }; - +# This template defines configuration specific to TORQUE CE at GRIF +# Called by standard pro_ce_torque.tpl template + +template site/filesystems/ce_nfs_server; + +variable DISK_GLITE_HOME_SIZE ?= 60 * GB; +variable DISK_GLITE_SWAREAS_SIZE ?= 60 * GB; +variable DISK_GLITE_VAR_SIZE = -1; + +include 'site/filesystems/glite'; + diff --git a/sites/example/site/filesystems/ceph-basic.pan b/sites/example/site/filesystems/ceph-basic.pan index 9189a88..02226cb 100644 --- a/sites/example/site/filesystems/ceph-basic.pan +++ b/sites/example/site/filesystems/ceph-basic.pan @@ -1,13 +1,13 @@ unique template site/filesystems/ceph-basic; -variable CEPH_OSD_DISKS = { +variable CEPH_OSD_DISKS = { # SAS disks partitions disks = list(); - foreach (disk;data;value('/hardware/harddisks')) { + foreach (disk; data; value('/hardware/harddisks')) { if (disk != 'sda') { append(disks, disk); }; - }; + }; disks; }; @@ -15,25 +15,28 @@ prefix '/system/blockdevices'; # SAS disks partitions 'partitions' = { - foreach (idx;disk;CEPH_OSD_DISKS) { - partitions_add( - disk, nlist( - format('%s1', disk), 10*GB, - format('%s2', disk), -1)); - SELF[format('%s1', disk)]['offset'] = 1; + foreach (idx; disk; CEPH_OSD_DISKS) { + partitions_add( + disk, + dict( + format('%s1', disk), 10 * GB, + format('%s2', disk), -1, + ), + ); + SELF[format('%s1', disk)]['offset'] = 1; }; SELF; }; -variable CEPH_JOURNAL_PART = nlist('data', 1); +variable CEPH_JOURNAL_PART = dict('data', 1); # ceph OSD and journal fs -'/system/filesystems' = { - foreach (idx;disk;CEPH_OSD_DISKS) { - opart = 2; - append(merge(CEPH_FSOPTS_BASE, CEPH_DISK_OPTIONS[CEPH_FS], nlist( - 'mountpoint', format('/var/lib/ceph/osd/%s',disk), - 'block_device', format('partitions/%s%d', disk, opart), - ))); +'/system/filesystems' = { + foreach (idx; disk; CEPH_OSD_DISKS) { + opart = 2; + append(merge(CEPH_FSOPTS_BASE, CEPH_DISK_OPTIONS[CEPH_FS], dict( + 'mountpoint', format('/var/lib/ceph/osd/%s', disk), + 'block_device', format('partitions/%s%d', disk, opart), + ))); }; SELF; }; diff --git a/sites/example/site/filesystems/ceph-cache.pan b/sites/example/site/filesystems/ceph-cache.pan index 2e3d1ea..d4f3854 100644 --- a/sites/example/site/filesystems/ceph-cache.pan +++ b/sites/example/site/filesystems/ceph-cache.pan @@ -1,15 +1,14 @@ unique template site/filesystems/ceph-cache; # ceph OSD and journal fs -'/system/filesystems' = { - foreach (disk;label;value('/system/blockdevices/physical_devs')) { +'/system/filesystems' = { + foreach (disk; label; value('/system/blockdevices/physical_devs')) { if (index(disk, CEPH_SSD_DISKS) >= 0) { - append(merge(CEPH_FSOPTS_BASE, CEPH_DISK_OPTIONS[CEPH_FS], nlist( - 'mountpoint', format('/var/lib/ceph/osd/cache/%s',disk), + append(merge(CEPH_FSOPTS_BASE, CEPH_DISK_OPTIONS[CEPH_FS], dict( + 'mountpoint', format('/var/lib/ceph/osd/cache/%s', disk), 'block_device', format('partitions/%s%d', disk, CEPH_CACHE_PART), - ))); + ))); }; }; SELF; }; - diff --git a/sites/example/site/filesystems/ceph-common.pan b/sites/example/site/filesystems/ceph-common.pan index b9e8a4f..48fd788 100644 --- a/sites/example/site/filesystems/ceph-common.pan +++ b/sites/example/site/filesystems/ceph-common.pan @@ -1,23 +1,23 @@ unique template site/filesystems/ceph-common; -variable DISK_SWAP_SIZE = 4*GB; +variable DISK_SWAP_SIZE = 4 * GB; include 'quattor/functions/filesystem'; prefix '/system/blockdevices'; 'physical_devs' = { - foreach (disk;data;value('/hardware/harddisks')) { - SELF[disk]['label'] = 'gpt'; + foreach (disk; data; value('/hardware/harddisks')) { + SELF[disk]['label'] = 'gpt'; }; - SELF; + SELF; }; #'md' = { -# raids = nlist(); +# raids = dict(); # for (i = 1; i <= 3; i = i+1) { -# raids[format('md%s', i)] = nlist( -# "device_list" , list(format('partitions/sda%s', i), format('partitions/sdb%s', i)), +# raids[format('md%s', i)] = dict( +# "device_list", list(format('partitions/sda%s', i), format('partitions/sdb%s', i)), # "raid_level", 'RAID1', # ); # }; @@ -28,76 +28,76 @@ prefix '/system/blockdevices'; variable MAKE_SEPERATE_VAR_PART ?= false; variable CEPH_RAID_BOOT_DISK ?= false; -'/system/filesystems' = { +'/system/filesystems' = { if (CEPH_RAID_BOOT_DISK) { block_pref = 'md/md'; } else { block_pref = format('partitions/%s', DISK_BOOT_DEV); }; - base= nlist( + base = dict( 'mount', true, 'format', true, 'preserve', false ); - append(merge(base,nlist( + append(merge(base, dict( 'mountpoint', '/boot', 'type', 'ext2', 'block_device', format('%s1', block_pref) - ))); - append(merge(base, nlist( + ))); + append(merge(base, dict( 'mountpoint', 'swap', 'type', 'swap', 'block_device', format('%s3', block_pref) - ))); - append(merge(base, nlist( + ))); + append(merge(base, dict( 'mountpoint', '/', 'type', 'xfs', 'block_device', format('%s2', block_pref) - ))); + ))); if (MAKE_SEPERATE_VAR_PART) { - append(merge(base, nlist( + append(merge(base, dict( 'mountpoint', '/var', 'type', 'xfs', 'block_device', format('%s5', block_pref) - ))); + ))); }; SELF; }; variable CEPH_FS ?= 'xfs'; -variable CEPH_FSOPTS_BASE = nlist( - 'mount', true, - 'format', false, - 'preserve', true, - 'type', CEPH_FS, - ); +variable CEPH_FSOPTS_BASE = dict( + 'mount', true, + 'format', false, + 'preserve', true, + 'type', CEPH_FS, +); -variable CEPH_FSOPTS_DUMMY = nlist( - 'mount', false, - 'format', false, - 'preserve', true, - 'type', 'none', - 'mountopts', 'noauto,nofail', - ); +variable CEPH_FSOPTS_DUMMY = dict( + 'mount', false, + 'format', false, + 'preserve', true, + 'type', 'none', + 'mountopts', 'noauto, nofail', +); # mkfs and mount optoins # see https://github.com/ceph/ceph/blob/master/src/ceph-disk -variable CEPH_DISK_OPTIONS = nlist( - 'xfs' , nlist( +variable CEPH_DISK_OPTIONS = dict( + 'xfs', dict( 'mkfsopts', '-i size=2048', 'mountopts', 'noatime' - ), - 'ext4', nlist( - 'mountopts', 'noatime,user_xattr', - ), - 'btrfs', nlist( + ), + 'ext4', dict( + 'mountopts', 'noatime, user_xattr', + ), + 'btrfs', dict( 'mkfsopts', '-m single -l 32768 -n 32768', - 'mountopts', 'noatime,user_subvol_rm_allowed', - ) + 'mountopts', 'noatime, user_subvol_rm_allowed', + ) ); -'/system/blockdevices/logical_volumes' = nlist(); +'/system/blockdevices/logical_volumes' = dict(); variable AII_OSINSTALL_OPTION_CLEARPART = list(DISK_BOOT_DEV); diff --git a/sites/example/site/filesystems/ceph-meta.pan b/sites/example/site/filesystems/ceph-meta.pan index 396f6a8..3e2394e 100644 --- a/sites/example/site/filesystems/ceph-meta.pan +++ b/sites/example/site/filesystems/ceph-meta.pan @@ -1,15 +1,14 @@ unique template site/filesystems/ceph-meta; -'/system/filesystems' = { - foreach (disk;label;value('/system/blockdevices/physical_devs')) { +'/system/filesystems' = { + foreach (disk; label; value('/system/blockdevices/physical_devs')) { if (index(disk, CEPH_SSD_DISKS) >= 0) { - append(merge(CEPH_FSOPTS_BASE, CEPH_DISK_OPTIONS[CEPH_FS], nlist( - 'mountpoint', format('/var/lib/ceph/osd/meta/%s',disk), + append(merge(CEPH_FSOPTS_BASE, CEPH_DISK_OPTIONS[CEPH_FS], dict( + 'mountpoint', format('/var/lib/ceph/osd/meta/%s', disk), 'block_device', format('partitions/%s%d', disk, CEPH_MD_PART), - ))); + ))); }; }; SELF; }; - diff --git a/sites/example/site/filesystems/ceph-raid.pan b/sites/example/site/filesystems/ceph-raid.pan index e3be121..081d3fb 100644 --- a/sites/example/site/filesystems/ceph-raid.pan +++ b/sites/example/site/filesystems/ceph-raid.pan @@ -5,8 +5,8 @@ prefix '/system/blockdevices'; variable CEPH_OSD_DISKS = { # SAS disks partitions disks = list(); - foreach (disk;data;value('/hardware/harddisks')) { - if (data['capacity'] > 1000*GB) { + foreach (disk; data; value('/hardware/harddisks')) { + if (data['capacity'] > 1000 * GB) { append(disks, disk); }; }; @@ -14,12 +14,15 @@ variable CEPH_OSD_DISKS = { }; 'partitions' = { - foreach (idx;disk;CEPH_OSD_DISKS) { + foreach (idx; disk; CEPH_OSD_DISKS) { partitions_add( - disk, nlist( - format('%s1', disk), 10*GB, - format('%s2', disk), 5*GB, - format('%s3', disk), -1)); + disk, + dict( + format('%s1', disk), 10 * GB, + format('%s2', disk), 5 * GB, + format('%s3', disk), -1, + ), + ); SELF[format('%s1', disk)]['offset'] = 1; }; SELF; @@ -27,10 +30,13 @@ variable CEPH_OSD_DISKS = { #raid for data 'md' = { - for (i=0; i< length(CEPH_OSD_DISKS); i= i+2) { - for (j=2; j<=3; j = j+1) { - SELF[escape(format('md/%s0%s%d', CEPH_OSD_DISKS[i], CEPH_OSD_DISKS[i+1], j ))] = nlist( - "device_list" , list(format('partitions/%s%d', CEPH_OSD_DISKS[i], j), format('partitions/%s%d',CEPH_OSD_DISKS[i+1], j)), + for (i = 0; i < length(CEPH_OSD_DISKS); i = i + 2) { + for (j = 2; j <= 3; j = j + 1) { + SELF[escape(format('md/%s0%s%d', CEPH_OSD_DISKS[i], CEPH_OSD_DISKS[i+1], j ))] = dict( + "device_list", list( + format('partitions/%s%d', CEPH_OSD_DISKS[i], j), + format('partitions/%s%d', CEPH_OSD_DISKS[i+1], j), + ), "raid_level", 'RAID0', "metadata", '1.2', ); @@ -40,21 +46,20 @@ variable CEPH_OSD_DISKS = { }; # ceph OSD and journal fs -'/system/filesystems' = { +'/system/filesystems' = { # ga over software raids.. - foreach (disk;data;value('/system/blockdevices/md')) { #check for data part/disk + foreach (disk; data; value('/system/blockdevices/md')) { #check for data part/disk if (match(unescape(disk), '^md/.+0.+3$')) { - append(merge(CEPH_FSOPTS_BASE, CEPH_DISK_OPTIONS[CEPH_FS], nlist( - 'mountpoint', format('/var/lib/ceph/osd/%s', replace('md/([a-z0A-Z]+)[0-9]*$', '$1', unescape(disk))), + append(merge(CEPH_FSOPTS_BASE, CEPH_DISK_OPTIONS[CEPH_FS], dict( + 'mountpoint', format('/var/lib/ceph/osd/%s', replace('md/([a-z0A-Z]+)[0-9]*$', '$1', unescape(disk))), 'block_device', format('md/%s', disk), ))); } else if (match(unescape(disk), '^md/.+0.+2$')) { - append(merge(CEPH_FSOPTS_DUMMY, nlist( + append(merge(CEPH_FSOPTS_DUMMY, dict( 'mountpoint', format('/dummy/%s', unescape(disk)), 'block_device', format('md/%s', disk) ))); }; - }; + }; SELF; }; - diff --git a/sites/example/site/filesystems/extended.pan b/sites/example/site/filesystems/extended.pan index ad93225..f4f27dd 100644 --- a/sites/example/site/filesystems/extended.pan +++ b/sites/example/site/filesystems/extended.pan @@ -1,107 +1,136 @@ # Define default filesystem layout for gLite nodes using an extended # partition and logical partitions. + template site/filesystems/extended; -include { 'quattor/functions/filesystem' }; + +include 'quattor/functions/filesystem'; + variable DISK_SUP_DEV = { - if (exists("/hardware/harddisks/sdb")) { - return("sdb"); - } else if (exists("/hardware/harddisks/hdb")) { - return("hdb"); - } else if (exists("/hardware/harddisks/xvdb")) { - return("xvdb"); - } else { - undef; - }; + if (exists("/hardware/harddisks/sdb")) { + return("sdb"); + } else if (exists("/hardware/harddisks/hdb")) { + return("hdb"); + } else if (exists("/hardware/harddisks/xvdb")) { + return("xvdb"); + } else { + undef; + }; }; + #variable DISK_SUP_PARTS ?= list('lvm'); variable DISK_SUP_PARTS ?= list(''); + # Scratch volume is a generic volume whose mount point can be changed according to site needs variable DISK_GLITE_SCRATCH_SIZE ?= 0; -variable DISK_GLITE_SCRATCH_MOUNTPOINT ?= '/scratch';; +variable DISK_GLITE_SCRATCH_MOUNTPOINT ?= '/scratch'; #variable DISK_GLITE_SCRATCH_SIZE ?= if ( is_defined(DISK_SUP_DEV) ) { # -1; # } else { # 0; # }; + # Allow to redefine homevol mount point -variable DISK_GLITE_BOOT_SIZE ?= 256*MB; -variable DISK_GLITE_HOME_SIZE ?= 0*GB; +variable DISK_GLITE_BOOT_SIZE ?= 256 * MB; +variable DISK_GLITE_HOME_SIZE ?= 0 * GB; variable DISK_GLITE_HOME_MOUNTPOINT ?= '/home'; -variable DISK_GLITE_OPT_SIZE ?= 2*GB; -variable DISK_GLITE_ROOT_SIZE ?= 1*GB; -variable DISK_GLITE_SWAREAS_SIZE ?= 0*GB; -variable DISK_GLITE_TMP_SIZE ?= 1*GB; -variable DISK_GLITE_USR_SIZE ?= 5*GB; + +variable DISK_GLITE_OPT_SIZE ?= 2 * GB; +variable DISK_GLITE_ROOT_SIZE ?= 1 * GB; +variable DISK_GLITE_SWAREAS_SIZE ?= 0 * GB; +variable DISK_GLITE_TMP_SIZE ?= 1 * GB; +variable DISK_GLITE_USR_SIZE ?= 5 * GB; variable DISK_GLITE_VAR_SIZE ?= if ( DISK_GLITE_SCRATCH_SIZE == 0 ) { - -1; - } else { - 10*GB; - }; + -1; +} else { + 10 * GB; +}; + # An ordered list of partition. Index will be used to build device name (index+1). # Value is an arbitrary string but 4 first entries must not be used here (used by standard # configuration template). variable DISK_GLITE_PARTS = list( - 'boot', - 'root', - 'swap', - 'extended', - 'usr', - 'var', - 'tmp', - 'opt', - 'home', - 'scratch', - 'swareas', + 'boot', + 'root', + 'swap', + 'extended', + 'usr', + 'var', + 'tmp', + 'opt', + 'home', + 'scratch', + 'swareas', ); - # Define default layout customizations for gLite nodes -variable DISK_VOLUME_PARAMS = filesystem_layout_mod(nlist( - 'boot', nlist('size', DISK_GLITE_BOOT_SIZE), - 'home', nlist('size', DISK_GLITE_HOME_SIZE, - 'mountpoint', DISK_GLITE_HOME_MOUNTPOINT, - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(index('home',DISK_GLITE_PARTS)+1)), - 'opt', nlist('size', DISK_GLITE_OPT_SIZE, - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(index('opt',DISK_GLITE_PARTS)+1)), - 'root', nlist('size', DISK_GLITE_ROOT_SIZE), - 'scratch', nlist('size', DISK_GLITE_SCRATCH_SIZE, - 'mountpoint', DISK_GLITE_SCRATCH_MOUNTPOINT, - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(index('scratch',DISK_GLITE_PARTS)+1)), - 'swareas', nlist('size', DISK_GLITE_SWAREAS_SIZE, - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(index('swareas',DISK_GLITE_PARTS)+1)), - 'tmp', nlist('size', DISK_GLITE_TMP_SIZE, - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(index('tmp',DISK_GLITE_PARTS)+1)), - 'usr', nlist('size', DISK_GLITE_USR_SIZE, - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(index('usr',DISK_GLITE_PARTS)+1)), - 'var', nlist('size', DISK_GLITE_VAR_SIZE, - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(index('var',DISK_GLITE_PARTS)+1)), - - 'vg.01', nlist('size', 0), - +variable DISK_VOLUME_PARAMS = filesystem_layout_mod(dict( + 'boot', dict( + 'size', DISK_GLITE_BOOT_SIZE, + ), + 'home', dict( + 'size', DISK_GLITE_HOME_SIZE, + 'mountpoint', DISK_GLITE_HOME_MOUNTPOINT, + 'type', 'partition', + 'device', format('%s%s%s', DISK_BOOT_DEV, DISK_BOOT_PART_PREFIX, index('home', DISK_BOOT_PARTS) + 1), + ), + 'opt', dict( + 'size', DISK_GLITE_OPT_SIZE, + 'type', 'partition', + 'device', format('%s%s%s', DISK_BOOT_DEV, DISK_BOOT_PART_PREFIX, index('opt', DISK_BOOT_PARTS) + 1), + ), + 'root', dict( + 'size', DISK_GLITE_ROOT_SIZE, + ), + 'scratch', dict( + 'size', DISK_GLITE_SCRATCH_SIZE, + 'mountpoint', DISK_GLITE_SCRATCH_MOUNTPOINT, + 'type', 'partition', + 'device', format('%s%s%s', DISK_BOOT_DEV, DISK_BOOT_PART_PREFIX, index('scratch', DISK_BOOT_PARTS) + 1), + ), + 'swareas', dict( + 'size', DISK_GLITE_SWAREAS_SIZE, + 'type', 'partition', + 'device', format('%s%s%s', DISK_BOOT_DEV, DISK_BOOT_PART_PREFIX, index('swareas', DISK_BOOT_PARTS) + 1), + ), + 'tmp', dict( + 'size', DISK_GLITE_TMP_SIZE, + 'type', 'partition', + 'device', format('%s%s%s', DISK_BOOT_DEV, DISK_BOOT_PART_PREFIX, index('tmp', DISK_BOOT_PARTS) + 1), + ), + 'usr', dict( + 'size', DISK_GLITE_USR_SIZE, + 'type', 'partition', + 'device', format('%s%s%s', DISK_BOOT_DEV, DISK_BOOT_PART_PREFIX, index('usr', DISK_BOOT_PARTS) + 1), + ), + 'var', dict( + 'size', DISK_GLITE_VAR_SIZE, + 'type', 'partition', + 'device', format('%s%s%s', DISK_BOOT_DEV, DISK_BOOT_PART_PREFIX, index('var', DISK_BOOT_PARTS) + 1), + ), + 'vg.01', dict( + 'size', 0, + ), )); # Redefine swap size if explicitly defined with variable NODE_SWAP_SIZE variable DISK_VOLUME_PARAMS = { - if ( is_defined(NODE_SWAP_SIZE) ) { - filesystem_layout_mod(nlist('swap', nlist('size', NODE_SWAP_SIZE))); - } else { - SELF; - }; + if (is_defined(NODE_SWAP_SIZE)) { + filesystem_layout_mod(dict( + 'swap', dict( + 'size', NODE_SWAP_SIZE, + ), + )); + } else { + SELF; + }; }; diff --git a/sites/example/site/filesystems/glite.pan b/sites/example/site/filesystems/glite.pan index b1b81f1..09c1f5a 100644 --- a/sites/example/site/filesystems/glite.pan +++ b/sites/example/site/filesystems/glite.pan @@ -2,18 +2,18 @@ template site/filesystems/glite; -include { 'quattor/functions/filesystem' }; +include 'quattor/functions/filesystem'; variable DISK_SUP_DEV = { - if (exists("/hardware/harddisks/sdb")) { - return("sdb"); - } else if (exists("/hardware/harddisks/hdb")) { - return("hdb"); - } else if (exists("/hardware/harddisks/xvdb")) { - return("xvdb"); - } else { - undef; - }; + if (exists("/hardware/harddisks/sdb")) { + return("sdb"); + } else if (exists("/hardware/harddisks/hdb")) { + return("hdb"); + } else if (exists("/hardware/harddisks/xvdb")) { + return("xvdb"); + } else { + undef; + }; }; #variable DISK_SUP_PARTS ?= list('lvm'); @@ -22,52 +22,72 @@ variable DISK_SUP_PARTS ?= list(''); # Scratch volume is a generic volume whose mount point can be changed according to site needs variable DISK_GLITE_SCRATCH_SIZE ?= 0; variable DISK_GLITE_SCRATCH_LOGVOL ?= 'scratch'; -variable DISK_GLITE_SCRATCH_MOUNTPOINT ?= '/scratch';; +variable DISK_GLITE_SCRATCH_MOUNTPOINT ?= '/scratch'; #variable DISK_GLITE_SCRATCH_SIZE ?= if ( is_defined(DISK_SUP_DEV) ) { -# -1; -# } else { -# 0; -# }; +# -1; +#} else { +# 0; +#}; # Allow to redefine homevol mount point -variable DISK_GLITE_HOME_SIZE ?= 0*GB; +variable DISK_GLITE_HOME_SIZE ?= 0 * GB; variable DISK_GLITE_HOME_MOUNTPOINT ?= '/home'; -variable DISK_GLITE_OPT_SIZE ?= 2*GB; -variable DISK_GLITE_ROOT_SIZE ?= 1*GB; -variable DISK_GLITE_SWAREAS_SIZE ?= 0*GB; -variable DISK_GLITE_TMP_SIZE ?= 1*GB; -variable DISK_GLITE_USR_SIZE ?= 5*GB; +variable DISK_GLITE_OPT_SIZE ?= 2 * GB; +variable DISK_GLITE_ROOT_SIZE ?= 1 * GB; +variable DISK_GLITE_SWAREAS_SIZE ?= 0 * GB; +variable DISK_GLITE_TMP_SIZE ?= 1 * GB; +variable DISK_GLITE_USR_SIZE ?= 5 * GB; variable DISK_GLITE_VAR_SIZE ?= if ( DISK_GLITE_SCRATCH_SIZE == 0 ) { - -1; - } else { - 10*GB; - }; + -1; +} else { + 10 * GB; +}; # Define default layout customizations for gLite nodes -variable DISK_VOLUME_PARAMS = filesystem_layout_mod(nlist( - 'home', nlist('size', DISK_GLITE_HOME_SIZE, - 'mountpoint', DISK_GLITE_HOME_MOUNTPOINT), - 'opt', nlist('size', DISK_GLITE_OPT_SIZE), - 'root', nlist('size', DISK_GLITE_ROOT_SIZE), - 'scratch', nlist('size', DISK_GLITE_SCRATCH_SIZE, - 'type', 'lvm', - 'mountpoint', DISK_GLITE_SCRATCH_MOUNTPOINT, - 'volgroup', 'vg.01', - 'device', DISK_GLITE_SCRATCH_LOGVOL), - 'swareas', nlist('size', DISK_GLITE_SWAREAS_SIZE), - 'tmp', nlist('size', DISK_GLITE_TMP_SIZE), - 'usr', nlist('size', DISK_GLITE_USR_SIZE), - 'var', nlist('size', DISK_GLITE_VAR_SIZE), +variable DISK_VOLUME_PARAMS = filesystem_layout_mod(dict( + 'home', dict( + 'size', DISK_GLITE_HOME_SIZE, + 'mountpoint', DISK_GLITE_HOME_MOUNTPOINT, + ), + 'opt', dict( + 'size', DISK_GLITE_OPT_SIZE, + ), + 'root', dict( + 'size', DISK_GLITE_ROOT_SIZE, + ), + 'scratch', dict( + 'size', DISK_GLITE_SCRATCH_SIZE, + 'type', 'lvm', + 'mountpoint', DISK_GLITE_SCRATCH_MOUNTPOINT, + 'volgroup', 'vg.01', + 'device', DISK_GLITE_SCRATCH_LOGVOL, + ), + 'swareas', dict( + 'size', DISK_GLITE_SWAREAS_SIZE, + ), + 'tmp', dict( + 'size', DISK_GLITE_TMP_SIZE, + ), + 'usr', dict( + 'size', DISK_GLITE_USR_SIZE, + ), + 'var', dict( + 'size', DISK_GLITE_VAR_SIZE, + ), )); # Redefine swap size if explicitly defined with variable NODE_SWAP_SIZE variable DISK_VOLUME_PARAMS = { - if ( is_defined(NODE_SWAP_SIZE) ) { - filesystem_layout_mod(nlist('swap', nlist('size', NODE_SWAP_SIZE))); - } else { - SELF; - }; + if ( is_defined(NODE_SWAP_SIZE) ) { + filesystem_layout_mod(dict( + 'swap', dict( + 'size', NODE_SWAP_SIZE, + ), + )); + } else { + SELF; + }; }; diff --git a/sites/example/site/filesystems/ral-wn.pan b/sites/example/site/filesystems/ral-wn.pan index 23de524..ad79461 100644 --- a/sites/example/site/filesystems/ral-wn.pan +++ b/sites/example/site/filesystems/ral-wn.pan @@ -3,7 +3,7 @@ unique template site/filesystems/ral-wn; -include { 'pan/units' }; +include 'pan/units'; # Delete a few file systems created by default variable DISK_GLITE_HOME_SIZE ?= 0; @@ -13,43 +13,76 @@ variable DISK_GLITE_SWAREAS_SIZE ?= 0; variable DISK_GLITE_USR_SIZE ?= 0; # RAL specific partitions on WN -variable DISK_RAL_AFSCACHE_SIZE ?= 2*GB; +variable DISK_RAL_AFSCACHE_SIZE ?= 2 * GB; variable DISK_RAL_AFSCACHE_MOUNTPOINT ?= '/afscache'; -variable DISK_RAL_HOMEPOOL_SIZE ?= 2*GB; +variable DISK_RAL_HOMEPOOL_SIZE ?= 2 * GB; variable DISK_RAL_HOMEPOOL_MOUNTPOINT ?= '/home/pool'; -variable DISK_RAL_PBSPOOL_SIZE ?= 2*GB; +variable DISK_RAL_PBSPOOL_SIZE ?= 2 * GB; variable DISK_RAL_PBSPOOL_MOUNTPOINT ?= '/pbspool'; -variable DISK_RAL_POOL_SIZE ?= 2*GB; +variable DISK_RAL_POOL_SIZE ?= 2 * GB; variable DISK_RAL_POOL_MOUNTPOINT ?= '/pool'; # Define a pool of unit number to use for RAL specific units # DISK_RAL_PART_OFFSET should be large enough to avoid any conflict with # standard DISK_GLITE_PARTS. It will be added to any partition declared here. variable DISK_RAL_PART_OFFSET ?= 20; -variable DISK_RAL_PARTS ?= list('afscache','homepool','pbspool','pool'); +variable DISK_RAL_PARTS ?= list( + 'afscache', + 'homepool', + 'pbspool', + 'pool', +); # Include base layout (modified by DISK_GLITE_xxx variables) -include { 'site/filesystems/extended' }; +include 'site/filesystems/extended'; # Add RAL-specific file systems # Define default layout customizations for gLite nodes -variable DISK_VOLUME_PARAMS = filesystem_layout_mod(nlist( - 'afscache', nlist('size', DISK_RAL_AFSCACHE_SIZE, - 'mountpoint', DISK_RAL_AFSCACHE_MOUNTPOINT, - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(DISK_RAL_PART_OFFSET+index('afscache',DISK_RAL_PARTS))), - 'homepool', nlist('size', DISK_RAL_AFSCACHE_SIZE, - 'mountpoint', DISK_RAL_AFSCACHE_MOUNTPOINT, - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(DISK_RAL_PART_OFFSET+index('homepool',DISK_RAL_PARTS))), - 'pbspool', nlist('size', DISK_RAL_AFSCACHE_SIZE, - 'mountpoint', DISK_RAL_AFSCACHE_MOUNTPOINT, - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(DISK_RAL_PART_OFFSET+index('pbspool',DISK_RAL_PARTS))), - 'pool', nlist('size', DISK_RAL_AFSCACHE_SIZE, - 'mountpoint', DISK_RAL_AFSCACHE_MOUNTPOINT, - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(DISK_RAL_PART_OFFSET+index('pool',DISK_RAL_PARTS))), +variable DISK_VOLUME_PARAMS = filesystem_layout_mod(dict( + 'afscache', dict( + 'size', DISK_RAL_AFSCACHE_SIZE, + 'mountpoint', DISK_RAL_AFSCACHE_MOUNTPOINT, + 'type', 'partition', + 'device', format( + '%s%s%s', + DISK_BOOT_DEV, + DISK_BOOT_PART_PREFIX, + DISK_RAL_PART_OFFSET + index('afscache', DISK_RAL_PARTS) + 1, + ), + ), + 'homepool', dict( + 'size', DISK_RAL_AFSCACHE_SIZE, + 'mountpoint', DISK_RAL_AFSCACHE_MOUNTPOINT, + 'type', 'partition', + 'device', format( + '%s%s%s', + DISK_BOOT_DEV, + DISK_BOOT_PART_PREFIX, + DISK_RAL_PART_OFFSET + index('homepool', DISK_RAL_PARTS) + 1, + ), + ), + 'pbspool', dict( + 'size', DISK_RAL_AFSCACHE_SIZE, + 'mountpoint', DISK_RAL_AFSCACHE_MOUNTPOINT, + 'type', 'partition', + 'device', format( + '%s%s%s', + DISK_BOOT_DEV, + DISK_BOOT_PART_PREFIX, + DISK_RAL_PART_OFFSET + index('pbspool', DISK_RAL_PARTS) + 1, + ), + ), + 'pool', dict( + 'size', DISK_RAL_AFSCACHE_SIZE, + 'mountpoint', DISK_RAL_AFSCACHE_MOUNTPOINT, + 'type', 'partition', + 'device', format( + '%s%s%s', + DISK_BOOT_DEV, + DISK_BOOT_PART_PREFIX, + DISK_RAL_PART_OFFSET + index('pool', DISK_RAL_PARTS) + 1, + ), + ), )); diff --git a/sites/example/site/filesystems/sw_raid.pan b/sites/example/site/filesystems/sw_raid.pan index 676b22e..76c821b 100644 --- a/sites/example/site/filesystems/sw_raid.pan +++ b/sites/example/site/filesystems/sw_raid.pan @@ -6,18 +6,18 @@ template site/filesystems/sw_raid; -include { 'quattor/functions/filesystem' }; +include 'quattor/functions/filesystem'; variable DISK_SUP_DEV = { - if (exists("/hardware/harddisks/sdb")) { - return("sdb"); - } else if (exists("/hardware/harddisks/hdb")) { - return("hdb"); - } else if (exists("/hardware/harddisks/xvdb")) { - return("xvdb"); - } else { - error("Second disk required for SW raid but not found"); - }; + if (exists("/hardware/harddisks/sdb")) { + return("sdb"); + } else if (exists("/hardware/harddisks/hdb")) { + return("hdb"); + } else if (exists("/hardware/harddisks/xvdb")) { + return("xvdb"); + } else { + error("Second disk required for SW raid but not found"); + }; }; #variable DISK_SUP_PARTS ?= list('lvm'); @@ -29,183 +29,210 @@ variable DISK_GLITE_DEFAULT_RAID_LEVEL ?= 1; # Scratch volume is a generic volume whose mount point can be changed according to site needs variable DISK_GLITE_SCRATCH_SIZE ?= 0; variable DISK_GLITE_SCRATCH_LOGVOL ?= 'scratch'; -variable DISK_GLITE_SCRATCH_MOUNTPOINT ?= '/scratch';; +variable DISK_GLITE_SCRATCH_MOUNTPOINT ?= '/scratch'; variable DISK_GLITE_SCRATCH_RAID_LEVEL ?= 0; #variable DISK_GLITE_SCRATCH_SIZE ?= if ( is_defined(DISK_SUP_DEV) ) { -# -1; -# } else { -# 0; -# }; +# -1; +#} else { +# 0; +#}; # Allow to redefine homevol mount point -variable DISK_GLITE_HOME_SIZE ?= 0*GB; +variable DISK_GLITE_HOME_SIZE ?= 0 * GB; variable DISK_GLITE_HOME_MOUNTPOINT ?= '/home'; -variable DISK_GLITE_BOOT_SIZE ?= 256*MB; -variable DISK_GLITE_OPT_SIZE ?= 2*GB; -variable DISK_GLITE_ROOT_SIZE ?= 1*GB; -variable DISK_GLITE_SWAREAS_SIZE ?= 0*GB; -variable DISK_GLITE_TMP_SIZE ?= 1*GB; -variable DISK_GLITE_USR_SIZE ?= 5*GB; +variable DISK_GLITE_BOOT_SIZE ?= 256 * MB; +variable DISK_GLITE_OPT_SIZE ?= 2 * GB; +variable DISK_GLITE_ROOT_SIZE ?= 1 * GB; +variable DISK_GLITE_SWAREAS_SIZE ?= 0 * GB; +variable DISK_GLITE_TMP_SIZE ?= 1 * GB; +variable DISK_GLITE_USR_SIZE ?= 5 * GB; variable DISK_GLITE_VAR_SIZE ?= if ( DISK_GLITE_SCRATCH_SIZE == 0 ) { - -1; - } else { - 10*GB; - }; + -1; +} else { + 10 * GB; +}; -# An ordered list of partition. Index will be used to build device name (index+1). +# An ordered list of partition. Index will be used to build device name (index + 1). # Value is an arbitrary string but 4 first entries must not be used here (used by standard # configuration template). variable DISK_GLITE_PARTS = list( - 'boot', - 'root', - 'swap', - 'extended', - 'usr', - 'var', - 'tmp', - 'opt', - 'home', - 'scratch', - 'swareas', + 'boot', + 'root', + 'swap', + 'extended', + 'usr', + 'var', + 'tmp', + 'opt', + 'home', + 'scratch', + 'swareas', ); - - # Define default layout customizations for gLite nodes -variable DISK_VOLUME_PARAMS = filesystem_layout_mod(nlist( - # Explicit definition of partitions to be used with raid1. - # Also define a partition on the second disk (even though it is not used) for every - # partition on the first disk which is not part of an md device to ensure the layout - # is the same on both disks. - 'raid_scratch_1', nlist('size', DISK_GLITE_SCRATCH_SIZE, - 'type', 'partition', - 'device', DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+to_string(index('scratch',DISK_GLITE_PARTS)+1), - ), - 'raid_swap_2', nlist('size', DISK_SWAP_SIZE, - 'type', 'partition', - 'device', DISK_SUP_DEV+DISK_BOOT_PART_PREFIX+to_string(index('swap',DISK_GLITE_PARTS)+1), - ), - 'raid_scratch_2', nlist('size', DISK_GLITE_SCRATCH_SIZE, - 'type', 'partition', - 'device', DISK_SUP_DEV+DISK_BOOT_PART_PREFIX+to_string(index('scratch',DISK_GLITE_PARTS)+1), - ), - - # Define MD devices. Size is defined there, except for raid0. - 'md'+to_string(index('boot',DISK_GLITE_PARTS)+1), nlist('type', 'md', - 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, - 'size', DISK_GLITE_BOOT_SIZE, - 'devices', list(DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('boot',DISK_GLITE_PARTS)+1), - DISK_SUP_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('boot',DISK_GLITE_PARTS)+1), - ), - ), - 'md'+to_string(index('home',DISK_GLITE_PARTS)+1), nlist('type', 'md', - 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, - 'size', DISK_GLITE_HOME_SIZE, - 'devices', list(DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('home',DISK_GLITE_PARTS)+1), - DISK_SUP_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('home',DISK_GLITE_PARTS)+1), - ), - ), - 'md'+to_string(index('opt',DISK_GLITE_PARTS)+1), nlist('type', 'md', - 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, - 'size', DISK_GLITE_OPT_SIZE, - 'devices', list(DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('opt',DISK_GLITE_PARTS)+1), - DISK_SUP_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('opt',DISK_GLITE_PARTS)+1), - ), - ), - 'md'+to_string(index('root',DISK_GLITE_PARTS)+1), nlist('type', 'md', - 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, - 'size', DISK_GLITE_ROOT_SIZE, - 'devices', list(DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('root',DISK_GLITE_PARTS)+1), - DISK_SUP_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('root',DISK_GLITE_PARTS)+1), - ), - ), - 'md'+to_string(index('swareas',DISK_GLITE_PARTS)+1), nlist('type', 'md', - 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, - 'size', DISK_GLITE_SWAREAS_SIZE, - 'devices', list(DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('swareas',DISK_GLITE_PARTS)+1), - DISK_SUP_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('swareas',DISK_GLITE_PARTS)+1), - ), - ), - 'md'+to_string(index('scratch',DISK_GLITE_PARTS)+1), nlist('type', 'md', - 'raid_level', DISK_GLITE_SCRATCH_RAID_LEVEL, - 'size', DISK_GLITE_SCRATCH_SIZE, - 'devices', list('raid_scratch_1','raid_scratch_2'), - ), - 'md'+to_string(index('tmp',DISK_GLITE_PARTS)+1), nlist('type', 'md', - 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, - 'size', DISK_GLITE_TMP_SIZE, - 'devices', list(DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('tmp',DISK_GLITE_PARTS)+1), - DISK_SUP_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('tmp',DISK_GLITE_PARTS)+1), - ), - ), - 'md'+to_string(index('usr',DISK_GLITE_PARTS)+1), nlist('type', 'md', - 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, - 'size', DISK_GLITE_USR_SIZE, - 'devices', list(DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('usr',DISK_GLITE_PARTS)+1), - DISK_SUP_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('usr',DISK_GLITE_PARTS)+1), - ), - ), - 'md'+to_string(index('var',DISK_GLITE_PARTS)+1), nlist('type', 'md', - 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, - 'size', DISK_GLITE_VAR_SIZE, - 'devices', list(DISK_BOOT_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('var',DISK_GLITE_PARTS)+1), - DISK_SUP_DEV+DISK_BOOT_PART_PREFIX+ - to_string(index('var',DISK_GLITE_PARTS)+1), - ), - ), - - # Define file systems to use. - # Redefine size for boot to ensure this is consistent between both disks. - # For many file systems, default is defined in standard/filesystem/config. - # Even though if it is useless in itself define size for swareas as it is 0 by default. - 'boot', nlist('size', DISK_GLITE_BOOT_SIZE, - 'type', 'raid', - 'device', 'md'+to_string(index('boot',DISK_GLITE_PARTS)+1)), - 'home', nlist('mountpoint', DISK_GLITE_HOME_MOUNTPOINT, - 'type', 'raid', - 'device', 'md'+to_string(index('home',DISK_GLITE_PARTS)+1)), - 'opt', nlist('type', 'raid', - 'device', 'md'+to_string(index('opt',DISK_GLITE_PARTS)+1)), - 'root', nlist('type', 'raid', - 'device', 'md'+to_string(index('root',DISK_GLITE_PARTS)+1)), - 'scratch', nlist('type', 'raid', - 'mountpoint', DISK_GLITE_SCRATCH_MOUNTPOINT, - 'device', 'md'+to_string(index('scratch',DISK_GLITE_PARTS)+1)), - 'swareas', nlist('type', 'raid', - 'size', DISK_GLITE_SWAREAS_SIZE, - 'device', 'md'+to_string(index('swareas',DISK_GLITE_PARTS)+1)), - 'tmp', nlist('type', 'raid', - 'device', 'md'+to_string(index('tmp',DISK_GLITE_PARTS)+1)), - 'usr', nlist('type', 'raid', - 'device', 'md'+to_string(index('usr',DISK_GLITE_PARTS)+1)), - 'var', nlist('type', 'raid', - 'device', 'md'+to_string(index('var',DISK_GLITE_PARTS)+1)), - 'vg.01', nlist('size', 0), - +variable DISK_VOLUME_PARAMS = filesystem_layout_mod(dict( + # Explicit definition of partitions to be used with raid1. + # Also define a partition on the second disk (even though it is not used) for every + # partition on the first disk which is not part of an md device to ensure the layout + # is the same on both disks. + 'raid_scratch_1', dict( + 'size', DISK_GLITE_SCRATCH_SIZE, + 'type', 'partition', + 'device', DISK_BOOT_DEV + DISK_BOOT_PART_PREFIX + to_string(index('scratch', DISK_GLITE_PARTS) + 1), + ), + 'raid_swap_2', dict( + 'size', DISK_SWAP_SIZE, + 'type', 'partition', + 'device', DISK_SUP_DEV + DISK_BOOT_PART_PREFIX + to_string(index('swap', DISK_GLITE_PARTS) + 1), + ), + 'raid_scratch_2', dict( + 'size', DISK_GLITE_SCRATCH_SIZE, + 'type', 'partition', + 'device', DISK_SUP_DEV + DISK_BOOT_PART_PREFIX + to_string(index('scratch', DISK_GLITE_PARTS) + 1), + ), + + # Define MD devices. Size is defined there, except for raid0. + 'md' + to_string(index('boot', DISK_GLITE_PARTS) + 1), dict( + 'type', 'md', + 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, + 'size', DISK_GLITE_BOOT_SIZE, + 'devices', list( + DISK_BOOT_DEV + DISK_BOOT_PART_PREFIX + to_string(index('boot', DISK_GLITE_PARTS) + 1), + DISK_SUP_DEV + DISK_BOOT_PART_PREFIX + to_string(index('boot', DISK_GLITE_PARTS) + 1), + ), + ), + 'md' + to_string(index('home', DISK_GLITE_PARTS) + 1), dict( + 'type', 'md', + 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, + 'size', DISK_GLITE_HOME_SIZE, + 'devices', list( + DISK_BOOT_DEV + DISK_BOOT_PART_PREFIX + to_string(index('home', DISK_GLITE_PARTS) + 1), + DISK_SUP_DEV + DISK_BOOT_PART_PREFIX + to_string(index('home', DISK_GLITE_PARTS) + 1), + ), + ), + 'md' + to_string(index('opt', DISK_GLITE_PARTS) + 1), dict( + 'type', 'md', + 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, + 'size', DISK_GLITE_OPT_SIZE, + 'devices', list( + DISK_BOOT_DEV + DISK_BOOT_PART_PREFIX + to_string(index('opt', DISK_GLITE_PARTS) + 1), + DISK_SUP_DEV + DISK_BOOT_PART_PREFIX + to_string(index('opt', DISK_GLITE_PARTS) + 1), + ), + ), + 'md' + to_string(index('root', DISK_GLITE_PARTS) + 1), dict( + 'type', 'md', + 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, + 'size', DISK_GLITE_ROOT_SIZE, + 'devices', list( + DISK_BOOT_DEV + DISK_BOOT_PART_PREFIX + to_string(index('root', DISK_GLITE_PARTS) + 1), + DISK_SUP_DEV + DISK_BOOT_PART_PREFIX + to_string(index('root', DISK_GLITE_PARTS) + 1), + ), + ), + 'md' + to_string(index('swareas', DISK_GLITE_PARTS) + 1), dict( + 'type', 'md', + 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, + 'size', DISK_GLITE_SWAREAS_SIZE, + 'devices', list( + DISK_BOOT_DEV + DISK_BOOT_PART_PREFIX + to_string(index('swareas', DISK_GLITE_PARTS) + 1), + DISK_SUP_DEV + DISK_BOOT_PART_PREFIX + to_string(index('swareas', DISK_GLITE_PARTS) + 1), + ), + ), + 'md' + to_string(index('scratch', DISK_GLITE_PARTS) + 1), dict( + 'type', 'md', + 'raid_level', DISK_GLITE_SCRATCH_RAID_LEVEL, + 'size', DISK_GLITE_SCRATCH_SIZE, + 'devices', list( + 'raid_scratch_1', + 'raid_scratch_2', + ), + ), + 'md' + to_string(index('tmp', DISK_GLITE_PARTS) + 1), dict( + 'type', 'md', + 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, + 'size', DISK_GLITE_TMP_SIZE, + 'devices', list( + DISK_BOOT_DEV + DISK_BOOT_PART_PREFIX + to_string(index('tmp', DISK_GLITE_PARTS) + 1), + DISK_SUP_DEV + DISK_BOOT_PART_PREFIX + to_string(index('tmp', DISK_GLITE_PARTS) + 1), + ), + ), + 'md' + to_string(index('usr', DISK_GLITE_PARTS) + 1), dict( + 'type', 'md', + 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, + 'size', DISK_GLITE_USR_SIZE, + 'devices', list( + DISK_BOOT_DEV + DISK_BOOT_PART_PREFIX + to_string(index('usr', DISK_GLITE_PARTS) + 1), + DISK_SUP_DEV + DISK_BOOT_PART_PREFIX + to_string(index('usr', DISK_GLITE_PARTS) + 1), + ), + ), + 'md' + to_string(index('var', DISK_GLITE_PARTS) + 1), dict( + 'type', 'md', + 'raid_level', DISK_GLITE_DEFAULT_RAID_LEVEL, + 'size', DISK_GLITE_VAR_SIZE, + 'devices', list( + DISK_BOOT_DEV + DISK_BOOT_PART_PREFIX + to_string(index('var', DISK_GLITE_PARTS) + 1), + DISK_SUP_DEV + DISK_BOOT_PART_PREFIX + to_string(index('var', DISK_GLITE_PARTS) + 1), + ), + ), + + # Define file systems to use. + # Redefine size for boot to ensure this is consistent between both disks. + # For many file systems, default is defined in standard/filesystem/config. + # Even though if it is useless in itself define size for swareas as it is 0 by default. + 'boot', dict( + 'size', DISK_GLITE_BOOT_SIZE, + 'type', 'raid', + 'device', 'md' + to_string(index('boot', DISK_GLITE_PARTS) + 1), + ), + 'home', dict( + 'mountpoint', DISK_GLITE_HOME_MOUNTPOINT, + 'type', 'raid', + 'device', 'md' + to_string(index('home', DISK_GLITE_PARTS) + 1), + ), + 'opt', dict( + 'type', 'raid', + 'device', 'md' + to_string(index('opt', DISK_GLITE_PARTS) + 1), + ), + 'root', dict( + 'type', 'raid', + 'device', 'md' + to_string(index('root', DISK_GLITE_PARTS) + 1), + ), + 'scratch', dict( + 'type', 'raid', + 'mountpoint', DISK_GLITE_SCRATCH_MOUNTPOINT, + 'device', 'md' + to_string(index('scratch', DISK_GLITE_PARTS) + 1), + ), + 'swareas', dict( + 'type', 'raid', + 'size', DISK_GLITE_SWAREAS_SIZE, + 'device', 'md' + to_string(index('swareas', DISK_GLITE_PARTS) + 1), + ), + 'tmp', dict( + 'type', 'raid', + 'device', 'md' + to_string(index('tmp', DISK_GLITE_PARTS) + 1), + ), + 'usr', dict( + 'type', 'raid', + 'device', 'md' + to_string(index('usr', DISK_GLITE_PARTS) + 1), + ), + 'var', dict( + 'type', 'raid', + 'device', 'md' + to_string(index('var', DISK_GLITE_PARTS) + 1), + ), + 'vg.01', dict( + 'size', 0, + ), )); - # Redefine swap size if explicitly defined with variable NODE_SWAP_SIZE variable DISK_VOLUME_PARAMS = { - if ( is_defined(NODE_SWAP_SIZE) ) { - filesystem_layout_mod(nlist('swap', nlist('size', NODE_SWAP_SIZE))); - } else { - SELF; - }; + if (is_defined(NODE_SWAP_SIZE)) { + filesystem_layout_mod(dict( + 'swap', dict( + 'size', NODE_SWAP_SIZE, + ), + )); + } else { + SELF; + }; }; diff --git a/sites/example/site/filesystems/wn.pan b/sites/example/site/filesystems/wn.pan index 7b7c962..0ed6392 100644 --- a/sites/example/site/filesystems/wn.pan +++ b/sites/example/site/filesystems/wn.pan @@ -2,18 +2,18 @@ template site/filesystems/wn; -include { 'quattor/functions/filesystem' }; +include 'quattor/functions/filesystem'; variable DISK_SUP_DEV ?= { - if (exists("/hardware/harddisks/sdb")) { - return("sdb"); - } else if (exists("/hardware/harddisks/hdb")) { - return("hdb"); - } else if (exists("/hardware/harddisks/xvdb")) { - return("xvdb"); - } else { - undef; - }; + if (exists("/hardware/harddisks/sdb")) { + return("sdb"); + } else if (exists("/hardware/harddisks/hdb")) { + return("hdb"); + } else if (exists("/hardware/harddisks/xvdb")) { + return("xvdb"); + } else { + undef; + }; }; #variable DISK_SUP_PARTS ?= list('lvm'); @@ -22,59 +22,80 @@ variable DISK_SUP_PARTS ?= list(''); # Scratch volume is a generic volume whose mount point can be changed according to site needs variable DISK_GLITE_SCRATCH_SIZE ?= 0; variable DISK_GLITE_SCRATCH_LOGVOL ?= 'scratch'; -variable DISK_GLITE_SCRATCH_MOUNTPOINT ?= '/scratch';; +variable DISK_GLITE_SCRATCH_MOUNTPOINT ?= '/scratch'; # Allow to redefine homevol mount point -variable DISK_GLITE_HOME_SIZE ?= 0*GB; +variable DISK_GLITE_HOME_SIZE ?= 0 * GB; variable DISK_GLITE_HOME_MOUNTPOINT ?= '/home'; -variable DISK_GLITE_OPT_SIZE ?= 2*GB; -variable DISK_GLITE_ROOT_SIZE ?= 1280*MB; -variable DISK_GLITE_SWAREAS_SIZE ?= 0*GB; -variable DISK_GLITE_TMP_SIZE ?= 1*GB; -variable DISK_GLITE_USR_SIZE ?= 10*GB; +variable DISK_GLITE_OPT_SIZE ?= 2 * GB; +variable DISK_GLITE_ROOT_SIZE ?= 1280 * MB; +variable DISK_GLITE_SWAREAS_SIZE ?= 0 * GB; +variable DISK_GLITE_TMP_SIZE ?= 1 * GB; +variable DISK_GLITE_USR_SIZE ?= 10 * GB; # Special volume for CERNVMFS -variable DISK_GLITE_CERNVMFS_SIZE ?= 20*GB; +variable DISK_GLITE_CERNVMFS_SIZE ?= 20 * GB; variable DISK_GLITE_CERNVMFS_MOUNTPOINT ?= '/cernvmfs'; variable DISK_GLITE_CERNVMFS_LOGVOL ?= 'cernvmfs'; variable DISK_GLITE_VAR_SIZE ?= if ( DISK_GLITE_SCRATCH_SIZE == 0 ) { - -1; - } else { - 10*GB; - }; + -1; +} else { + 10 * GB; +}; # Define default layout customizations for gLite nodes -variable DISK_VOLUME_PARAMS = filesystem_layout_mod(nlist( - 'home', nlist('size', DISK_GLITE_HOME_SIZE, - 'mountpoint', DISK_GLITE_HOME_MOUNTPOINT), - 'opt', nlist('size', DISK_GLITE_OPT_SIZE), - 'root', nlist('size', DISK_GLITE_ROOT_SIZE), - 'scratch', nlist('size', DISK_GLITE_SCRATCH_SIZE, - 'type', 'lvm', - 'mountpoint', DISK_GLITE_SCRATCH_MOUNTPOINT, - 'volgroup', 'vg.01', - 'device', DISK_GLITE_SCRATCH_LOGVOL), - 'swareas', nlist('size', DISK_GLITE_SWAREAS_SIZE), - 'tmp', nlist('size', DISK_GLITE_TMP_SIZE), - 'usr', nlist('size', DISK_GLITE_USR_SIZE), - 'var', nlist('size', DISK_GLITE_VAR_SIZE), - 'cernvmfs', nlist('size', DISK_GLITE_CERNVMFS_SIZE, - 'type', 'lvm', - 'mountpoint', DISK_GLITE_CERNVMFS_MOUNTPOINT, - 'volgroup', 'vg.01', - 'device', DISK_GLITE_CERNVMFS_LOGVOL - ), +variable DISK_VOLUME_PARAMS = filesystem_layout_mod(dict( + 'home', dict( + 'size', DISK_GLITE_HOME_SIZE, + 'mountpoint', DISK_GLITE_HOME_MOUNTPOINT, + ), + 'opt', dict( + 'size', DISK_GLITE_OPT_SIZE, + ), + 'root', dict( + 'size', DISK_GLITE_ROOT_SIZE, + ), + 'scratch', dict( + 'size', DISK_GLITE_SCRATCH_SIZE, + 'type', 'lvm', + 'mountpoint', DISK_GLITE_SCRATCH_MOUNTPOINT, + 'volgroup', 'vg.01', + 'device', DISK_GLITE_SCRATCH_LOGVOL, + ), + 'swareas', dict( + 'size', DISK_GLITE_SWAREAS_SIZE, + ), + 'tmp', dict( + 'size', DISK_GLITE_TMP_SIZE, + ), + 'usr', dict( + 'size', DISK_GLITE_USR_SIZE, + ), + 'var', dict( + 'size', DISK_GLITE_VAR_SIZE, + ), + 'cernvmfs', dict( + 'size', DISK_GLITE_CERNVMFS_SIZE, + 'type', 'lvm', + 'mountpoint', DISK_GLITE_CERNVMFS_MOUNTPOINT, + 'volgroup', 'vg.01', + 'device', DISK_GLITE_CERNVMFS_LOGVOL + ), )); # Redefine swap size if explicitly defined with variable NODE_SWAP_SIZE variable DISK_VOLUME_PARAMS = { - if ( is_defined(NODE_SWAP_SIZE) ) { - filesystem_layout_mod(nlist('swap', nlist('size', NODE_SWAP_SIZE))); - } else { - SELF; - }; + if ( is_defined(NODE_SWAP_SIZE) ) { + filesystem_layout_mod(dict( + 'swap', dict( + 'size', NODE_SWAP_SIZE, + ), + )); + } else { + SELF; + }; }; diff --git a/sites/example/site/glite/config.pan b/sites/example/site/glite/config.pan index 132a260..01d26fd 100644 --- a/sites/example/site/glite/config.pan +++ b/sites/example/site/glite/config.pan @@ -1,35 +1,37 @@ # gLite site parameters template. # Use it as a starting point to create a new site. - + template site/glite/config; # SITE DEFINITIONS -------------------------------------------------------- # For more information on the format of the following variable, see # http://goc.grid.sinica.edu.tw/gocwiki/How_to_publish_my_site_information. -# ------------------------------------------------------------------------- +# ------------------------------------------------------------------------- variable SITE_EMAIL ?= "grid.support@example.org"; variable SITE_NAME ?= "Example"; variable SITE_LOC ?= "Middle, Nowhere"; variable SITE_LAT ?= 0.0; variable SITE_LONG ?= 0.0; -variable SITE_WEB?="http://example.org/"; +variable SITE_WEB ?= "http://example.org/"; # If your site is not a WLCG site, remove WLCG_xxx entries. # To find your ROC name, you can look at http://straylen.web.cern.ch/straylen/GlueSite/PlotEgeeProdGlueSites.html. -variable SITE_OTHER_INFO ?= nlist("WLCG_TIER", "2", - "WLCG_PARENT", "MyT1", - "EGEE_ROC", "MyROCName", - "GRID", list("EGI","WLCG"), - "EGI_NGI", "MY_NGI", - ); +variable SITE_OTHER_INFO ?= dict( + "WLCG_TIER", "2", + "WLCG_PARENT", "MyT1", + "EGEE_ROC", "MyROCName", + "GRID", list("EGI", "WLCG"), + "EGI_NGI", "MY_NGI", +); # For a WLCG site, more information is required -#variable SITE_OTHER_INFO ?= nlist("WLCG_NAME", "FR-GRIF", -# "WLCG_TIER", "2", -# "WLCG_PARENT", "IN2P3-CC", -# "EGEE_ROC", "FR", -# "GRID", list("EGI","WLCG"), -# "EGI_NGI", "NGI_FRANCE", -# ); +#variable SITE_OTHER_INFO ?= dict( +# "WLCG_NAME", "FR-GRIF", +# "WLCG_TIER", "2", +# "WLCG_PARENT", "IN2P3-CC", +# "EGEE_ROC", "FR", +# "GRID", list("EGI", "WLCG"), +# "EGI_NGI", "NGI_FRANCE", +#); @@ -39,45 +41,48 @@ variable INSTALL_DATE ?= "20060101120000Z"; # SUPPORTED VIRTUAL ORGANIZATIONS ----------------------------------------- -# ------------------------------------------------------------------------- +# ------------------------------------------------------------------------- +# panlint disable=LP011 variable VOS ?= list( - 'alice', - 'atlas', - 'biomed', - 'cms', - 'dteam', - 'esr', - 'egeode', - 'hone', - 'ilc', - 'lhcb', - 'ops', - 'planck', + 'alice', + 'atlas', + 'biomed', + 'cms', + 'dteam', + 'esr', + 'egeode', + 'hone', + 'ilc', + 'lhcb', + 'ops', + 'planck', ); -variable VOS_SITE_PARAMS = nlist ('DEFAULT', nlist('wms_hosts', 'wmslb.example.com', - ), - ); +variable VOS_SITE_PARAMS = dict( + 'DEFAULT', dict( + 'wms_hosts', 'wmslb.example.com', + ), +); # MYPROXY CONFIGURATION --------------------------------------------------- -# ------------------------------------------------------------------------- +# ------------------------------------------------------------------------- -variable PX_HOST ?= "px."+SITE_DOMAIN; +variable PX_HOST ?= "px." + SITE_DOMAIN; variable GRID_TRUSTED_BROKERS ?= list( - "/C=FR/O=CNRS/OU=LAL/CN=grid09.lal.in2p3.fr/Email=grid.support@lal.in2p3.fr", - "/O=GRID-FR/C=FR/O=CNRS/OU=LAL/CN=grid09.lal.in2p3.fr/Email=grid.support@lal.in2p3.fr", - "/O=dutchgrid/O=hosts/OU=nikhef.nl/CN=boswachter.nikhef.nl", - "/O=dutchgrid/O=hosts/OU=nikhef.nl/CN=bosheks.nikhef.nl", + "/C=FR/O=CNRS/OU=LAL/CN=grid09.lal.in2p3.fr/Email=grid.support@lal.in2p3.fr", + "/O=GRID-FR/C=FR/O=CNRS/OU=LAL/CN=grid09.lal.in2p3.fr/Email=grid.support@lal.in2p3.fr", + "/O=dutchgrid/O=hosts/OU=nikhef.nl/CN=boswachter.nikhef.nl", + "/O=dutchgrid/O=hosts/OU=nikhef.nl/CN=bosheks.nikhef.nl", ); # MON BOX PARAMETERS (R-GMA) ---------------------------------------------- -# ------------------------------------------------------------------------- +# ------------------------------------------------------------------------- -variable MON_HOST ?= "mon."+SITE_DOMAIN; +variable MON_HOST ?= "mon." + SITE_DOMAIN; variable MON_MYSQL_PASSWORD ?= "xxx"; @@ -85,7 +90,7 @@ variable MON_MYSQL_PASSWORD ?= "xxx"; # LCG RB ------------------------------------------------------------------ # ------------------------------------------------------------------------- -variable RB_HOST ?= "rb."+SITE_DOMAIN; +variable RB_HOST ?= "rb." + SITE_DOMAIN; # gLite WMS --------------------------------------------------------------- @@ -95,35 +100,40 @@ variable WMSLB_MYSQL_PASSWORD ?= 'yyyy'; # STORAGE ELEMENT PARAMETERS ---------------------------------------------- -# ------------------------------------------------------------------------- +# ------------------------------------------------------------------------- -variable SE_HOSTS ?= nlist( - "se-dpm-server."+SITE_DOMAIN, nlist('type', 'SE_dpm'), - "dcache-head."+SITE_DOMAIN, nlist('type', 'SE_dcache','accessPoint','/pnfs/example'), +variable SE_HOSTS ?= dict( + "se-dpm-server." + SITE_DOMAIN, dict( + 'type', 'SE_dpm', + ), + "dcache-head." + SITE_DOMAIN, dict( + 'type', 'SE_dcache', + 'accessPoint', '/pnfs/example', + ), ); variable RFIO_ENABLED ?= true; # COMPUTING ELEMENT PARAMETERS -------------------------------------------- -# ------------------------------------------------------------------------- +# ------------------------------------------------------------------------- -variable CE_HOSTS_CREAM ?= list("cream."+SITE_DOMAIN); -variable CE_HOSTS_LCG ?= list("ce."+SITE_DOMAIN); -variable CE_HOSTS ?= merge(CE_HOSTS_LCG,CE_HOSTS_CREAM); +variable CE_HOSTS_CREAM ?= list("cream." + SITE_DOMAIN); +variable CE_HOSTS_LCG ?= list("ce." + SITE_DOMAIN); +variable CE_HOSTS ?= merge(CE_HOSTS_LCG, CE_HOSTS_CREAM); # Location of CREAM sandboxes. # Must match the location where the sandbox is mounted on the actual CE. # There is one DEFAULT entry plus one entry per CE with a different # mount point. -variable CREAM_SANDBOX_DIRS ?= nlist('DEFAULT', '/sandboxes'); +variable CREAM_SANDBOX_DIRS ?= dict('DEFAULT', '/sandboxes'); # Build a list of mount points for CREAM sandbox based on the CE host name variable CREAM_SANDBOX_MPOINTS ?= { - foreach (i;ce;CE_HOSTS_CREAM) { - SELF[ce] = '/cream_sandbox/'+ce; - }; - SELF; + foreach (i; ce; CE_HOSTS_CREAM) { + SELF[ce] = '/cream_sandbox/' + ce; + }; + SELF; }; @@ -148,82 +158,86 @@ variable GIP_CE_USE_CACHE ?= true; # CE_CLOSE_SE_LIST allows to specify a per VO close SE. # Close SE will be used as default SE, if there is no explicit # default SE definition -variable CE_CLOSE_SE_LIST ?= nlist( - 'DEFAULT', "se-dpm-server."+SITE_DOMAIN, +variable CE_CLOSE_SE_LIST ?= dict( + 'DEFAULT', "se-dpm-server." + SITE_DOMAIN, ); -# variable CE_DEFAULT_SE_LIST = nlist(); +# variable CE_DEFAULT_SE_LIST = dict(); variable CE_QUEUES_SITE = { - SELF['vos'] = nlist(); - SELF['attlist'] = nlist(); - - # Add short deadline job queue. - SELF['vos']['sdj'] = list("biomed"); - - SELF['attlist']['sdj'] = nlist( - "queue_type", "Execution", - "resources_max.cput", "00:10:00", - "resources_max.walltime", "01:00:00", - "enabled", true, - "started", true, - ); - - SELF['attlist']['dteam'] = nlist( - "queue_type", "Execution", - "resources_max.cput", "02:00:00", - "resources_max.walltime", "02:30:00", - "enabled", true, - "started", true, - ); - - SELF['attlist']['atlas'] = nlist( - "queue_type", "Execution", - "max_running", 20, - "resources_max.cput", "24:00:00", - "resources_max.walltime", "36:00:00", - "enabled", true, - "started", true, - ); - - SELF; + SELF['vos'] = dict(); + SELF['attlist'] = dict(); + + # Add short deadline job queue. + SELF['vos']['sdj'] = list("biomed"); + + SELF['attlist']['sdj'] = dict( + "queue_type", "Execution", + "resources_max.cput", "00:10:00", + "resources_max.walltime", "01:00:00", + "enabled", true, + "started", true, + ); + + SELF['attlist']['dteam'] = dict( + "queue_type", "Execution", + "resources_max.cput", "02:00:00", + "resources_max.walltime", "02:30:00", + "enabled", true, + "started", true, + ); + + SELF['attlist']['atlas'] = dict( + "queue_type", "Execution", + "max_running", 20, + "resources_max.cput", "24:00:00", + "resources_max.walltime", "36:00:00", + "enabled", true, + "started", true, + ); + + SELF; }; -variable CE_VO_SHARES = nlist('atlas', 40, - ); +variable CE_VO_SHARES = dict( + 'atlas', 40, +); # OTHER SERVICE LOCATIONS ------------------------------------------------- -# ------------------------------------------------------------------------- +# ------------------------------------------------------------------------- -variable LFC_HOSTS ?= nlist( - "lfc."+SITE_DOMAIN, nlist('alias', 'lfcalias.'+SITE_DOMAIN), +variable LFC_HOSTS ?= dict( + "lfc." + SITE_DOMAIN, dict( + 'alias', 'lfcalias.' + SITE_DOMAIN, + ), ); variable GRIDICE_SERVER_HOST ?= MON_HOST; # BDII CONFIGURATION ------------------------------------------------------ -# ------------------------------------------------------------------------- +# ------------------------------------------------------------------------- -variable TOP_BDII_HOST ?= "topbdii."+SITE_DOMAIN; +variable TOP_BDII_HOST ?= "topbdii." + SITE_DOMAIN; variable BDII_PASSWD ?= 'xxx'; variable GRIS_PORT ?= 2135; variable BDII_PORT ?= 2170; -variable BDII_URLS ?= - nlist( - "CE", "ldap://ce."+SITE_DOMAIN+":"+to_string(BDII_PORT)+"/mds-vo-name=resource,o=grid", - "CREAM", "ldap://cream."+SITE_DOMAIN+":"+to_string(BDII_PORT)+"/mds-vo-name=resource,o=grid", - "LFC", "ldap://lfc."+SITE_DOMAIN+":"+to_string(BDII_PORT)+"/mds-vo-name=resource,o=grid", - "RB", "ldap://"+RB_HOST+":"+to_string(BDII_PORT)+"/mds-vo-name=resource,o=grid", - "PX", "ldap://"+PX_HOST+":"+to_string(BDII_PORT)+"/mds-vo-name=resource,o=grid", - "MON", "ldap://"+MON_HOST+":"+to_string(BDII_PORT)+"/mds-vo-name=resource,o=grid", - "SE1", "ldap://se-dpm-server."+SITE_DOMAIN+":"+to_string(BDII_PORT)+"/mds-vo-name=resource,o=grid", - "SE2", "ldap://dcache-head."+SITE_DOMAIN+":"+to_string(BDII_PORT)+"/mds-vo-name=resource,o=grid", - ); +variable BDII_URL_FORMAT = "ldap://%s:%d/mds-vo-name=resource,o=grid"; + +variable BDII_URLS ?= dict( + "CE", format(BDII_URL_FORMAT, "ce." + SITE_DOMAIN, BDII_PORT), + "CREAM", format(BDII_URL_FORMAT, "cream." + SITE_DOMAIN, BDII_PORT), + "LFC", format(BDII_URL_FORMAT, "lfc." + SITE_DOMAIN, BDII_PORT), + "RB", format(BDII_URL_FORMAT, RB_HOST, BDII_PORT), + "PX", format(BDII_URL_FORMAT, PX_HOST, BDII_PORT), + "MON", format(BDII_URL_FORMAT, MON_HOST, BDII_PORT), + "SE1", format(BDII_URL_FORMAT, "se-dpm-server." + SITE_DOMAIN, BDII_PORT), + "SE2", format(BDII_URL_FORMAT, "dcache-head." + SITE_DOMAIN, BDII_PORT), +); # FTS SUPPORT --------------------------------------------------------------- @@ -232,14 +246,14 @@ variable FTS_SERVER_HOST ?= "cclcgftsprod.in2p3.fr"; # NFS DEFINITIONS ----------------------------------------------------------- -# --------------------------------------------------------------------------- +# --------------------------------------------------------------------------- -variable NFS_WN_HOSTS ?= "grid*."+SITE_DOMAIN; +variable NFS_WN_HOSTS ?= "grid*." + SITE_DOMAIN; -variable NFS_SERVER ?= 'ce.'+SITE_DOMAIN; +variable NFS_SERVER ?= 'ce.' + SITE_DOMAIN; -variable NFS_THREADS = nlist( - NFS_SERVER, 16, +variable NFS_THREADS = dict( + NFS_SERVER, 16, ); # When NFS_AUTOFS is true, autofs is used to mount NFS filesystems @@ -253,31 +267,31 @@ variable VO_HOMES_NFS_ROOT ?= '/vohome'; # Filesystems to export -# This is a nlist with one entry per filesystem and the NFS server as value +# This is a dict with one entry per filesystem and the NFS server as value # Filesytem mount point must be escaped. -variable WN_SHARED_AREAS = nlist( - escape("/vohome"), NFS_SERVER, - escape("/swareas"), NFS_SERVER, +variable WN_SHARED_AREAS = dict( + escape("/vohome"), NFS_SERVER, + escape("/swareas"), NFS_SERVER, ); # WORKER NODE DEFINITIONS --------------------------------------------------- -# --------------------------------------------------------------------------- -# Area on the WN for the installation of the experiment software +# --------------------------------------------------------------------------- +# Area on the WN for the installation of the experiment software # If on your WNs you have predefined shared areas where VO managers can # pre-install software, then these variables should point to these areas. # If you do not have shared areas and each job must install the software, # then these variables should contain a dot ( . ) -variable VO_SW_AREAS = nlist( - 'DEFAULT', '/swareas', +variable VO_SW_AREAS = dict( + 'DEFAULT', '/swareas', ); # Parent of home directories for VO accounts: create a subdirectory per VO # to avoid to many entries in the same directory -variable VO_HOMES ?= nlist( - 'DEFAULT', '/home/@VONAME@', +variable VO_HOMES ?= dict( + 'DEFAULT', '/home/@VONAME@', ); @@ -285,32 +299,32 @@ variable VO_HOMES ?= nlist( # --------------------------------------------------------------------------- variable GRIDMAPDIR_SHARED_PATH ?= '/gridmapdir_shared'; -variable GRIDMAPDIR_SHARED_SERVER ?= 'ce.'+SITE_DOMAIN; +variable GRIDMAPDIR_SHARED_SERVER ?= 'ce.' + SITE_DOMAIN; # USER INTERFACE DEFINITIONS ------------------------------------------------ -# --------------------------------------------------------------------------- +# --------------------------------------------------------------------------- -variable MYPROXY_DEFAULT_SERVER ?= "px."+SITE_DOMAIN; +variable MYPROXY_DEFAULT_SERVER ?= "px." + SITE_DOMAIN; # MPI SUPPORT--------------------------------------------------------------- -# --------------------------------------------------------------------------- +# --------------------------------------------------------------------------- variable ENABLE_MPI ?= true; # APEL SUPPORT -------------------------------------------------------------- -# --------------------------------------------------------------------------- +# --------------------------------------------------------------------------- variable APEL_ENABLED ?= true; variable APEL_DB_PWD ?= "xxx"; # WORKER NODE DEFINITIONS -------------------------------------------------- -# --------------------------------------------------------------------------- +# --------------------------------------------------------------------------- variable WORKER_NODES ?= list( - "wn."+SITE_DOMAIN, - "wn2."+SITE_DOMAIN, + "wn." + SITE_DOMAIN, + "wn2." + SITE_DOMAIN, ); @@ -325,8 +339,8 @@ variable WN_CPU_SLOTS = 2; # Define the number of CPU per machine. # WN_CPUS_DEF defines default value, WN_CPUS lists exceptions variable WN_CPUS_DEF = 4; -variable WN_CPUS = nlist( - "wn."+SITE_DOMAIN, 2, +variable WN_CPUS = dict( + "wn." + SITE_DOMAIN, 2, ); @@ -335,11 +349,10 @@ variable WN_CPUS = nlist( # Do it only on CE to avoid unnecessary profile rebuild in case of change variable MAUI_CONFIG_TEMPLATE = "site/glite/maui"; -variable MAUI_CONFIG_INCLUDE = if ( index(FULL_HOSTNAME,CE_HOSTS) >= 0) { - return(MAUI_CONFIG_TEMPLATE); - } else { - return(null); - }; -include { return(MAUI_CONFIG_INCLUDE) }; - +variable MAUI_CONFIG_INCLUDE = if (index(FULL_HOSTNAME, CE_HOSTS) >= 0) { + MAUI_CONFIG_TEMPLATE; +} else { + null; +}; +include MAUI_CONFIG_INCLUDE; diff --git a/sites/example/site/glite/dpm_config.pan b/sites/example/site/glite/dpm_config.pan index ce14e8b..7ba9238 100644 --- a/sites/example/site/glite/dpm_config.pan +++ b/sites/example/site/glite/dpm_config.pan @@ -61,6 +61,3 @@ variable DPM_SERVICE_PARAMS = dict( "requestMaxAge", '90d', ), ); - - - diff --git a/sites/example/site/glite/lfc_config.pan b/sites/example/site/glite/lfc_config.pan index c9b68e1..82cd7fd 100644 --- a/sites/example/site/glite/lfc_config.pan +++ b/sites/example/site/glite/lfc_config.pan @@ -3,7 +3,7 @@ template site/glite/lfc_config; # DB params -variable LFC_DB_PARAMS ?= nlist( +variable LFC_DB_PARAMS ?= dict( "password", "YourPrefClearPwd", "adminpwd", "YourPrefClearPwd", ); diff --git a/sites/example/site/glite/maui.pan b/sites/example/site/glite/maui.pan index 2d28f0e..cb168d7 100644 --- a/sites/example/site/glite/maui.pan +++ b/sites/example/site/glite/maui.pan @@ -1,7 +1,9 @@ # Template containing MAUI specific part of site configuration. - + + template site/glite/maui; + # Define MAUI default node partition. Only this partition will be accessible # to normal jobs. # If not defined, defaults to MAUI default 'DEFAULT' @@ -10,52 +12,58 @@ template site/glite/maui; # If more partitions are needed, adjust MMAX_PAR parameter. variable MAUI_WN_PART_DEF = "SL4"; + # Define nodes that belong to a specific partition (other than the default one) -variable MAUI_WN_PART = nlist( - "grid15."+SITE_DOMAIN, "SL3", - "grid16."+SITE_DOMAIN, "SL3", - "grid17."+SITE_DOMAIN, "SL3", - "grid18."+SITE_DOMAIN, "SL3", - "grid19."+SITE_DOMAIN, "SL3", - "grid20."+SITE_DOMAIN, "SL3", - "grid21."+SITE_DOMAIN, "SL3", - "grid22."+SITE_DOMAIN, "SL3", - "grid24."+SITE_DOMAIN, "SL3", - "grid25."+SITE_DOMAIN, "SL3", - "grid26."+SITE_DOMAIN, "SL3", +variable MAUI_WN_PART = dict( + "grid15." + SITE_DOMAIN, "SL3", + "grid16." + SITE_DOMAIN, "SL3", + "grid17." + SITE_DOMAIN, "SL3", + "grid18." + SITE_DOMAIN, "SL3", + "grid19." + SITE_DOMAIN, "SL3", + "grid20." + SITE_DOMAIN, "SL3", + "grid21." + SITE_DOMAIN, "SL3", + "grid22." + SITE_DOMAIN, "SL3", + "grid24." + SITE_DOMAIN, "SL3", + "grid25." + SITE_DOMAIN, "SL3", + "grid26." + SITE_DOMAIN, "SL3", ); + + # Define each VO (group) specific characteristics. # This is mainly used to define fairshare parameters -variable MAUI_GROUP_PARAMS = nlist( - "DEFAULT", "FSTARGET=5+", - "atlas", "FSTARGET=35+", - "biomed", "FSTARGET=35+", - "cms", "FSTARGET=20+", - "dteam", "FSTARGET=1+ MAXPROC=2", - "dzero", "FSTARGET=20+", - "ilc", "FSTARGET=10+", - "ops", "FSTARGET=1+ MAXPROC=2", +variable MAUI_GROUP_PARAMS = dict( + "DEFAULT", "FSTARGET=5+", + "atlas", "FSTARGET=35+", + "biomed", "FSTARGET=35+", + "cms", "FSTARGET=20+", + "dteam", "FSTARGET=1+ MAXPROC=2", + "dzero", "FSTARGET=20+", + "ilc", "FSTARGET=10+", + "ops", "FSTARGET=1+ MAXPROC=2", ); + + # Define node partitions allowed for every VO (group). This is a comma separated list # VO not listed are using the DEFAULT entry if present or the default partition MAUI_WN_PART_DEF -variable MAUI_GROUP_PART = nlist( - "DEFAULT", "SL3,SL4", -# "atlas", "SL4", -# "biomed", "SL4", - "dteam", "SL4", - "lhcb", "SL3", +variable MAUI_GROUP_PART = dict( + "DEFAULT", "SL3, SL4", + # "atlas", "SL4", + # "biomed", "SL4", + "dteam", "SL4", + "lhcb", "SL3", ); + + # Limit number of simultenaous jobs for sdj, dteam and ops # so that they can share the same SRs # Ensure the total is not greater than the number of job slots # as jobs are rejected if there is no free slot. -variable MAUI_CLASS_PARAMS ?= nlist( - 'sdj', 'MAXPROC=18', +variable MAUI_CLASS_PARAMS ?= dict( + 'sdj', 'MAXPROC=18', ); - diff --git a/sites/example/site/global_variables.pan b/sites/example/site/global_variables.pan index eae51ce..30945cb 100644 --- a/sites/example/site/global_variables.pan +++ b/sites/example/site/global_variables.pan @@ -27,7 +27,7 @@ final variable NAMESERVERS = list("134.158.120.3"); # Define the network parameters for the site. The IP # information is taken from the DB_IP "database". The -# full hostname is the key for that nlist. +# full hostname is the key for that dict. variable NETWORK_PARAMS = dict( "ip", DB_IP[escape(FULL_HOSTNAME)], "gateway", "192.168.0.254", diff --git a/sites/example/site/misc/fix_fqan_accounts.pan b/sites/example/site/misc/fix_fqan_accounts.pan index 5dac827..bad1e2c 100644 --- a/sites/example/site/misc/fix_fqan_accounts.pan +++ b/sites/example/site/misc/fix_fqan_accounts.pan @@ -14,56 +14,24 @@ unique template site/misc/fix_fqan_accounts; variable GLITE_BASE_CONFIG_SITE_SAVED ?= null; -variable LAL_FIX_ACCOUNTS_SCRIPT = '/tmp/purge_accounts'; -variable LAL_FIX_ACCOUNTS_CONTENTS = </tmp/accounts.removed - grep -Ev "^($users|$users_kept)" /etc/passwd >/tmp/passwd -else - cp /etc/passwd /tmp/passwd -fi - -if [ -n "${vos}" ] -then - grep -Ev "^($vos)[a-z]{2,}:" /tmp/passwd >/etc/passwd -fi - -if [ -f /tmp/accounts.removed -a ! -f /etc/init.d/globus-gatekeeper ] -then - cat /tmp/accounts.removed >> /etc/passwd - rm /tmp/accounts.removed -fi -rm /tmp/passwd -EOF - -include { 'components/filecopy/config' }; +include 'components/filecopy/config'; '/software/components/filecopy/services' = { - if ( is_defined(NODE_VO_ACCOUNTS) && NODE_VO_ACCOUNTS ) { - debug('Adding purge_fqan_accounts'); - SELF[escape(LAL_FIX_ACCOUNTS_SCRIPT)] = nlist('config', LAL_FIX_ACCOUNTS_CONTENTS, - 'owner', 'root:root', - 'perms', '0755', - 'restart', LAL_FIX_ACCOUNTS_SCRIPT, - ); - } else { - debug('VO accounts disabled (NODE_VO_ACCOUNTS='+to_string(NODE_VO_ACCOUNTS)+')'); - }; - SELF; + if (is_defined(NODE_VO_ACCOUNTS) && NODE_VO_ACCOUNTS) { + debug('Adding purge_fqan_accounts'); + SELF[escape(LAL_FIX_ACCOUNTS_SCRIPT)] = dict( + 'config', file_contents('site/misc/fix_fqan_accounts.sh'), + 'owner', 'root:root', + 'perms', '0755', + 'restart', LAL_FIX_ACCOUNTS_SCRIPT, + ); + } else { + debug('VO accounts disabled (NODE_VO_ACCOUNTS=%s', NODE_VO_ACCOUNTS); + }; + SELF; }; # Include original GLITE_BASE_CONFIG_SITE if any -include { GLITE_BASE_CONFIG_SITE_SAVED }; +include GLITE_BASE_CONFIG_SITE_SAVED; diff --git a/sites/example/site/misc/fix_fqan_accounts.sh b/sites/example/site/misc/fix_fqan_accounts.sh new file mode 100644 index 0000000..def8577 --- /dev/null +++ b/sites/example/site/misc/fix_fqan_accounts.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +users_kept='[a-z]+hs:' +users='augp|augs' +vos='atl|bio|cms|ctai|dze|fus|pla|lpnhe|esr|glarvu' +passwd_bck=/etc/passwd.150110 + +if [ ! -f ${passwd_bck} ] +then + cp /etc/passwd ${passwd_bck} +fi + +if [ -n "${users}" ] +then + grep -E "^($users_kept)" /etc/passwd >/tmp/accounts.removed + grep -Ev "^($users|$users_kept)" /etc/passwd >/tmp/passwd +else + cp /etc/passwd /tmp/passwd +fi + +if [ -n "${vos}" ] +then + grep -Ev "^($vos)[a-z]{2, }:" /tmp/passwd >/etc/passwd +fi + +if [ -f /tmp/accounts.removed -a ! -f /etc/init.d/globus-gatekeeper ] +then + cat /tmp/accounts.removed >> /etc/passwd + rm /tmp/accounts.removed +fi +rm /tmp/passwd diff --git a/sites/example/site/misc/fix_fqan_dirs.pan b/sites/example/site/misc/fix_fqan_dirs.pan index 53579ae..6f29cc6 100644 --- a/sites/example/site/misc/fix_fqan_dirs.pan +++ b/sites/example/site/misc/fix_fqan_dirs.pan @@ -15,37 +15,25 @@ unique template site/misc/fix_fqan_dirs; variable GLITE_BASE_CONFIG_SITE_SAVED ?= null; -variable LAL_FIX_ACCOUNTS_SCRIPT = '/tmp/fix_homedirs'; -variable LAL_FIX_ACCOUNTS_CONTENTS = < /etc/passwd -chmod 644 /etc/passwd -grep -v fqan /tmp/shadow | grep -v cmsmu > /etc/shadow -chmod 400 /etc/shadow -rm /tmp/passwd /tmp/shadow -EOF +include 'components/filecopy/config'; -include { 'components/filecopy/config' }; '/software/components/filecopy/services' = { - if ( is_defined(NODE_VO_ACCOUNTS) && NODE_VO_ACCOUNTS ) { - debug('Adding purge_fqan_accounts'); - SELF[escape(LAL_PURGE_ACCOUNTS_SCRIPT)] = nlist('config', LAL_PURGE_ACCOUNTS_CONTENTS, - 'owner', 'root:root', - 'perms', '0755', - 'restart', LAL_PURGE_ACCOUNTS_SCRIPT, - ); - } else { - debug('VO accounts disabled (NODE_VO_ACCOUNTS='+to_string(NODE_VO_ACCOUNTS)+')'); - }; - SELF; + if ( is_defined(NODE_VO_ACCOUNTS) && NODE_VO_ACCOUNTS ) { + debug('Adding purge_fqan_accounts'); + SELF[escape(LAL_PURGE_ACCOUNTS_SCRIPT)] = dict( + 'config', file_contents('site/misc/purge_fqan_accounts.sh'), + 'owner', 'root:root', + 'perms', '0755', + 'restart', LAL_PURGE_ACCOUNTS_SCRIPT, + ); + } else { + debug('VO accounts disabled (NODE_VO_ACCOUNTS=%s', NODE_VO_ACCOUNTS); + }; + SELF; }; - diff --git a/sites/example/site/misc/purge_fqan_accounts.sh b/sites/example/site/misc/purge_fqan_accounts.sh new file mode 100644 index 0000000..976a210 --- /dev/null +++ b/sites/example/site/misc/purge_fqan_accounts.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +cp /etc/passwd /etc/shadow /tmp +grep -v fqan /tmp/passwd | grep -v cmsmu > /etc/passwd +chmod 644 /etc/passwd +grep -v fqan /tmp/shadow | grep -v cmsmu > /etc/shadow +chmod 400 /etc/shadow +rm /tmp/passwd /tmp/shadow diff --git a/sites/example/site/nagios/OCP_setup.pan b/sites/example/site/nagios/OCP_setup.pan index 68d8efb..fb96cd5 100644 --- a/sites/example/site/nagios/OCP_setup.pan +++ b/sites/example/site/nagios/OCP_setup.pan @@ -3,6 +3,8 @@ # template site/nagios/OCP_setup; +include 'components/filecopy/config'; + # modify specific options to publish results via OCP_daemon variable NAGIOS_GENERAL_OPTIONS = { x = SELF; @@ -15,8 +17,17 @@ variable NAGIOS_GENERAL_OPTIONS = { x["process_performance_data"] = true; x["host_perfdata_file"] = "/var/nagios/rw/host-perfdata.fifo"; x["service_perfdata_file"] = "/var/nagios/rw/service-perfdata.fifo"; - x["host_perfdata_file_template"] = '$HOSTNAME$\t$HOSTSTATEID$\t$HOSTOUTPUT$|$HOSTPERFDATA$'; - x["service_perfdata_file_template"] = '$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATEID$\t$SERVICEOUTPUT$|$SERVICEPERFDATA$'; + x["host_perfdata_file_template"] = join('\t', list( + '$HOSTNAME$', + '$HOSTSTATEID$', + '$HOSTOUTPUT$|$HOSTPERFDATA$', + )); + x["service_perfdata_file_template"] = join('\t', list( + '$HOSTNAME$', + '$SERVICEDESC$', + '$SERVICESTATEID$', + '$SERVICEOUTPUT$|$SERVICEPERFDATA$', + )); x["host_perfdata_file_mode"] = 'p'; x["service_perfdata_file_mode"] = 'p'; x["host_perfdata_file_processing_interval"] = 0; @@ -27,13 +38,10 @@ variable NAGIOS_GENERAL_OPTIONS = { variable NSCA_SUBMIT_RESULT_TEMPLATE ?= 'monitoring/nagios/nsca/OCP_daemon'; -variable OCP_SYSCONFIG ?= "# /etc/sysconfig/OCP_daemon\nNSCA_HOST="+NAGIOS_MASTER+"\n"; -"/software/components/filecopy/services" = npush( - escape("/etc/sysconfig/OCP_daemon"), - nlist("config",OCP_SYSCONFIG, - "perms","0644", - "owner","root", - "backup",false, - ) +variable OCP_SYSCONFIG ?= format("# /etc/sysconfig/OCP_daemon\nNSCA_HOST=%s\n", NAGIOS_MASTER); +"/software/components/filecopy/services/{/etc/sysconfig/OCP_daemon}" = dict( + "config", OCP_SYSCONFIG, + "perms", "0644", + "owner", "root", + "backup", false, ); - diff --git a/sites/example/site/nagios/common.pan b/sites/example/site/nagios/common.pan index 5d48875..a6aebde 100644 --- a/sites/example/site/nagios/common.pan +++ b/sites/example/site/nagios/common.pan @@ -10,7 +10,7 @@ variable NAGIOS_MASTER ?= "nagios-master.example.org"; # configurable time out for NRPE checks variable NRPE_CHECK_TIMEOUT ?= 20; -variable NRPE_CHECK_COMMAND ?= '$USER1$/check_nrpe -u -t ' + to_string( NRPE_CHECK_TIMEOUT ); +variable NRPE_CHECK_COMMAND ?= format('$USER1$/check_nrpe -u -t %s', NRPE_CHECK_TIMEOUT); variable NAGIOS_QUATTOR_HOST ?= "site/nagios/hosts/quattor_host"; @@ -19,10 +19,10 @@ variable NAGIOS_COMMANDS_TEMPLATE ?= "site/nagios/site-commands"; # standard services to execute variable NAGIOS_STANDARD_TEMPLATES ?= 'site/nagios/config/services/standard-templates'; -include { NAGIOS_STANDARD_TEMPLATES }; +include NAGIOS_STANDARD_TEMPLATES; # Options for the main configuration file -variable NAGIOS_GENERAL_OPTIONS ?= nlist(); +variable NAGIOS_GENERAL_OPTIONS ?= dict(); variable NAGIOS_GENERAL_OPTIONS = { x = SELF; x["accept_passive_service_checks"] = true; @@ -31,7 +31,7 @@ variable NAGIOS_GENERAL_OPTIONS = { x["enable_flap_detection"] = false; x["retention_update_interval"] = 5; x["service_check_timeout"] = 60; - x["use_syslog"] = false; + x["use_syslog"] = false; x["log_passive_checks"] = false; x; }; @@ -39,34 +39,40 @@ variable NAGIOS_GENERAL_OPTIONS = { variable NAGIOS_WEB_CONFIG ?= 'site/nagios/config/webinterface'; variable NAGIOS_APACHE_CONFIG ?= 'site/nagios/config/apache'; -# messing with some Nagios/NRPE rpms makes a mess out of the +# messing with some Nagios/NRPE rpms makes a mess out of the # permissions on /var/log/nagios/rw -include { 'components/dirperm/config' }; -"/software/components/dirperm/paths" = push( - nlist("path", "/var/log/nagios/rw/", - "owner", "nagios:nagiocmd", - "perm", "2755", - "type", "d") -); +include 'components/dirperm/config'; +"/software/components/dirperm/paths" = push(dict( + "path", "/var/log/nagios/rw/", + "owner", "nagios:nagiocmd", + "perm", "2755", + "type", "d", +)); # work around security problem for Nagios < 3.1.1 -"/software/components/dirperm/paths" = push( - nlist("path", "/usr/lib64/nagios/cgi/statuswml.cgi", - "owner", "root:root", - "perm", "0000", - "type", "f") -); +"/software/components/dirperm/paths" = push(dict( + "path", "/usr/lib64/nagios/cgi/statuswml.cgi", + "owner", "root:root", + "perm", "0000", + "type", "f", +)); # pnp4nagios config # define host and service action URLs for PNP4NAGIOS # must be before creating hosts variable PNP4NAGIOS_BASE_URL ?= null; -variable PNP4NAGIOS_HOST_ACTION_URL = if ( is_defined( PNP4NAGIOS_BASE_URL ) ) { - PNP4NAGIOS_BASE_URL + '?host=$HOSTNAME$' } else { null }; -variable PNP4NAGIOS_SERVICE_ACTION_URL = if ( is_defined( PNP4NAGIOS_BASE_URL ) ) { - PNP4NAGIOS_BASE_URL + '?host=$HOSTNAME$&srv=$SERVICEDESC$' } else { null }; +variable PNP4NAGIOS_HOST_ACTION_URL = if (is_defined(PNP4NAGIOS_BASE_URL)) { + PNP4NAGIOS_BASE_URL + '?host=$HOSTNAME$'; +} else { + null; +}; +variable PNP4NAGIOS_SERVICE_ACTION_URL = if (is_defined(PNP4NAGIOS_BASE_URL)) { + PNP4NAGIOS_BASE_URL + '?host=$HOSTNAME$&srv=$SERVICEDESC$'; +} else { + null; +}; # list of certificate DNs that are allowed to access the https site @@ -74,4 +80,3 @@ variable NAGIOS_ADMIN_DN_LIST ?= list( "/O=org/O=example/CN=Administrator X", "/O=org/O=example/CN=Administrator Y", ); - diff --git a/sites/example/site/nagios/config/apache.pan b/sites/example/site/nagios/config/apache.pan index d2f217a..59572d0 100644 --- a/sites/example/site/nagios/config/apache.pan +++ b/sites/example/site/nagios/config/apache.pan @@ -7,374 +7,35 @@ template site/nagios/config/apache; # Apache user definition; may be placed in another file to enable re-use -include { 'components/accounts/config' }; +include 'components/accounts/config'; +include 'components/filecopy/config'; -"/software/components/accounts/groups/apache" = - nlist("gid", 48); - -"/software/components/accounts/users/apache" = nlist( - "uid", 48, - "groups", list("apache"), - "comment","Apache", - "shell", "/sbin/nologin", - "homeDir", "/var/www" +"/software/components/accounts/groups/apache" = dict( + "gid", 48, ); - -# contents of httpd.conf -variable NAGIOS_APACHE_HTTPD_CONF = < -StartServers 8 -MinSpareServers 5 -MaxSpareServers 20 -ServerLimit 256 -MaxClients 256 -MaxRequestsPerChild 4000 - - -StartServers 2 -MaxClients 150 -MinSpareThreads 25 -MaxSpareThreads 75 -ThreadsPerChild 25 -MaxRequestsPerChild 0 - -Listen 80 -LoadModule auth_basic_module modules/mod_auth_basic.so -LoadModule auth_digest_module modules/mod_auth_digest.so -LoadModule authn_file_module modules/mod_authn_file.so -LoadModule authn_alias_module modules/mod_authn_alias.so -LoadModule authn_anon_module modules/mod_authn_anon.so -LoadModule authn_dbm_module modules/mod_authn_dbm.so -LoadModule authn_default_module modules/mod_authn_default.so -LoadModule authz_host_module modules/mod_authz_host.so -LoadModule authz_user_module modules/mod_authz_user.so -LoadModule authz_owner_module modules/mod_authz_owner.so -LoadModule authz_groupfile_module modules/mod_authz_groupfile.so -LoadModule authz_dbm_module modules/mod_authz_dbm.so -LoadModule authz_default_module modules/mod_authz_default.so -LoadModule ldap_module modules/mod_ldap.so -LoadModule authnz_ldap_module modules/mod_authnz_ldap.so -LoadModule include_module modules/mod_include.so -LoadModule log_config_module modules/mod_log_config.so -LoadModule logio_module modules/mod_logio.so -LoadModule env_module modules/mod_env.so -LoadModule ext_filter_module modules/mod_ext_filter.so -LoadModule mime_magic_module modules/mod_mime_magic.so -LoadModule expires_module modules/mod_expires.so -LoadModule deflate_module modules/mod_deflate.so -LoadModule headers_module modules/mod_headers.so -LoadModule usertrack_module modules/mod_usertrack.so -LoadModule setenvif_module modules/mod_setenvif.so -LoadModule mime_module modules/mod_mime.so -LoadModule dav_module modules/mod_dav.so -LoadModule status_module modules/mod_status.so -LoadModule autoindex_module modules/mod_autoindex.so -LoadModule info_module modules/mod_info.so -LoadModule dav_fs_module modules/mod_dav_fs.so -LoadModule vhost_alias_module modules/mod_vhost_alias.so -LoadModule negotiation_module modules/mod_negotiation.so -LoadModule dir_module modules/mod_dir.so -LoadModule actions_module modules/mod_actions.so -LoadModule speling_module modules/mod_speling.so -LoadModule userdir_module modules/mod_userdir.so -LoadModule alias_module modules/mod_alias.so -LoadModule rewrite_module modules/mod_rewrite.so -LoadModule proxy_module modules/mod_proxy.so -LoadModule proxy_balancer_module modules/mod_proxy_balancer.so -LoadModule proxy_ftp_module modules/mod_proxy_ftp.so -LoadModule proxy_http_module modules/mod_proxy_http.so -LoadModule proxy_connect_module modules/mod_proxy_connect.so -LoadModule cache_module modules/mod_cache.so -LoadModule suexec_module modules/mod_suexec.so -LoadModule disk_cache_module modules/mod_disk_cache.so -LoadModule file_cache_module modules/mod_file_cache.so -LoadModule mem_cache_module modules/mod_mem_cache.so -LoadModule cgi_module modules/mod_cgi.so -LoadModule version_module modules/mod_version.so -Include conf.d/*.conf -User apache -Group apache -ServerAdmin root@localhost -UseCanonicalName Off -DocumentRoot "/var/www/html" - - Options FollowSymLinks - AllowOverride None - - - Options Indexes FollowSymLinks - AllowOverride None - Order allow,deny - Allow from all - - - UserDir disable - -DirectoryIndex index.html index.html.var -AccessFileName .htaccess - - Order allow,deny - Deny from all - -TypesConfig /etc/mime.types -DefaultType text/plain - - MIMEMagicFile conf/magic - -HostnameLookups Off -ErrorLog logs/error_log -LogLevel warn -LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined -LogFormat "%h %l %u %t \"%r\" %>s %b" common -LogFormat "%{Referer}i -> %U" referer -LogFormat "%{User-agent}i" agent -CustomLog logs/access_log combined -ServerSignature On -Alias /icons/ "/var/www/icons/" - - Options Indexes MultiViews - AllowOverride None - Order allow,deny - Allow from all - - - DAVLockDB /var/lib/dav/lockdb - -ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" - - AllowOverride None - Options None - Order allow,deny - Allow from all - -IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable -AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip -AddIconByType (TXT,/icons/text.gif) text/* -AddIconByType (IMG,/icons/image2.gif) image/* -AddIconByType (SND,/icons/sound2.gif) audio/* -AddIconByType (VID,/icons/movie.gif) video/* -AddIcon /icons/binary.gif .bin .exe -AddIcon /icons/binhex.gif .hqx -AddIcon /icons/tar.gif .tar -AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv -AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip -AddIcon /icons/a.gif .ps .ai .eps -AddIcon /icons/layout.gif .html .shtml .htm .pdf -AddIcon /icons/text.gif .txt -AddIcon /icons/c.gif .c -AddIcon /icons/p.gif .pl .py -AddIcon /icons/f.gif .for -AddIcon /icons/dvi.gif .dvi -AddIcon /icons/uuencoded.gif .uu -AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl -AddIcon /icons/tex.gif .tex -AddIcon /icons/bomb.gif core -AddIcon /icons/back.gif .. -AddIcon /icons/hand.right.gif README -AddIcon /icons/folder.gif ^^DIRECTORY^^ -AddIcon /icons/blank.gif ^^BLANKICON^^ -DefaultIcon /icons/unknown.gif -ReadmeName README.html -HeaderName HEADER.html -IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t -AddLanguage ca .ca -AddLanguage cs .cz .cs -AddLanguage da .dk -AddLanguage de .de -AddLanguage el .el -AddLanguage en .en -AddLanguage eo .eo -AddLanguage es .es -AddLanguage et .et -AddLanguage fr .fr -AddLanguage he .he -AddLanguage hr .hr -AddLanguage it .it -AddLanguage ja .ja -AddLanguage ko .ko -AddLanguage ltz .ltz -AddLanguage nl .nl -AddLanguage nn .nn -AddLanguage no .no -AddLanguage pl .po -AddLanguage pt .pt -AddLanguage pt-BR .pt-br -AddLanguage ru .ru -AddLanguage sv .sv -AddLanguage zh-CN .zh-cn -AddLanguage zh-TW .zh-tw -LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW -ForceLanguagePriority Prefer Fallback -AddDefaultCharset UTF-8 -AddType application/x-compress .Z -AddType application/x-gzip .gz .tgz -AddHandler type-map var -AddType text/html .shtml -AddOutputFilter INCLUDES .shtml -Alias /error/ "/var/www/error/" - - - - AllowOverride None - Options IncludesNoExec - AddOutputFilter Includes html - AddHandler type-map var - Order allow,deny - Allow from all - LanguagePriority en es de fr - ForceLanguagePriority Prefer Fallback - - - -BrowserMatch "Mozilla/2" nokeepalive -BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 -BrowserMatch "RealPlayer 4\.0" force-response-1.0 -BrowserMatch "Java/1\.0" force-response-1.0 -BrowserMatch "JDK/1\.0" force-response-1.0 -BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully -BrowserMatch "MS FrontPage" redirect-carefully -BrowserMatch "^WebDrive" redirect-carefully -BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully -BrowserMatch "^gnome-vfs/1.0" redirect-carefully -BrowserMatch "^XML Spy" redirect-carefully -BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully - - SSLPassPhraseDialog builtin - SSLSessionCache dbm:/var/run/ssl_scache - SSLSessionCacheTimeout 300 - SSLMutex file:/var/run/ssl_mutex - SSLRandomSeed startup builtin - SSLRandomSeed connect builtin - SSLVerifyClient none - SSLCertificateFile /etc/httpd/conf/certificates/hostcert.pem - SSLCertificateKeyFile /etc/httpd/conf/certificates/hostkey.pem - SSLCACertificatePath /usr/share/ssl/certs - SSLCARevocationPath /usr/share/ssl/certs - SSLCipherSuite ALL:!ADH:!EXPORT56:!NULL:RC4+RSA:+HIGH:+MEDIUM:+LOW:!SSLv2:+EXP - AddType application/x-x509-ca-cert .crt - AddType application/x-pkcs7-crl .crl - -EOF - - -variable NAGIOS_APACHE_SSL_CONF = < -ErrorLog logs/ssl_error_log -TransferLog logs/ssl_access_log -LogLevel warn -SSLEngine on -SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP -SSLCertificateFile /etc/httpd/conf/certificates/hostcert.pem -SSLCertificateKeyFile /etc/httpd/conf/certificates/hostkey.pem - - SSLOptions +StdEnvVars - - - SSLOptions +StdEnvVars - -SetEnvIf User-Agent ".*MSIE.*" \ - nokeepalive ssl-unclean-shutdown \ - downgrade-1.0 force-response-1.0 -CustomLog logs/ssl_request_log \ - "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" - -EOF - - -variable NAGIOS_APACHE_NAGIOS_CONF = < - ScriptAlias /nagios/cgi-bin "/usr/lib/nagios/cgi" - Alias /nagios "/usr/share/nagios" - - Options ExecCGI - AllowOverride None - Order allow,deny - Allow from .example.org - SetEnv REMOTE_USER guest - - - Options None - AllowOverride None - Order allow,deny - Allow from .example.org - SetEnv REMOTE_USER guest - - - - SSLEngine on - SSLOptions +FakeBasicAuth - SSLVerifyClient require - SSLVerifyDepth 3 - ScriptAlias /nagios/cgi-bin "/usr/lib/nagios/cgi" - Alias /nagios "/usr/share/nagios" - - Options ExecCGI - AllowOverride None - Order allow,deny - Allow from .example.org - AuthName "Nagios Access" - AuthType Basic - AuthUserFile /etc/nagios/htpasswd.users - Require valid-user - - - SSLRequireSSL - SSLOptions +FakeBasicAuth - SSLVerifyClient require - SSLVerifyDepth 3 - Options None - AllowOverride None - Order allow,deny - Allow from .example.org - AuthName "Nagios Access" - AuthType Basic - AuthUserFile /etc/nagios/htpasswd.users - Require valid-user - - -EOF - +"/software/components/accounts/users/apache" = dict( + "uid", 48, + "groups", list("apache"), + "comment", "Apache", + "shell", "/sbin/nologin", + "homeDir", "/var/www" +); # /etc/httpd/conf/httpd.conf -"/software/components/filecopy/services" = - npush(escape("/etc/httpd/conf/httpd.conf"), - nlist("config",NAGIOS_APACHE_HTTPD_CONF, - "restart", "service httpd restart", - ), +"/software/components/filecopy/services{/etc/httpd/conf/httpd.conf}" = dict( + "config", file_contents('site/nagios/config/apache/httpd.conf'), + "restart", "service httpd restart", ); # /etc/httpd/conf.d/ssl.conf -"/software/components/filecopy/services" = - npush(escape("/etc/httpd/conf.d/ssl.conf"), - nlist("config",NAGIOS_APACHE_SSL_CONF, - "restart", "service httpd restart", - ), +"/software/components/filecopy/services{/etc/httpd/conf.d/ssl.conf}" = dict( + "config", file_contents('site/nagios/config/apache/ssl.conf'), + "restart", "service httpd restart", ); # /etc/httpd/conf.d/nagios.conf -"/software/components/filecopy/services" = - npush(escape("/etc/httpd/conf.d/nagios.conf"), - nlist("config",NAGIOS_APACHE_NAGIOS_CONF, - "restart", "service httpd restart", - ), +"/software/components/filecopy/services{/etc/httpd/conf.d/nagios.conf}" = dict( + "config", file_contents('site/nagios/config/apache/nagios.conf'), + "restart", "service httpd restart", ); - diff --git a/sites/example/site/nagios/config/httpd.conf b/sites/example/site/nagios/config/httpd.conf new file mode 100644 index 0000000..9767a39 --- /dev/null +++ b/sites/example/site/nagios/config/httpd.conf @@ -0,0 +1,239 @@ +ServerTokens OS +ServerRoot "/etc/httpd" +PidFile run/httpd.pid +Timeout 120 +KeepAlive On +MaxKeepAliveRequests 100 +KeepAliveTimeout 15 + + StartServers 8 + MinSpareServers 5 + MaxSpareServers 20 + ServerLimit 256 + MaxClients 256 + MaxRequestsPerChild 4000 + + + StartServers 2 + MaxClients 150 + MinSpareThreads 25 + MaxSpareThreads 75 + ThreadsPerChild 25 + MaxRequestsPerChild 0 + +Listen 80 +LoadModule auth_basic_module modules/mod_auth_basic.so +LoadModule auth_digest_module modules/mod_auth_digest.so +LoadModule authn_file_module modules/mod_authn_file.so +LoadModule authn_alias_module modules/mod_authn_alias.so +LoadModule authn_anon_module modules/mod_authn_anon.so +LoadModule authn_dbm_module modules/mod_authn_dbm.so +LoadModule authn_default_module modules/mod_authn_default.so +LoadModule authz_host_module modules/mod_authz_host.so +LoadModule authz_user_module modules/mod_authz_user.so +LoadModule authz_owner_module modules/mod_authz_owner.so +LoadModule authz_groupfile_module modules/mod_authz_groupfile.so +LoadModule authz_dbm_module modules/mod_authz_dbm.so +LoadModule authz_default_module modules/mod_authz_default.so +LoadModule ldap_module modules/mod_ldap.so +LoadModule authnz_ldap_module modules/mod_authnz_ldap.so +LoadModule include_module modules/mod_include.so +LoadModule log_config_module modules/mod_log_config.so +LoadModule logio_module modules/mod_logio.so +LoadModule env_module modules/mod_env.so +LoadModule ext_filter_module modules/mod_ext_filter.so +LoadModule mime_magic_module modules/mod_mime_magic.so +LoadModule expires_module modules/mod_expires.so +LoadModule deflate_module modules/mod_deflate.so +LoadModule headers_module modules/mod_headers.so +LoadModule usertrack_module modules/mod_usertrack.so +LoadModule setenvif_module modules/mod_setenvif.so +LoadModule mime_module modules/mod_mime.so +LoadModule dav_module modules/mod_dav.so +LoadModule status_module modules/mod_status.so +LoadModule autoindex_module modules/mod_autoindex.so +LoadModule info_module modules/mod_info.so +LoadModule dav_fs_module modules/mod_dav_fs.so +LoadModule vhost_alias_module modules/mod_vhost_alias.so +LoadModule negotiation_module modules/mod_negotiation.so +LoadModule dir_module modules/mod_dir.so +LoadModule actions_module modules/mod_actions.so +LoadModule speling_module modules/mod_speling.so +LoadModule userdir_module modules/mod_userdir.so +LoadModule alias_module modules/mod_alias.so +LoadModule rewrite_module modules/mod_rewrite.so +LoadModule proxy_module modules/mod_proxy.so +LoadModule proxy_balancer_module modules/mod_proxy_balancer.so +LoadModule proxy_ftp_module modules/mod_proxy_ftp.so +LoadModule proxy_http_module modules/mod_proxy_http.so +LoadModule proxy_connect_module modules/mod_proxy_connect.so +LoadModule cache_module modules/mod_cache.so +LoadModule suexec_module modules/mod_suexec.so +LoadModule disk_cache_module modules/mod_disk_cache.so +LoadModule file_cache_module modules/mod_file_cache.so +LoadModule mem_cache_module modules/mod_mem_cache.so +LoadModule cgi_module modules/mod_cgi.so +LoadModule version_module modules/mod_version.so +Include conf.d/*.conf +User apache +Group apache +ServerAdmin root@localhost +UseCanonicalName Off +DocumentRoot "/var/www/html" + + Options FollowSymLinks + AllowOverride None + + + Options Indexes FollowSymLinks + AllowOverride None + Order allow, deny + Allow from all + + + UserDir disable + +DirectoryIndex index.html index.html.var +AccessFileName .htaccess + + Order allow, deny + Deny from all + +TypesConfig /etc/mime.types +DefaultType text/plain + + MIMEMagicFile conf/magic + +HostnameLookups Off +ErrorLog logs/error_log +LogLevel warn +LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined +LogFormat "%h %l %u %t \"%r\" %>s %b" common +LogFormat "%{Referer}i -> %U" referer +LogFormat "%{User-agent}i" agent +CustomLog logs/access_log combined +ServerSignature On +Alias /icons/ "/var/www/icons/" + + Options Indexes MultiViews + AllowOverride None + Order allow, deny + Allow from all + + + DAVLockDB /var/lib/dav/lockdb + +ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" + + AllowOverride None + Options None + Order allow, deny + Allow from all + +IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable +AddIconByEncoding (CMP, /icons/compressed.gif) x-compress x-gzip +AddIconByType (TXT, /icons/text.gif) text/* +AddIconByType (IMG, /icons/image2.gif) image/* +AddIconByType (SND, /icons/sound2.gif) audio/* +AddIconByType (VID, /icons/movie.gif) video/* +AddIcon /icons/binary.gif .bin .exe +AddIcon /icons/binhex.gif .hqx +AddIcon /icons/tar.gif .tar +AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv +AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip +AddIcon /icons/a.gif .ps .ai .eps +AddIcon /icons/layout.gif .html .shtml .htm .pdf +AddIcon /icons/text.gif .txt +AddIcon /icons/c.gif .c +AddIcon /icons/p.gif .pl .py +AddIcon /icons/f.gif .for +AddIcon /icons/dvi.gif .dvi +AddIcon /icons/uuencoded.gif .uu +AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl +AddIcon /icons/tex.gif .tex +AddIcon /icons/bomb.gif core +AddIcon /icons/back.gif .. +AddIcon /icons/hand.right.gif README +AddIcon /icons/folder.gif ^^DIRECTORY^^ +AddIcon /icons/blank.gif ^^BLANKICON^^ +DefaultIcon /icons/unknown.gif +ReadmeName README.html +HeaderName HEADER.html +IndexIgnore .??* *~ *# HEADER* README* RCS CVS *, v *, t +AddLanguage ca .ca +AddLanguage cs .cz .cs +AddLanguage da .dk +AddLanguage de .de +AddLanguage el .el +AddLanguage en .en +AddLanguage eo .eo +AddLanguage es .es +AddLanguage et .et +AddLanguage fr .fr +AddLanguage he .he +AddLanguage hr .hr +AddLanguage it .it +AddLanguage ja .ja +AddLanguage ko .ko +AddLanguage ltz .ltz +AddLanguage nl .nl +AddLanguage nn .nn +AddLanguage no .no +AddLanguage pl .po +AddLanguage pt .pt +AddLanguage pt-BR .pt-br +AddLanguage ru .ru +AddLanguage sv .sv +AddLanguage zh-CN .zh-cn +AddLanguage zh-TW .zh-tw +LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW +ForceLanguagePriority Prefer Fallback +AddDefaultCharset UTF-8 +AddType application/x-compress .Z +AddType application/x-gzip .gz .tgz +AddHandler type-map var +AddType text/html .shtml +AddOutputFilter INCLUDES .shtml +Alias /error/ "/var/www/error/" + + + + AllowOverride None + Options IncludesNoExec + AddOutputFilter Includes html + AddHandler type-map var + Order allow, deny + Allow from all + LanguagePriority en es de fr + ForceLanguagePriority Prefer Fallback + + + +BrowserMatch "Mozilla/2" nokeepalive +BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 +BrowserMatch "RealPlayer 4\.0" force-response-1.0 +BrowserMatch "Java/1\.0" force-response-1.0 +BrowserMatch "JDK/1\.0" force-response-1.0 +BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully +BrowserMatch "MS FrontPage" redirect-carefully +BrowserMatch "^WebDrive" redirect-carefully +BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully +BrowserMatch "^gnome-vfs/1.0" redirect-carefully +BrowserMatch "^XML Spy" redirect-carefully +BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully + + SSLPassPhraseDialog builtin + SSLSessionCache dbm:/var/run/ssl_scache + SSLSessionCacheTimeout 300 + SSLMutex file:/var/run/ssl_mutex + SSLRandomSeed startup builtin + SSLRandomSeed connect builtin + SSLVerifyClient none + SSLCertificateFile /etc/httpd/conf/certificates/hostcert.pem + SSLCertificateKeyFile /etc/httpd/conf/certificates/hostkey.pem + SSLCACertificatePath /usr/share/ssl/certs + SSLCARevocationPath /usr/share/ssl/certs + SSLCipherSuite ALL:!ADH:!EXPORT56:!NULL:RC4+RSA:+HIGH:+MEDIUM:+LOW:!SSLv2:+EXP + AddType application/x-x509-ca-cert .crt + AddType application/x-pkcs7-crl .crl + diff --git a/sites/example/site/nagios/config/nagios.conf b/sites/example/site/nagios/config/nagios.conf new file mode 100644 index 0000000..d4bd3eb --- /dev/null +++ b/sites/example/site/nagios/config/nagios.conf @@ -0,0 +1,50 @@ + + ScriptAlias /nagios/cgi-bin "/usr/lib/nagios/cgi" + Alias /nagios "/usr/share/nagios" + + Options ExecCGI + AllowOverride None + Order allow, deny + Allow from .example.org + SetEnv REMOTE_USER guest + + + Options None + AllowOverride None + Order allow, deny + Allow from .example.org + SetEnv REMOTE_USER guest + + + + SSLEngine on + SSLOptions +FakeBasicAuth + SSLVerifyClient require + SSLVerifyDepth 3 + ScriptAlias /nagios/cgi-bin "/usr/lib/nagios/cgi" + Alias /nagios "/usr/share/nagios" + + Options ExecCGI + AllowOverride None + Order allow, deny + Allow from .example.org + AuthName "Nagios Access" + AuthType Basic + AuthUserFile /etc/nagios/htpasswd.users + Require valid-user + + + SSLRequireSSL + SSLOptions +FakeBasicAuth + SSLVerifyClient require + SSLVerifyDepth 3 + Options None + AllowOverride None + Order allow, deny + Allow from .example.org + AuthName "Nagios Access" + AuthType Basic + AuthUserFile /etc/nagios/htpasswd.users + Require valid-user + + diff --git a/sites/example/site/nagios/config/ssl.conf b/sites/example/site/nagios/config/ssl.conf new file mode 100644 index 0000000..274c8a9 --- /dev/null +++ b/sites/example/site/nagios/config/ssl.conf @@ -0,0 +1,31 @@ +LoadModule ssl_module modules/mod_ssl.so +Listen 443 +AddType application/x-x509-ca-cert .crt +AddType application/x-pkcs7-crl .crl +SSLPassPhraseDialog builtin +SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000) +SSLSessionCacheTimeout 300 +SSLMutex default +SSLRandomSeed startup file:/dev/urandom 256 +SSLRandomSeed connect builtin +SSLCryptoDevice builtin + + ErrorLog logs/ssl_error_log + TransferLog logs/ssl_access_log + LogLevel warn + SSLEngine on + SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP + SSLCertificateFile /etc/httpd/conf/certificates/hostcert.pem + SSLCertificateKeyFile /etc/httpd/conf/certificates/hostkey.pem + + SSLOptions +StdEnvVars + + + SSLOptions +StdEnvVars + + SetEnvIf User-Agent ".*MSIE.*" \ + nokeepalive ssl-unclean-shutdown \ + downgrade-1.0 force-response-1.0 + CustomLog logs/ssl_request_log \ + "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" + diff --git a/sites/example/site/nagios/config/webinterface.pan b/sites/example/site/nagios/config/webinterface.pan index 7e199a9..4edb2c3 100644 --- a/sites/example/site/nagios/config/webinterface.pan +++ b/sites/example/site/nagios/config/webinterface.pan @@ -8,11 +8,11 @@ template site/nagios/config/webinterface; # variable NAGIOS_ADMIN_DNS = { x = ""; - if ( exists( NAGIOS_ADMIN_DN_LIST ) ) { - foreach( i; dn; NAGIOS_ADMIN_DN_LIST ) { - x = x + dn + ","; + if (exists(NAGIOS_ADMIN_DN_LIST)) { + foreach(i; dn; NAGIOS_ADMIN_DN_LIST) { + x = x + dn + ", "; }; - x = replace( ',$', '', x ); + x = replace(', $', '', x); }; x; }; @@ -20,65 +20,66 @@ variable NAGIOS_ADMIN_DNS = { # # Grant admins access to specific Nagios services # -variable NAGIOS_CGI_OPTIONS ?= nlist( - "authorized_for_system_information", NAGIOS_ADMIN_DNS, +variable NAGIOS_CGI_OPTIONS ?= dict( + "authorized_for_system_information", NAGIOS_ADMIN_DNS, "authorized_for_configuration_information", NAGIOS_ADMIN_DNS, - "authorized_for_all_service_commands", NAGIOS_ADMIN_DNS, - "authorized_for_all_host_commands", NAGIOS_ADMIN_DNS, - "authorized_for_all_services", "*", - "authorized_for_all_hosts", "*", + "authorized_for_all_service_commands", NAGIOS_ADMIN_DNS, + "authorized_for_all_host_commands", NAGIOS_ADMIN_DNS, + "authorized_for_all_services", "*", + "authorized_for_all_hosts", "*", ); # configure Apache variable NAGIOS_APACHE_CONFIG ?= null; -include { NAGIOS_APACHE_CONFIG }; +include NAGIOS_APACHE_CONFIG; # configure list of users allowed to connect via https variable HTPASSWD_CONF ?= { - r="nagiosadmin:nsYHuWXBB5uSo\nguest:Hiah6S2SgI12.\n"; + r = "nagiosadmin:nsYHuWXBB5uSo\nguest:Hiah6S2SgI12.\n"; if ( exists(NAGIOS_ADMIN_DN_LIST) ) { foreach (i; dn; NAGIOS_ADMIN_DN_LIST) { - r=r+dn+":xxj31ZMTZzkVA\n"; + r = r + dn + ":xxj31ZMTZzkVA\n"; }; }; r; }; -include { 'components/filecopy/config' }; -"/software/components/filecopy/services" = - npush(escape("/etc/nagios/htpasswd.users"), - nlist("config",HTPASSWD_CONF,) +include 'components/filecopy/config'; +"/software/components/filecopy/services/{/etc/nagios/htpasswd.users}" = dict( + "config", HTPASSWD_CONF, ); # create symlink to workaround lib path in conf.d/nagios.conf -include { 'components/symlink/config' }; +include 'components/symlink/config'; "/software/components/symlink/options/replace/link" = "yes"; "/software/components/symlink/links" = { # config file for 64-bit Nagios rpm points to /usr/lib/nagios/cgi if ( PKG_ARCH_DEFAULT == "x86_64" ) { - push( - nlist( - "name", "/usr/lib/nagios/cgi", - "target", "/usr/lib64/nagios/cgi", - "exists", false, - ), - ); + push(dict( + "name", "/usr/lib/nagios/cgi", + "target", "/usr/lib64/nagios/cgi", + "exists", false, + )); } else { - if ( is_defined(SELF) ) { SELF } else { null }; + if (is_defined(SELF)) SELF else null; }; }; # optionally configure apache to start at boot variable NAGIOS_START_APACHE ?= false; +include 'components/chkconfig/config'; "/software/components/chkconfig/service/httpd" ?= { x = SELF; - if ( NAGIOS_START_APACHE ) { x['on'] = ''; } else { x['off'] = ''; }; + if ( NAGIOS_START_APACHE ) { + x['on'] = ''; + } else { + x['off'] = ''; + }; x['startstop'] = true; x; }; ## TODO: ensure that the host cert/key pair is installed for the Nagios server - diff --git a/sites/example/site/nagios/hostgroups/all.pan b/sites/example/site/nagios/hostgroups/all.pan index 85c3ee8..4ed2790 100644 --- a/sites/example/site/nagios/hostgroups/all.pan +++ b/sites/example/site/nagios/hostgroups/all.pan @@ -3,6 +3,6 @@ # structure template site/nagios/hostgroups/all; -include { 'site/nagios/hostgroups/cluster-A' }; -include { 'site/nagios/hostgroups/cluster-B' }; +include 'site/nagios/hostgroups/cluster-A'; +include 'site/nagios/hostgroups/cluster-B'; diff --git a/sites/example/site/nagios/hostgroups/cluster-A.pan b/sites/example/site/nagios/hostgroups/cluster-A.pan index 632d99e..99ac5c2 100644 --- a/sites/example/site/nagios/hostgroups/cluster-A.pan +++ b/sites/example/site/nagios/hostgroups/cluster-A.pan @@ -1,7 +1,7 @@ structure template site/nagios/hostgroups/cluster-A; # hostgroup including all Quattor-managed hosts -include { 'site/nagios/hostgroups/quattor-nodes' }; +include 'site/nagios/hostgroups/quattor-nodes'; # "lcg-ce/alias" = "lcg-CE"; # "lcg-ce/members" = push( 'some-host-in-cluster-A.example.org' ); diff --git a/sites/example/site/nagios/hostgroups/cluster-B.pan b/sites/example/site/nagios/hostgroups/cluster-B.pan index 64b2506..a1c2548 100644 --- a/sites/example/site/nagios/hostgroups/cluster-B.pan +++ b/sites/example/site/nagios/hostgroups/cluster-B.pan @@ -1,7 +1,7 @@ structure template site/nagios/hostgroups/cluster-B; # hostgroup including all Quattor-managed hosts -include { 'site/nagios/hostgroups/quattor-nodes' }; +include 'site/nagios/hostgroups/quattor-nodes'; # "cream-ce/alias" = "Cream-CE"; # "cream-ce/members" = push( 'some-host-in-cluster-B.example.org' ); diff --git a/sites/example/site/nagios/hosts/all.pan b/sites/example/site/nagios/hosts/all.pan index 56e6d0e..9fd925c 100644 --- a/sites/example/site/nagios/hosts/all.pan +++ b/sites/example/site/nagios/hosts/all.pan @@ -3,5 +3,5 @@ # structure template site/nagios/hosts/all; -include { 'site/nagios/hosts/cluster-A' }; -include { 'site/nagios/hosts/cluster-B' }; +include 'site/nagios/hosts/cluster-A'; +include 'site/nagios/hosts/cluster-B'; diff --git a/sites/example/site/nagios/hosts/quattor_host.pan b/sites/example/site/nagios/hosts/quattor_host.pan index bf25684..4204da4 100644 --- a/sites/example/site/nagios/hosts/quattor_host.pan +++ b/sites/example/site/nagios/hosts/quattor_host.pan @@ -1,8 +1,8 @@ # -# Host type quattor_host is derived from a generic_host, but adds the host to +# Host type quattor_host is derived from a generic_host, but adds the host to # host group quattor-nodes # structure template site/nagios/hosts/quattor_host; -include { 'monitoring/nagios/generic_host' }; +include 'monitoring/nagios/generic_host'; "hostgroups" = list( 'quattor-nodes' ); diff --git a/sites/example/site/nagios/master.pan b/sites/example/site/nagios/master.pan index 68903ec..eaa0a0f 100644 --- a/sites/example/site/nagios/master.pan +++ b/sites/example/site/nagios/master.pan @@ -6,13 +6,13 @@ template site/nagios/master; # this is a Nagios slave server -include { 'monitoring/nagios/master' }; +include 'monitoring/nagios/master'; # include common server config for the site -include { 'site/nagios/common' }; +include 'site/nagios/common'; # enable receiving NSCA check results -include { 'site/nagios/nsca' }; +include 'site/nagios/nsca'; variable NSCA_DAEMON_TEMPLATE ?= 'monitoring/nagios/nsca/daemon'; @@ -28,10 +28,10 @@ variable NAGIOS_HOSTS_TEMPLATE = 'site/nagios/hosts/all'; variable NAGIOS_HOSTGROUPS_TEMPLATE = 'site/nagios/hostgroups/all'; # Optional configuration for monitored clusters -## include { 'site/nagios/config/cluster-A' }; -## include { 'site/nagios/config/cluster-B' }; +## include 'site/nagios/config/cluster-A'; +## include 'site/nagios/config/cluster-B'; # Optional service template groups, # defining or adding services to NAGIOS_SERVICE_TEMPLATES -## include { 'site/nagios/config/services/serivce-templates' }; +## include 'site/nagios/config/services/serivce-templates'; diff --git a/sites/example/site/nagios/nsca.pan b/sites/example/site/nagios/nsca.pan index 5b0f7e2..45fd6aa 100644 --- a/sites/example/site/nagios/nsca.pan +++ b/sites/example/site/nagios/nsca.pan @@ -5,7 +5,7 @@ variable NSCA_ENCRYPTION_METHOD ?= 1; variable NSCA_DECRYPTION_METHOD = NSCA_ENCRYPTION_METHOD; # You may want to define in another template -# include { 'site/secrets/nsca' }; +# include 'site/secrets/nsca'; variable NSCA_PASSWORD ?= "this_is_not_a_good_password_so_change_me"; diff --git a/sites/example/site/nagios/site-commands.pan b/sites/example/site/nagios/site-commands.pan index 2461af1..975826b 100644 --- a/sites/example/site/nagios/site-commands.pan +++ b/sites/example/site/nagios/site-commands.pan @@ -6,19 +6,23 @@ structure template site/nagios/site-commands; # include the generic commands; they may be overridden below -include { 'monitoring/nagios/commands' }; +include 'monitoring/nagios/commands'; # use a configurable time-out for NRPE checks using NRPE_CHECK_COMMAND +# panlint disable=LP006 "check_nrpe" = NRPE_CHECK_COMMAND + " -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$ $ARG9$ $ARG10$ $ARG11$"; "check_nrpe_load" = NRPE_CHECK_COMMAND + " -H $HOSTADDRESS$ -c check_load -a $ARG1$ $ARG2$"; "check_nrpe_users" = NRPE_CHECK_COMMAND + " -H $HOSTADDRESS$ -c check_users -a $ARG1$ $ARG2$"; "check_nrpe_all_procs" = NRPE_CHECK_COMMAND + " -H $HOSTADDRESS$ -c check_all_procs -a $ARG1$ $ARG2$"; "check_nrpe_certdates" = NRPE_CHECK_COMMAND + " -H $HOSTADDRESS$ -c check_certdates -a $ARG1$ $ARG2$"; +# panlint disable=LP006 "check_nrpe_procs_zombie" = NRPE_CHECK_COMMAND + " -H $HOSTADDRESS$ -c check_procs_zombie -a $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$ $ARG9$"; +# panlint disable=LP006 "check_nrpe_pbs" = NRPE_CHECK_COMMAND + " -H $HOSTADDRESS$ -c check_pbs -a $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$ $ARG9$"; "check_nrpe_procs_swap" = NRPE_CHECK_COMMAND + " -H $HOSTADDRESS$ -c check_procs -a $ARG1$ $ARG2$ W"; "check_nrpe_swap" = NRPE_CHECK_COMMAND + " -H $HOSTADDRESS$ -c check_swap -a $ARG1$ $ARG2$ "; "check_nrpe_disk" = NRPE_CHECK_COMMAND + " -H $HOSTADDRESS$ -c check_disk -a $ARG1$ $ARG2$ $ARG3$"; +# panlint disable=LP006 "check_nrpe_iferrors" = NRPE_CHECK_COMMAND + " -H $HOSTADDRESS$ -c check_iferrors -a $ARG1$ $ARG2$ $ARG3$ '$SERVICEOUTPUT$'"; "process-host-perfdata-file" = "/bin/mv /var/nagios/host-perfdata /var/spool/pnp4nagios/host-perfdata.$TIMET$"; @@ -27,6 +31,7 @@ include { 'monitoring/nagios/commands' }; "check_dummy" = "$USER1/check_dummy $ARG1$ $ARG2$"; # for distributed monitoring +# panlint disable=LP006 "submit_check_result" = "$USER6$/submit_check_result '$HOSTNAME$' '$SERVICEDESC$' '$SERVICESTATE$' '$SERVICEOUTPUT$ | $SERVICEPERFDATA$'"; # get rid of perfdata configuration that leaves unneeded files at the server diff --git a/sites/example/site/nagios/slave-A.pan b/sites/example/site/nagios/slave-A.pan index b8fd12c..c539ff2 100644 --- a/sites/example/site/nagios/slave-A.pan +++ b/sites/example/site/nagios/slave-A.pan @@ -4,21 +4,21 @@ template site/nagios/slave-A; # this is a Nagios slave server -include { 'monitoring/nagios/slave' }; +include 'monitoring/nagios/slave'; # include common server config -include { 'site/nagios/common' }; +include 'site/nagios/common'; # Use OCP to submit check results to the Nagios master # which gives a much better performance at the slave # than direclty using send_nsca -# If this line is commented out, the default send_nsca is used (cf. definition of +# If this line is commented out, the default send_nsca is used (cf. definition of # NSCA_SUBMIT_RESULT_TEMPLATE below) -include { 'site/nagios/OCP_setup' }; +include 'site/nagios/OCP_setup'; # enable submitting checks via NSCA to Nagios master server -include { 'site/nagios/nsca' }; +include 'site/nagios/nsca'; variable NSCA_SEND_TEMPLATE ?= 'monitoring/nagios/nsca/send'; variable NSCA_SUBMIT_RESULT_TEMPLATE ?= 'monitoring/nagios/nsca/submit_check_result'; @@ -29,9 +29,9 @@ variable NAGIOS_HOSTS_TEMPLATE = 'site/nagios/hosts/cluster-A'; variable NAGIOS_HOSTGROUPS_TEMPLATE = 'site/nagios/hostgroups/cluster-A'; # Optional specific configuration for cluster A -## include { 'site/nagios/config/cluster-A' }; +## include 'site/nagios/config/cluster-A'; # Optional service template groups, # defining or adding services to NAGIOS_SERVICE_TEMPLATES -## include { 'site/nagios/config/services/serivce-templates' }; +## include 'site/nagios/config/services/serivce-templates'; diff --git a/sites/example/site/nagios/slave-B.pan b/sites/example/site/nagios/slave-B.pan index ed908c2..352a80d 100644 --- a/sites/example/site/nagios/slave-B.pan +++ b/sites/example/site/nagios/slave-B.pan @@ -4,21 +4,21 @@ template site/nagios/slave-B; # this is a Nagios slave server -include { 'monitoring/nagios/slave' }; +include 'monitoring/nagios/slave'; # include common server config -include { 'site/nagios/common' }; +include 'site/nagios/common'; # Use OCP to submit check results to the Nagios master # which gives a much better performance at the slave # than direclty using send_nsca -# If this line is commented out, the default send_nsca is used (cf. definition of +# If this line is commented out, the default send_nsca is used (cf. definition of # NSCA_SUBMIT_RESULT_TEMPLATE below) -include { 'site/nagios/OCP_setup' }; +include 'site/nagios/OCP_setup'; # enable submitting checks via NSCA to Nagios master server -include { 'site/nagios/nsca' }; +include 'site/nagios/nsca'; variable NSCA_SEND_TEMPLATE ?= 'monitoring/nagios/nsca/send'; variable NSCA_SUBMIT_RESULT_TEMPLATE ?= 'monitoring/nagios/nsca/submit_check_result'; @@ -29,9 +29,9 @@ variable NAGIOS_HOSTS_TEMPLATE = 'site/nagios/hosts/cluster-B'; variable NAGIOS_HOSTGROUPS_TEMPLATE = 'site/nagios/hostgroups/cluster-B'; # Optional specific configuration for cluster B -## include { 'site/nagios/config/cluster-B' }; +## include 'site/nagios/config/cluster-B'; # Optional service template groups, # defining or adding services to NAGIOS_SERVICE_TEMPLATES -## include { 'site/nagios/config/services/serivce-templates' }; +## include 'site/nagios/config/services/serivce-templates'; diff --git a/sites/example/site/named.pan b/sites/example/site/named.pan index 7dd66b7..c77f4dc 100644 --- a/sites/example/site/named.pan +++ b/sites/example/site/named.pan @@ -1,6 +1,6 @@ unique template site/named; -include { 'components/named/config' }; +include 'components/named/config'; "/software/components/named/servers" = NAMESERVERS; diff --git a/sites/example/site/one/frontend.pan b/sites/example/site/one/frontend.pan index 26d8cb8..65721d6 100644 --- a/sites/example/site/one/frontend.pan +++ b/sites/example/site/one/frontend.pan @@ -6,6 +6,10 @@ include 'site/one/variables'; include 'common/opennebula/one_auth'; include 'common/opennebula/mysql'; +include 'components/chkconfig/config'; +include 'components/dirperm/config'; +include 'components/download/config'; +include 'components/metaconfig/config'; include 'components/opennebula/config'; include 'site/one/resources'; @@ -22,7 +26,7 @@ prefix "/software/components/opennebula/oned"; "onegate_endpoint" = format("http://%s:5030", FULL_HOSTNAME); # vnet common templates -prefix '/software/components/opennebula/vnets/0/'; +prefix '/software/components/opennebula/vnets/0'; "name" = DEFAULT_DOMAIN; "bridge" = "bridge1"; "gateway" = DEFAULT_GATEWAY; @@ -34,10 +38,10 @@ variable OPENNEBULA_HYP_PREFIX ?= "hyp"; prefix "/software/components/opennebula"; "hosts" = { # add all hostnames starting with hyp - t=list(); - foreach (k;v;DB_IP) { + t = list(); + foreach (k; v; DB_IP) { if(match(k, format('^%s\d+', OPENNEBULA_HYP_PREFIX))) { - append(t,k); + append(t, k); }; }; t; @@ -69,8 +73,8 @@ prefix "/software/components/opennebula/rpc"; include 'common/download/service'; prefix "/software/components/download/files"; -"{/var/lib/one/.ssh/id_dsa}" = create("common/download/auth", - "href", "secure/privkey/id_dsa", +"{/var/lib/one/.ssh/id_dsa}" = create("common/download/auth", + "href", "secure/privkey/id_dsa", "group", "oneadmin", "owner", "oneadmin", "perm", "0600", @@ -84,18 +88,19 @@ prefix "/software/components/download/files"; ); prefix "/software/components/chkconfig/service"; -"opennebula" = dict("on", "","startstop", true); -"opennebula-econe" = dict("on", "","startstop", true); -"opennebula-gate" = dict("on", "","startstop", true); -"opennebula-novnc" = dict("on", "","startstop", true); -"opennebula-occi" = dict("on", "","startstop", true); -"opennebula-sunstone" = dict("on", "","startstop", true); - -prefix "/software/packages"; -"{opennebula-server}"=dict(); -"{opennebula-sunstone}"=dict(); -"{opennebula-gate}"=dict(); -"{opennebula-flow}"=dict(); +"opennebula" = dict("on", "", "startstop", true); +"opennebula-econe" = dict("on", "", "startstop", true); +"opennebula-gate" = dict("on", "", "startstop", true); +"opennebula-novnc" = dict("on", "", "startstop", true); +"opennebula-occi" = dict("on", "", "startstop", true); +"opennebula-sunstone" = dict("on", "", "startstop", true); + +"/software/packages" = { + pkg_repl("opennebula-server"); + pkg_repl("opennebula-sunstone"); + pkg_repl("opennebula-gate"); + pkg_repl("opennebula-flow"); +}; include 'site/one/rubygems'; @@ -107,14 +112,12 @@ bind "/software/components/metaconfig/services/{/var/lib/one/.ssh/config}/conten prefix "/software/components/metaconfig/services/{/var/lib/one/.ssh/config}"; "module" = "ssh/client"; "owner" = "oneadmin"; -"group"= "oneadmin"; +"group" = "oneadmin"; prefix "/software/components/metaconfig/services/{/var/lib/one/.ssh/config}/contents"; -"Host" = append( - dict( - "hostnames", list("*"), - "ControlMaster", "auto", - "ControlPath", "~/.ssh/%r@%h:%p", - ) - ); +"Host" = append(SELF, dict( + "hostnames", list("*"), + "ControlMaster", "auto", + "ControlPath", "~/.ssh/%r@%h:%p", +)); diff --git a/sites/example/site/one/onevm.pan b/sites/example/site/one/onevm.pan index f50ebbc..145e877 100644 --- a/sites/example/site/one/onevm.pan +++ b/sites/example/site/one/onevm.pan @@ -1,5 +1,7 @@ unique template site/one/onevm; +include 'components/chkconfig/config'; + # set opennebula map include 'quattor/aii/opennebula/schema'; bind "/system/opennebula" = opennebula_vmtemplate; @@ -9,4 +11,4 @@ include 'site/config-vm'; include 'quattor/aii/opennebula/default'; "/software/packages/{acpid}" = dict(); -"/software/components/chkconfig/service/acpid" = dict('on','', 'startstop',true); +"/software/components/chkconfig/service/acpid" = dict('on', '', 'startstop', true); diff --git a/sites/example/site/one/rubygems.pan b/sites/example/site/one/rubygems.pan index debbb79..6e45e0d 100644 --- a/sites/example/site/one/rubygems.pan +++ b/sites/example/site/one/rubygems.pan @@ -4,7 +4,7 @@ unique template site/one/rubygems; # Centos6 and Centos7 versions require different packages # These packages are generated by opennebula addon-installgems -'/software/packages/' = if ( OS_VERSION_PARAMS['majorversion'] == '7' ) +'/software/packages' = if ( OS_VERSION_PARAMS['majorversion'] == '7' ) { pkg_repl('rubygem-nokogiri'); pkg_repl('rubygem-json'); diff --git a/sites/example/site/openstack/config.pan b/sites/example/site/openstack/config.pan index e732cd2..423be0e 100644 --- a/sites/example/site/openstack/config.pan +++ b/sites/example/site/openstack/config.pan @@ -1,4 +1,4 @@ - + template site/openstack/config; #----------------------------------------------------------------------------- diff --git a/sites/example/site/os/version_db.pan b/sites/example/site/os/version_db.pan index 88bcb6b..46d3358 100644 --- a/sites/example/site/os/version_db.pan +++ b/sites/example/site/os/version_db.pan @@ -6,7 +6,7 @@ unique template site/os/version_db; # can be either machine names or OS major versions (e.g. 'el7') that are used as # default when there is no node specific entries. # This variable can also be defined in a machine profile or at the cluster -# level to override the distribution used for a specific machine or cluster, +# level to override the distribution used for a specific machine or cluster, # for example using (OBJECT refers to the current machine): # variable YUM_OS_DISTRIBUTION ?= dict(OBJECT, 'centos7'); # Be sure not define entries for the corresponding machines in the @@ -46,6 +46,3 @@ variable OS_VERSION = dict( '{nagios-slave-A.example.org}', 'el7x-x86_64', '{nagios-slave-B.example.org}', 'el7x-x86_64', ); - - - diff --git a/sites/example/site/wmslb/vos.pan b/sites/example/site/wmslb/vos.pan index 2b751b6..4842526 100644 --- a/sites/example/site/wmslb/vos.pan +++ b/sites/example/site/wmslb/vos.pan @@ -1,6 +1,7 @@ unique template site/wmslb/vos; -variable VOS = list('dteam', - 'ops', - ); - +# panlint disable=LP011 +variable VOS = list( + 'dteam', + 'ops', +); diff --git a/sites/example/site/xen/db.pan b/sites/example/site/xen/db.pan index 161fcd9..fad9e87 100644 --- a/sites/example/site/xen/db.pan +++ b/sites/example/site/xen/db.pan @@ -1,6 +1,6 @@ template site/xen/db; -variable XEN_DB = nlist( - "xen-host.example.org", list("xen-guest.example.org","wn.example.org") +variable XEN_DB = dict( + "xen-host.example.org", list("xen-guest.example.org", "wn.example.org") ); diff --git a/sites/example/vo/site/vos_base_gids.pan b/sites/example/vo/site/vos_base_gids.pan index 61ec7a3..48f43f2 100644 --- a/sites/example/vo/site/vos_base_gids.pan +++ b/sites/example/vo/site/vos_base_gids.pan @@ -1,6 +1,6 @@ unique template vo/site/vos_base_gids; -#ariable VOS_BASE_GID = nlist("vo.agata.org", 36000, +#ariable VOS_BASE_GID = dict("vo.agata.org", 36000, # "alice", 1000, # "astro.vo.eu-egee.org", 37000, # "atlas", 2000,