Changeset 10459 in genesis


Ignore:
Timestamp:
Apr 12, 2012, 9:11:28 PM (13 years ago)
Author:
rick
Message:

Special Hybrid configuration tree, with service_* to enable/disable features.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nodes/CNodeRick/wleiden.yaml

    r10454 r10459  
    1010masterip  : "172.20.145.1"
    1111nodename  : "Rick"
    12 nodetype  : "CNode"
     12nodetype  : "Hybrid"
    1313rdnap_x   : 92280
    1414rdnap_y   : 461707
    1515release   : "9.0-RELEASE"
    1616remote_access: "riff.vanderzwet.net:2022"
    17 service_nat: True
     17service_ileiden: True
    1818service_proxy: True
    1919status    : "up"
     
    7070  sdesc      : "2external"
    7171  type       : "eth"
    72   dhcp       : "False"
     72  dhcp       : False
    7373  compass    : "None"
    7474  dhcpclient : True
  • tools/gformat.py

    r10455 r10459  
    9696      datadump[key]['autogen_ifname'] = datadump[key]['interface'].split(':')[0]
    9797
    98   dhcp_interfaces = [datadump[key]['autogen_ifname'] for key in datadump['autogen_iface_keys'] if datadump[key]['dhcp'] != 'no']
    99   datadump['autogen_dhcp_interfaces'] = ' '.join(dhcp_interfaces)
     98  dhcp_interfaces = [datadump[key]['autogen_ifname'] for key in datadump['autogen_iface_keys'] if datadump[key]['dhcp']]
     99  datadump['autogen_dhcp_interfaces'] = ','.join(dhcp_interfaces)
    100100  datadump['autogen_item'] = item
    101101
     
    457457nodetype="{{ nodetype }}"
    458458
    459 {% if tproxy -%}
    460 tproxy_enable='YES'
    461 tproxy_range='{{ tproxy }}'
    462 {% else -%}
    463 tproxy_enable='NO'
    464 {% endif -%}
    465 
    466 {% if nodetype == "Proxy" or nodetype == "Hybrid" %}
    467 #
    468 # Edge Configuration
    469 #
    470 
    471 
    472 # Firewall and Routing Configuration
    473 
     459#
     460# Configured listings
     461#
     462captive_portal_whitelist=""
     463captive_portal_interfaces="{{ autogen_dhcp_interfaces }}"
     464# iLeiden Proxies {{ autogen_ileiden_proxies_names }}
     465list_ileiden_proxies="{{ autogen_ileiden_proxies }}"
     466# normal Proxies {{ autogen_normal_proxies_names }}
     467list_normal_proxies="{{ autogen_normal_proxies }}"
     468
     469{% if nodetype == "Proxy" %}
     470#
     471# Proxy Configuration
     472#
    474473{% if gateway -%}
    475474defaultrouter="{{ gateway }}"
     
    495494{% endif -%}
    496495
    497 {% if nodetype == "CNode" %}
     496{% if nodetype == "Hybrid" %}
     497#
     498# Hybrid Configuration
     499#
     500captive_portal_interfaces="{{ autogen_dhcp_interfaces }}"
     501
     502pf_rules="/etc/pf.hybrid.conf"
     503{% if service_ileiden -%}
     504# Service iLeiden
     505pf_flags="-D ext_if={{ externalif }} -D captive_portal_interfaces=${captive_portal_interfaces:-'none'} -D publicnat=80,443"
     506{% else -%}
     507pf_flags="-D ext_if={{ externalif }} -D captive_portal_interfaces=${captive_portal_interfaces:-'none'} -D publicnat=0"
     508{% endif -%}
     509
     510{% if service_proxy %}
     511# Service Proxy
     512tinyproxy_enable="yes"
     513{% endif -%}
     514
     515{% if gateway -%}
     516defaultrouter="{{ gateway }}"
     517{% endif -%}
     518#
     519# END Hybrid Configuration
     520#
     521{% endif -%}
     522
     523
     524{% if nodetype == "CNode" %}
    498525#
    499526# NODE iLeiden Configuration
    500527#
    501 # iLeiden Proxies {{ autogen_ileiden_proxies_names }}
    502 list_ileiden_proxies="{{ autogen_ileiden_proxies }}"
    503 # normal Proxies {{ autogen_normal_proxies_names }}
    504 list_normal_proxies="{{ autogen_normal_proxies }}"
     528
     529{% if tproxy -%}
     530tproxy_enable='YES'
     531tproxy_range='{{ tproxy }}'
     532{% else -%}
     533tproxy_enable='NO'
     534{% endif -%}
    505535
    506536lvrouted_flags="-u -s s00p3rs3kr3t -m 28 -z $list_ileiden_proxies"
    507537{% endif %}
    508 {% if vpnif -%}
    509   vpnif="{{ vpnif }}"
    510 {% endif -%}
    511 
    512 captive_portal_whitelist=""
    513 captive_portal_interfaces="{{ autogen_dhcp_interfaces }}"
    514538\n
    515539""").render(datadump)
     
    11481172            if type(dump[key]) == dict:
    11491173              dump[key] = fix_boolean(dump[key])
    1150             elif str(dump[key]).lower() == "yes":
     1174            elif str(dump[key]).lower() in ["yes", "true"]:
    11511175              dump[key] = True
    1152             elif str(dump[key]).lower() == "no":
     1176            elif str(dump[key]).lower() in ["no", "false"]:
    11531177              # Compass richting no (Noord Oost) is valid input
    1154               if key != "compass":
    1155                 dump[key] = False
     1178              if key != "compass": dump[key] = False
    11561179          return dump
    11571180        datadump = fix_boolean(datadump)
Note: See TracChangeset for help on using the changeset viewer.