summaryrefslogtreecommitdiffstats
path: root/util/docker-compose/roles/cobbler/templates/dhcp.template.j2
diff options
context:
space:
mode:
authorHarry Huang <huangxiangyu5@huawei.com>2017-11-07 15:30:51 +0800
committerHarry Huang <huangxiangyu5@huawei.com>2017-12-21 15:35:12 +0800
commita360411cb8c775dffa24a4157cec2b566cbde6f3 (patch)
tree400e879a6f6779c294d7f2113c05b29d5578cff3 /util/docker-compose/roles/cobbler/templates/dhcp.template.j2
parent4074d39e93d7e7697dd2aaad2e08433ca0a60221 (diff)
Add compass-docker-compose
1. Add ansible for docker compose containerized compass 2. deploy/conf/compass.conf no longer specify image tags for runtime. build.yaml now is added into compass tarball to be the only place determine image tags 3. This patch is based on patch: https://gerrit.opnfv.org/gerrit/#/c/47393/ use merged compass-tasks 4. Tempoarily using private docker repo for compass-tasks. Switch to opnfv repo when patch https://gerrit.opnfv.org/gerrit/#/c/47329/ is merged 5. Modify ansible callback module accrodingly Change-Id: I0728a9002a1cc7804c9e8f13bd1afdccb684a159 Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
Diffstat (limited to 'util/docker-compose/roles/cobbler/templates/dhcp.template.j2')
-rwxr-xr-xutil/docker-compose/roles/cobbler/templates/dhcp.template.j297
1 files changed, 97 insertions, 0 deletions
diff --git a/util/docker-compose/roles/cobbler/templates/dhcp.template.j2 b/util/docker-compose/roles/cobbler/templates/dhcp.template.j2
new file mode 100755
index 00000000..0665f2fe
--- /dev/null
+++ b/util/docker-compose/roles/cobbler/templates/dhcp.template.j2
@@ -0,0 +1,97 @@
+# ******************************************************************
+# Cobbler managed dhcpd.conf file
+#
+# generated from cobbler dhcp.conf template ($date)
+# Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
+# in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
+# overwritten.
+#
+# ******************************************************************
+
+ddns-update-style interim;
+
+allow booting;
+allow bootp;
+deny unknown-clients;
+local-address {{ host_ip }};
+log-facility local6;
+
+ignore client-updates;
+set vendorclass = option vendor-class-identifier;
+
+option pxe-system-type code 93 = unsigned integer 16;
+option space pxelinux;
+option pxelinux.magic code 208 = string;
+option pxelinux.configfile code 209 = text;
+option pxelinux.pathprefix code 210 = text;
+option pxelinux.reboottime code 211 = unsigned integer 32;
+
+subnet {{ install_subnet }} netmask {{ install_netmask }} {
+ option routers {{ host_ip }};
+ option domain-name-servers {{ host_ip }};
+ option subnet-mask {{ install_netmask }};
+ range dynamic-bootp {{ install_ip_range }};
+ default-lease-time 21600;
+ max-lease-time 43200;
+ next-server {{ host_ip }};
+ class "pxeclients" {
+ match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
+ if option pxe-system-type = 00:02 {
+ filename "ia64/elilo.efi";
+ } else if option pxe-system-type = 00:06 {
+ filename "grub/grub-x86.efi";
+ } else if option pxe-system-type = 00:07 {
+ filename "grub/grub-x86_64.efi";
+ } else {
+ filename "pxelinux.0";
+ }
+ }
+
+}
+
+#for dhcp_tag in $dhcp_tags.keys():
+ ## group could be subnet if your dhcp tags line up with your subnets
+ ## or really any valid dhcpd.conf construct ... if you only use the
+ ## default dhcp tag in cobbler, the group block can be deleted for a
+ ## flat configuration
+# group for Cobbler DHCP tag: $dhcp_tag
+group {
+ #for mac in $dhcp_tags[$dhcp_tag].keys():
+ #set iface = $dhcp_tags[$dhcp_tag][$mac]
+ host $iface.name {
+ hardware ethernet $mac;
+ site-option-space "pxelinux";
+ option pxelinux.magic f1:00:74:7e;
+ if exists dhcp-parameter-request-list {
+ # Always send the PXELINUX options (specified in hexadecimal)
+ option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3);
+ }
+ option pxelinux.reboottime 30;
+ #if $iface.hostname:
+ option host-name "$iface.hostname";
+ #end if
+ #if $iface.netmask:
+ option subnet-mask $iface.netmask;
+ #end if
+ #if $iface.gateway:
+ option routers $iface.gateway;
+ #end if
+ #if $iface.enable_gpxe:
+ if exists user-class and option user-class = "gPXE" {
+ filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
+ } else if exists user-class and option user-class = "iPXE" {
+ filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
+ } else {
+ filename "undionly.kpxe";
+ }
+ #else
+ filename "$iface.filename";
+ #end if
+ ## Cobbler defaults to $next_server, but some users
+ ## may like to use $iface.system.server for proxied setups
+ next-server $next_server;
+ ## next-server $iface.next_server;
+ }
+ #end for
+}
+#end for