Skip to content

Commit

Permalink
Merge pull request #18 from designate-dns/austin
Browse files Browse the repository at this point in the history
Austin
  • Loading branch information
grahamhayes committed Oct 26, 2016
2 parents 184225e + 68305d3 commit 3660eae
Show file tree
Hide file tree
Showing 21 changed files with 1,637 additions and 980 deletions.
3 changes: 3 additions & 0 deletions Makefile
Expand Up @@ -22,4 +22,7 @@ files:
build: packer files
./packer/packer build template.json

debug: packer files
./packer/packer build -debug template.json

.PHONY: all clean files build
2 changes: 1 addition & 1 deletion Vagrantfile
Expand Up @@ -12,7 +12,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.network "forwarded_port", guest: 5000, host: 5000

config.vm.provider "virtualbox" do |box|
box.customize ["modifyvm", :id, "--memory", "2048"]
box.customize ["modifyvm", :id, "--memory", "3072"]
box.customize ["modifyvm", :id, "--cpus", "2"]
box.customize ["modifyvm", :id, "--hwvirtex", "on"]
end
Expand Down
51 changes: 51 additions & 0 deletions files/client.sh
@@ -0,0 +1,51 @@
#/bin/bash
set -e
set -o pipefail

source openrc.user1
echo "source user1 credentials"

openstack zone list
echo "listed zones - nothing here!"

echo "creating openstack.org."
openstack zone create --email user@openstack.org openstack.org.

sleep 20
openstack zone list

echo "creating a recordset"
openstack recordset create --type A --records 127.0.0.1 --ttl 300 openstack.org. foo

sleep 20
openstack recordset list openstack.org.

echo "deleting openstack.org"
openstack zone delete openstack.org.

sleep 5
openstack zone list
echo "listed zones - nothing here"

echo "importing a zone"
openstack zone import create importdemo.txt

sleep 10
openstack zone import list

IMPORT_ID=$(openstack zone import list -f value | cut -d ' ' -f 1)
openstack zone import delete "$IMPORT_ID"

openstack zone list

echo "export the zone!"
openstack zone export create designatedemo.com.

sleep 10
EXPORT_ID=$(openstack zone export list -f value | cut -d ' ' -f 1)
openstack zone export showfile "$EXPORT_ID" -f value

openstack zone export delete "$EXPORT_ID"

openstack zone delete designatedemo.com.

52 changes: 6 additions & 46 deletions files/designate.conf
Expand Up @@ -18,7 +18,7 @@ state_path = /home/vagrant/state
#log_config = None

# Log directory
logdir = /home/vagrant/logs
log-dir = /home/vagrant/logs

# Log to stderr
use_stderr = False
Expand Down Expand Up @@ -181,12 +181,12 @@ cache_driver = memcache
[network_api:neutron]
# Comma separated list of values, formatted "<name>|<neutron_uri>"
#endpoints = RegionOne|http://localhost:9696
#endpoint_type = publicURL
endpoint_type = publicURL
#timeout = 30
#admin_username = designate
#admin_password = designate
#admin_tenant_name = designate
#auth_url = http://localhost:35357/v2.0
admin_username = service
admin_password = password
admin_tenant_name = service
auth_url = http://localhost:35357/v2.0
#insecure = False
#auth_strategy = keystone
#ca_certificates_file =
Expand Down Expand Up @@ -255,46 +255,6 @@ connection = mysql://root@127.0.0.1/designate?charset=utf8
#memcached_servers = None
#expiration = 3600

#####################
## Pool Configuration
#####################

[pool:794ccc2c-d751-44fe-b57f-8894c9f5c842]
# Nameservers and Target listed here MUST have matching sections
# below.
nameservers = 0f66b842-96c2-4189-93fc-1dc95a08b012
targets = f26e0b32-736f-4f0a-831b-039a415c481e

# A "pool_nameserver" is where we query, we use this to identify
# when a change has reached the nameserver(s)
[pool_nameserver:0f66b842-96c2-4189-93fc-1dc95a08b012]
port = 53
host = 127.0.0.1

# A "pool_target" is where we write to, e.g. if you have 5 PowerDNS
# servers with a single shared DB, you write to 1 target, and query
# 5 nameservers for status.
[pool_target:f26e0b32-736f-4f0a-831b-039a415c481e]
options = connection: mysql://root@127.0.0.1:3306/powerdns?charset=utf8
masters = 127.0.0.1:5354
type = powerdns
port = 53
host = 127.0.0.1

