X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=tools%2Fj2%2Fserverrc.j2;h=bb7686b554e5a1a00bc665cfc5771e8b55592c70;hb=fbb206730195c6f03ded7658d08f1ef708ebf88b;hp=d20c2ab2d37635e5b1fbf3d9f2170f2990018270;hpb=0a2885e1506c60df0e39d1681657661bacd39670;p=yaml_builds.git diff --git a/tools/j2/serverrc.j2 b/tools/j2/serverrc.j2 index d20c2ab..bb7686b 100644 --- a/tools/j2/serverrc.j2 +++ b/tools/j2/serverrc.j2 @@ -33,16 +33,16 @@ SRV_MAC={{yaml.genesis.mac_address}} {% endif %} # the boot device is the device name on which the OS will be loaded -SRV_BOOT_DEVICE={{yaml.disks[0].name}} -SRV_CEPH_DEVICE={{yaml.disks[1].name}} +SRV_BOOT_DEVICE={{yaml.hardware.device_aliases|selectattr('key', 'equalto', 'bootdisk') | map(attribute='name')|first|replace("/dev/","")}} +SRV_CEPH_DEVICE={{yaml.hardware.device_aliases|selectattr('key', 'equalto', 'cephjournal1') | map(attribute='name')|first|replace("/dev/","")}} # ipxe script to use - based on the os version and kernel to install # valid options are script-hwe-16.04.6-amd64.ipxe or script-16.04.6-amd64.ipxe SRV_BLD_SCRIPT=script-hwe-16.04.6-amd64.ipxe # template xml file to set bios and raid configuration settings -SRV_BIOS_TEMPLATE={% if 'bios_template' in yaml.genesis %}{{yaml.genesis.bios_template}} - {% else %}{{yaml.hardware.bios_template}} +SRV_BIOS_TEMPLATE={% if 'bios_template' in yaml.genesis %}{{yaml.genesis.bios_template|default("",true)}} + {% else %}{{yaml.hardware.bios_template|default("",true)}} {% endif %} SRV_BOOT_TEMPLATE={% if 'boot_template' in yaml.genesis %}{{yaml.genesis.boot_template}} {% else %}{{yaml.hardware.boot_template}} @@ -54,6 +54,7 @@ SRV_HTTP_BOOT_DEV={% if 'http_boot_device' in yaml.genesis %}{{yaml.genesis.http # tempalte to run to configure OS after first boot # current options are: firstboot.sh.template, firstboot-genesis.sh.tempate or firstboot-airship-iab.sh.template SRV_FIRSTBOOT_TEMPLATE=firstboot-genesis.sh.template +SRV_KERNEL_PARAMS="{% if 'platform' in yaml %}{% for key, value in yaml.platform.kernel_params.items() %}{{key}}={{value}}{{ ' ' if not loop.last else '' }}{% endfor %}{% endif %}" # VLAN to use during build and for final network configuration SRV_VLAN={{yaml.networks.host.vlan}} @@ -61,7 +62,7 @@ SRV_STORAGE_VLAN={{yaml.networks.storage.vlan}} SRV_CALICO_VLAN={{yaml.networks.ksn.vlan}} SRV_NEUTRON_VLAN={{yaml.networks.neutron.vlan}} SRV_PXE_INF={{yaml.networks.pxe.interface}} -SRV_VXLAN_INF={{yaml.networks.vxlan.interface}} +SRV_VXLAN_INF={% if 'vxlan' in yaml.networks %}{{yaml.networks.vxlan.interface}}{% endif %} # basic network information for dhcp config and final server network settings SRV_MTU=9000 @@ -70,7 +71,8 @@ SRV_STORAGE_IP={{yaml.genesis.storage}} SRV_CALICO_IP={{yaml.genesis.ksn}} SRV_NEUTRON_IP={{yaml.genesis.neutron}} SRV_PXE_IP={{yaml.genesis.pxe}} -SRV_VXLAN_IP={{yaml.genesis.vxlan}} +SRV_VXLAN_IP={% if 'vxlan' in yaml.networks %}{{yaml.genesis.vxlan}}{% endif %} + SRV_SUBNET={{yaml.networks.host.cidr | cidr_subnet}} SRV_NETMASK={{yaml.networks.host.cidr | cidr_netmask}} SRV_GATEWAY={{yaml.networks.host.routes.gateway}} @@ -91,4 +93,3 @@ SRV_BOND={{yaml.networks.primary}} {% for slave in yaml.networks.slaves %} SRV_SLAVE{{loop.index}}={{slave.name}} {% endfor %} -