You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tashi-commits@incubator.apache.org by rg...@apache.org on 2011/07/29 13:29:14 UTC
svn commit: r1152214 - in
/incubator/tashi/branches/zoni-dev/trunk/src/zoni/install: dnsdhcp/
dnsdhcp/zoniDnsDhcpSetup.py pxe/base-menu pxe/zoniPxeSetup.py
Author: rgass
Date: Fri Jul 29 13:29:13 2011
New Revision: 1152214
URL: http://svn.apache.org/viewvc?rev=1152214&view=rev
Log:
helper script to generate the keys for dns/dhcp
Added:
incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/dnsdhcp/
incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/dnsdhcp/zoniDnsDhcpSetup.py (with props)
Modified:
incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/pxe/base-menu
incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/pxe/zoniPxeSetup.py
Added: incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/dnsdhcp/zoniDnsDhcpSetup.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/dnsdhcp/zoniDnsDhcpSetup.py?rev=1152214&view=auto
==============================================================================
--- incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/dnsdhcp/zoniDnsDhcpSetup.py (added)
+++ incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/dnsdhcp/zoniDnsDhcpSetup.py Fri Jul 29 13:29:13 2011
@@ -0,0 +1,83 @@
+#!/usr/bin/env python
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# $Id:$
+#
+
+import os
+import sys
+import string
+import traceback
+import optparse
+import getpass
+
+a = os.path.join("../")
+sys.path.append(a)
+a = os.path.join("../../")
+sys.path.append(a)
+a = os.path.join("../../..")
+sys.path.append(a)
+
+from zoni.version import *
+from zoni.extra.util import *
+
+
+def main():
+ ''' This file sets up the database for Zoni '''
+
+ ver = version.split(" ")[0]
+ rev = revision
+
+
+ parser = optparse.OptionParser(usage="%prog -k keyname", version="%prog " + ver + " " + rev)
+ parser.add_option("-k", "--keyName", "--keyname", dest="keyName", help="Key name")
+ #parser.add_option("-v", "--verbose", dest="verbosity", help="Be verbose", action="store_true", default=False)
+ (options, args) = parser.parse_args()
+
+ if not options.keyName:
+ parser.print_help()
+ exit(1)
+
+ (configs, configFiles) = getConfig()
+
+
+ key = createKey(options.keyName)
+ print "################## DHCP #####################"
+ print "# Put the following lines in your dhcpd.conf file\n\n"
+ print "key %s {" % options.keyName
+ print " algorithm hmac-md5;"
+ print " secret %s" % key
+ print "};"
+ print ""
+ print "omapi-key %s" % options.keyName
+ print "omapi-port 7911;\n\n"
+
+ print "################## DNS #####################"
+ print "# Put the following in your dns configuration files"
+ print "# E.g. /etc/bind/named.conf.local\n\n"
+ print "key %s { algorithm hmac-md5; secret \"%s\"; };" % (options.keyName, key)
+ print "\n\nDon't forget to add the following to your zone configs to allow updates\n\n"
+ print "allow-update { key %s; };" % options.keyName
+ print "\n\n"
+
+
+
+
+if __name__ == "__main__":
+ main()
+
Propchange: incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/dnsdhcp/zoniDnsDhcpSetup.py
------------------------------------------------------------------------------
svn:executable = *
Modified: incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/pxe/base-menu
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/pxe/base-menu?rev=1152214&r1=1152213&r2=1152214&view=diff
==============================================================================
--- incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/pxe/base-menu (original)
+++ incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/pxe/base-menu Fri Jul 29 13:29:13 2011
@@ -1,18 +1,18 @@
DISPLAY boot-screens/boot.txt
LABEL zoni-register-64
- kernel builds/amd64/zoni-reg/linux
- append initrd=builds/amd64/zoni-reg/initrd.gz pxeserver=192.168.0.5 imageserver=192.168.0.254 defaultimage=amd64-tashi_nm registerfile=register_node mode=register console=tty1 rw --
+ kernel builds/amd64/zoni-reg/linux
+ append initrd=builds/amd64/zoni-reg/initrd.gz pxeserver=10.10.0.5 imageserver=10.10.0.5 defaultimage=amd64-tashi_nm registerfile=register_node mode=register console=tty1 rw --
LABEL zoni-register-64-interactive
- kernel builds/amd64/zoni-reg/linux
- append initrd=builds/amd64/zoni-reg/initrd_zoni_interactive.gz pxeserver=192.168.0.5 imageserver=192.168.0.254 defaultimage=amd64-tashi_nm registerfile=register_node mode=register verbose=1 console=tty1 rw --
+ kernel builds/amd64/zoni-reg/linux
+ append initrd=builds/amd64/zoni-reg/initrd_zoni_interactive.gz pxeserver=192.168.0.5 imageserver=192.168.0.254 defaultimage=amd64-tashi_nm registerfile=register_node mode=register verbose=1 console=tty1 rw --
LABEL localdisk
LOCALBOOT 0
LABEL rescue
- kernel ubuntu-installer/hardy/i386/linux
- append vga=normal initrd=ubuntu-installer/hardy/i386/initrd.gz rescue/enable=true --
+ kernel ubuntu-installer/hardy/i386/linux
+ append vga=normal initrd=ubuntu-installer/hardy/i386/initrd.gz rescue/enable=true --
PROMPT 1
TIMEOUT 100
Modified: incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/pxe/zoniPxeSetup.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/pxe/zoniPxeSetup.py?rev=1152214&r1=1152213&r2=1152214&view=diff
==============================================================================
--- incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/pxe/zoniPxeSetup.py (original)
+++ incubator/tashi/branches/zoni-dev/trunk/src/zoni/install/pxe/zoniPxeSetup.py Fri Jul 29 13:29:13 2011
@@ -77,6 +77,8 @@ def ZoniPxeSetup(config):
createDir(dirName)
createDir(tftpImageDir)
createDir(tftpBootOptionsDir)
+
+
# Find the base files to copy