#############################
## Agent Backend Configuration
#############################
[backend:agent:bind9]
#rndc_host = 127.0.0.1
#rndc_port = 953
#rndc_config_file = /etc/rndc.conf
#rndc_key_file = /etc/rndc.key
#zone_file_path = $state_path/zones
#query_destination = 127.0.0.1
#
[backend:agent:denominator]
#name = dynect
#config_file = /etc/denominator.conf

########################
## Library Configuration
Expand Down
8 changes: 6 additions & 2 deletions files/dhcp_agent.ini
Expand Up @@ -9,7 +9,7 @@

# The DHCP agent requires an interface driver be set. Choose the one that best
# matches your plugin.
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver

# Example of interface_driver option for OVS based plugins(OVS, Ryu, NEC, NVP,
# BigSwitch/Floodlight)
Expand All @@ -28,7 +28,7 @@ interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver

# The agent can use other DHCP drivers. Dnsmasq is the simplest and requires
# no additional setup of the DHCP server.
# dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq

# Allow overlapping IP (Must have kernel build with CONFIG_NET_NS=y and
# iproute2 package that supports namespaces). This option is deprecated and
Expand Down Expand Up @@ -88,3 +88,7 @@ dnsmasq_dns_servers = 8.8.8.8,8.8.4.4
# Timeout for ovs-vsctl commands.
# If the timeout expires, ovs commands will fail with ALARMCLOCK error.
# ovs_vsctl_timeout = 10

[agent]
root_helper_daemon = sudo /usr/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf
root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
31 changes: 15 additions & 16 deletions files/example.py
@@ -1,10 +1,12 @@
#!/usr/bin/env python

import requests
from designateclient.client import Client

from designateclient import shell
from designateclient.v2.client import Client
from designateclient import exceptions
from keystoneclient import session
from keystoneclient.auth.identity import v2
from keystoneclient import session as keystone_session
from keystoneclient.auth.identity import generic


url = 'http://myexternalip.com'
try:
Expand All @@ -13,19 +15,16 @@
except Exception:
ip = '127.0.0.1'

user = 'admin'
project = 'admin'
password = 'password'


auth = v2.Password(auth_url='http://127.0.0.1:5000/v2.0',
username=user,
password=password,
tenant_id='96c0fbc191524f508bbbf460f67e4a5f')

sess = session.Session(auth=auth)
auth = generic.Password(
auth_url=shell.env('OS_AUTH_URL'),
username=shell.env('OS_USERNAME'),
password=shell.env('OS_PASSWORD'),
tenant_name=shell.env('OS_TENANT_NAME')
)

client = Client('2', session=sess, http_log_debug=True, region_name='regionOne')
endpoint = 'http://127.0.0.1:9001/v2'
session = keystone_session.Session(auth=auth)
client = Client(session=session, endpoint_override=endpoint)

try:
client.recordsets.create('example.com.', 'me.example.com.', 'A', [ip], 'Auto-Generated Record')
Expand Down
8 changes: 8 additions & 0 deletions files/importdemo.txt
@@ -0,0 +1,8 @@
$ORIGIN designatedemo.com.
designatedemo.com. 300 IN SOA ns.designatedemo.com. nsadmin.designatedemo.com. 1000 1001 1002 1003 1004
designatedemo.com. 300 IN NS ns.designatedemo.com.
ns.designatedemo.com. 300 IN A 1.2.3.4
www.designatedemo.com. 300 IN A 66.55.237.26
www2.designatedemo.com. 300 IN A 45.16.124.233
google.designatedemo.com. 300 IN CNAME google.com.

68 changes: 0 additions & 68 deletions files/initialize.py

This file was deleted.

34 changes: 21 additions & 13 deletions files/install-designate.sh
Expand Up @@ -14,6 +14,7 @@ ls *.sample | while read f; do cp $f $(echo $f | sed "s/.sample$//g"); done
# Copy over config file with pre-set values to designate.conf
# (Replace contents of designate.conf with contents of file /home/vagrant/designate.conf.wkshp)
cp /home/vagrant/designate.conf.workshop ./designate.conf
cp /home/vagrant/pools.yaml ./pools.yaml

# Create directory for maintaining designate state information (this directory was referenced by 'state_path' variable in designate.conf file)
mkdir /home/vagrant/state/ || :
Expand All @@ -27,14 +28,6 @@ mysql -e 'DROP DATABASE IF EXISTS `designate`;'
mysql -e 'CREATE DATABASE `designate` CHARACTER SET utf8 COLLATE utf8_general_ci;'
designate-manage database sync

