From 16e56fce9d0a80fdd44927349b3450f98c70813d Mon Sep 17 00:00:00 2001 From: Spencer Krum Date: Sat, 6 Feb 2016 23:16:15 -0800 Subject: [PATCH] Script to generate dns for infracloud This script makes management of 100+ dns names more realistic It only outputs commands to rackdns, it does not run them Change-Id: I48ecaca79eb1cd274f102da6eb3592a292b7a5fb --- tools/infracloud_dns_from_bifrost.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 tools/infracloud_dns_from_bifrost.py diff --git a/tools/infracloud_dns_from_bifrost.py b/tools/infracloud_dns_from_bifrost.py new file mode 100755 index 0000000000..989be4da7c --- /dev/null +++ b/tools/infracloud_dns_from_bifrost.py @@ -0,0 +1,13 @@ +#!/usr/bin/python + +import yaml + +f = open('hiera/group/infracloud.yaml') + +bf = yaml.load(f.read()) + +for node in bf['ironic_inventory_hpuswest']: + name = node + ip = bf['ironic_inventory_hpuswest'][node]['ipv4_public_address'] + print "rackdns record-create --name {0} --type A".format(name), + print "--data {0} --ttl 3600 openstack.org".format(ip)