pf-tools/pf-tools: documenation, work in progress

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Mon Jan 19 13:55:08 UTC 2015


details:   http://hg.debian.org/hg/pf-tools/pf-tools/rev/ef0e9f4d92a7
changeset: 1443:ef0e9f4d92a7
user:      melkor <melkor at sitadelle.com>
date:      Mon Jan 19 14:55:05 2015 +0100
description:
documenation, work in progress

diffstat:

 doc/global-hash |  75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 75 insertions(+), 0 deletions(-)

diffs (82 lines):

diff -r d080942c9d28 -r ef0e9f4d92a7 doc/global-hash
--- a/doc/global-hash	Mon Jan 19 10:10:03 2015 +0100
+++ b/doc/global-hash	Mon Jan 19 14:55:05 2015 +0100
@@ -1,3 +1,78 @@
+This vriable store data parsed from ini files.
+
+Sub list add object in global hash in order of calling from @sortnetkeys in Conf.pm:
+   * add_zone 
+   * add_site
+   * add_network
+   * add_server
+   * __add_service 
+
+- add_zone sub from Conf/Network.pm create {ZONE|ZONE6}{BY_NAME}{private} sections with empty
+  {ALL_SITES}, empty {BY_SITE} and add {SOA] information taken from object "type = zone" from
+  private-network (start-file in pf-tools.conf).
+
+- add_size sub from Conf/Network.pm, with $section_name has value of section of object
+  'type = site', '$zone' value of 'zone' key in object 'type = site':
+    * push in {SITE}{ROOT} and {SITE}{EDGE}: keys 'state' of object 'type = site'
+    * in {SITE}{$section_name} :
+        - add empty {NETWORK}{BY_NAME} 
+        - add empty {NETWORK}{BY_TAG}
+        - add empty {HOST}{BY_NAME} 
+        - and empty {HOST}{BY_MAC}
+        - add empty {SERVICE}{BY_NAME}
+    * add empty {ZONE|ZONE6}{BY_NAME}{$zone}{BY_SITE}{$section_name}
+    * {ZONE|ZONE6}{BY_SITE}{$section_name} = $zone
+    * add empty {DHCP|DHCP6}{'BY_SITE'}{$section_name}{subnet}
+    * add empty {DHCP|DHCP6}{'BY_SITE'}{$section_name}{netmask}
+
+- add_network from Conf/Network.pm foreach $site define in 'site' keys of oject "type = network"
+    * add empty {PUBLIC_NETWORK}{$section_name} if key 'scope' is 'public'
+    * create NetAddr::IP object from 'network' or 'network6' and 'netmask' or 'netmask' if defined
+    * add $section_name in {SITE}{BY_NAME}{$site}{NETWORK}{BY_ADDR|BY_ADDR6}{$cidr}
+    * add $section_name in {SITE}{BY_NAME}{$site}{NETWORK}{BY_TAG}{$tag}
+    * add hash in $section_name in {SITE}{BY_NAME}{$site}{NETWORK}{BY_NAME} with keys:
+        - scope: key 'scope' of oject "type = network"
+        - comment: key 'comment' of oject "type = network"
+        - network or network6: value from NetAddr::IP object
+        - netmask or netmask6: value from NetAddr::IP object
+        - gateway or gateway6: ip calculate from value of gateway (or gateway6) key of section
+          and NetAddr::IP object
+        - tag: key 'tag'of oject "type = network"
+    * add in {DHCP|DHCP6}{BY_SITE}{$site}{$section_name}:
+        - subnet: value from NetAddr::IP object
+        - netmask: value from NetAddr::IP object
+        - routers: value of 'gateway' in {SITE}{BY_NAME}{$site}{NETWORK}{BY_NAME}
+    * if scope is 'private' add in {ZONE|ZONE6}{BY_NAME}{$zone}{BY_SITE} else add in 
+      {ZONE|ZONE6}{BY_NAME}{$zone}{ALL_SITE}, "zone" take from site section
+        - network: string "A {SITE}{BY_NAME}{$site}{NETWORK}{BY_NAME}{network|network6}
+        - netmask: string "A {SITE}{BY_NAME}{$site}{NETWORK}{BY_NAME}{netmask|netmask6}
+        - comment: value of {SITE}{BY_NAME}{$site}{NETWORK}{BY_NAME}{comment|comment6}
+        - brodcast: value from NetAddr::IP objec
+        - gateway: string "A {SITE}{BY_NAME}{$site}{NETWORK}{BY_NAME}{gateway|gateway6}
+
+- add_server from Conf/Host.pm add section "type = server", foreach $site define in 'site' keys,
+  $hostclass value can be taken from 'hosttype' key or SHORTNAME,
+    * for all $hostname generated with hostnum and hostanme
+        - add {SITE}{BY_NAME}{$site}{HOST}{BY_NAME}{$hostclass}{$hostname}{deployment}:
+            * hostname_model: section name of type 'server'
+            * hosttype: 'hosttype' key from section or SHORTHOSTNAME
+            * order: 'ordre' key of section
+        - foreach ipv4 ir ipv6 defined in section add in {SITE}{BY_NAME}{$site}{HOST}{BY_NAME}{$hostclass}{$hostname}{interface}{$iface}, $iface is generated with increment (eth0, eth1, ...)
+            * vlan: in key 'ipv4.vlan-systeme', value is 'vlan-systeme'
+            * ipv4 or ipv6: calculate with subnet of NetAddr::IP object create from {SITE}{BY_NAME}{$site}{NETWORK}{BY_NAME}{$vlan}{network|network6} (vlan see up) and value of 'ipv4.vlan-systeme' key in the exemple: ipv4.vlan-systeme = 168.0 => 10.128.168.0
+        - foreach ipv4 ir ipv6 defined in section 
+            * add in {ZONE|ZONE6}{BY_NAME}{$zone}{BY_SITE}{$site}{$hostclass} or in {ZONE|ZONE6}{BY_NAME}{$zone}{ALL_SITE}{$hostclass}:
+                - comment: key 'comment' of section
+                - number: key 'number' of section
+                - ${hostname}.${vlanname}: string "A $ip"
+                - ${hosttype}.${vlanname}: array of string with "A $ip", one line foreach host in hostgroup
+                - $hostname: string "CNAME ${hostname}.${vlanname}"
+                - $hosttype: string "CNAME ${hosttype}.${vlanname}"
+                - $alias: string "CNAME ${hostname}.${vlanname}" with $alias has 'cvs' value in key 'alias.cvs = vlan-systeme' and $vlanname is value
+
+- __add_service from Conf.pm, for all site in key 'site' of section 'type = service', foreach value in '@host' key load configuration from file designed by value and call add_host from Conf/Host.pm:
+    * 
+
 $VAR1 = {
     'DHCP' => {
         'BY_SITE' => {



More information about the pf-tools-commits mailing list