# The PowerDNS database
mysql -e 'DROP DATABASE IF EXISTS `powerdns`;'
mysql -e 'CREATE DATABASE `powerdns` CHARACTER SET utf8 COLLATE utf8_general_ci;'
designate-manage powerdns sync f26e0b32-736f-4f0a-831b-039a415c481e

# Restart pDNS after replacing it's DB
sudo service pdns restart

# Start the Designate Central Service
sudo stop designate-central || :
sudo start designate-central
Expand All @@ -55,15 +48,30 @@ sudo start designate-pool-manager
sudo stop designate-zone-manager || :
sudo start designate-zone-manager

# Populate the Pools DB Tab
designate-manage pool update --file pools.yaml

# The PowerDNS database
mysql -e 'DROP DATABASE IF EXISTS `powerdns`;'
mysql -e 'CREATE DATABASE `powerdns` CHARACTER SET utf8 COLLATE utf8_general_ci;'
designate-manage powerdns sync 794ccc2c-d751-44fe-b57f-8894c9f5c842

# Restart pDNS after replacing it's DB
sudo service pdns restart

# Restart the Designate Pool Manager Service to get new pool config
sudo stop designate-pool-manager || :
sudo start designate-pool-manager

# Setup the Designate Keystone service and endpoints
# First set user 'admin' particulars then create service and endpoint
source /home/vagrant/openrc.admin

keystone service-list | grep designate | awk '{print $2}' | xargs --no-run-if-empty -n 1 keystone service-delete
openstack service list -f value | grep designate | awk '{print $1}' | xargs --no-run-if-empty -n 1 openstack service delete

keystone service-create --name designate --type dns --description "Designate Service"
keystone endpoint-create --service designate --publicurl http://127.0.0.1:9001 --adminurl http://127.0.0.1:9001 --internalurl http://127.0.0.1:9001
openstack service create --name designate --description "Designate Service" dns

openstack endpoint create designate --adminurl http://127.0.0.1:9001 --publicurl http://127.0.0.1:9001 --internalurl http://127.0.0.1:9001 --region regionOne
# Install Designate Client
cd /home/vagrant/python-designateclient
sudo pip install -r requirements.txt
Expand All @@ -74,6 +82,6 @@ cd /home/vagrant/designate-dashboard
rm -rf dist/*
python setup.py sdist
sudo pip install dist/*.tar.gz
sudo cp designatedashboard/enabled/_70_dns_add_group.py /usr/share/openstack-dashboard/openstack_dashboard/local/enabled
sudo cp designatedashboard/enabled/_71_dns_project.py /usr/share/openstack-dashboard/openstack_dashboard/local/enabled
sudo cp designatedashboard/enabled/_1710_project_dns_panel_group.py /usr/share/openstack-dashboard/openstack_dashboard/local/enabled
sudo cp designatedashboard/enabled/_1720_project_dns_panel.py /usr/share/openstack-dashboard/openstack_dashboard/local/enabled
sudo service apache2 restart
8 changes: 6 additions & 2 deletions files/l3_agent.ini
Expand Up @@ -4,7 +4,7 @@

# L3 requires that an interface driver be set. Choose the one that best
# matches your plugin.
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver

# Example of interface_driver option for OVS based plugins (OVS, Ryu, NEC)
# that supports L3 agent
Expand Down Expand Up @@ -59,7 +59,7 @@ interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
# Name of bridge used for external network traffic. This should be set to
# empty value for the linux bridge. when this parameter is set, each L3 agent
# can be associated with no more than one external network.
# external_network_bridge = br-ex
external_network_bridge =

# TCP Port used by Neutron metadata server
# metadata_port = 9697
Expand Down Expand Up @@ -119,3 +119,7 @@ interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver

# The advertisement interval in seconds
# ha_vrrp_advert_int = 2

[agent]
root_helper_daemon = sudo /usr/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf
root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
11 changes: 11 additions & 0 deletions files/linuxbridge_agent.ini
@@ -0,0 +1,11 @@
[linux_bridge]
physical_interface_mappings = external:eth0

[vxlan]
enable_vxlan = True
local_ip = 127.0.0.1
l2_population = True

[agent]
root_helper_daemon = sudo /usr/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf
root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf

0 comments on commit 3660eae

Please sign in to comment.