Input DB listen IP address for the ovn-northd

When ovn-northd is started, along with it ovsdb servers for the southbound
and northbound databases are also started. Without additional options for the
ovn-northd service, the DB servers will be listenting on 0.0.0.0.

This patch creates a systemd environment file that will create the db listen
options for the northd service. It also sets the other options
db-nb-create-insecure-remote and db-sb-create-insecure-remote which
are required to start the ovsdb-server's  listening on TCP
connections. Please see this commit [1] for more details.

[1] -
84d0ca5d00

Co-authored-by: Numan Siddique <nusiddiq@redhat.com>
Change-Id: I99b1c3e0fe89b763be81db9b8c1c3b257be42e6e
This commit is contained in:
Babu Shanmugam 2016-11-15 12:05:49 +00:00 committed by Numan Siddique
parent e0881669b0
commit 4e9e55987d
2 changed files with 28 additions and 1 deletions

View File

@ -3,10 +3,23 @@
# #
# installs ovn package starts the ovn-northd service # installs ovn package starts the ovn-northd service
# #
class ovn::northd() { # [*dbs_listen_ip*]
# The IP-Address where OVN DBs should be listening
# Defaults to '0.0.0.0'
#
class ovn::northd($dbs_listen_ip = '0.0.0.0') {
include ::ovn::params include ::ovn::params
include ::vswitch::ovs include ::vswitch::ovs
if $::osfamily == 'RedHat' {
augeas { 'sysconfig-ovn-northd':
context => '/files/etc/sysconfig/ovn-northd',
changes => "set OVN_NORTHD_OPTS '\"--db-nb-addr=${dbs_listen_ip} --db-sb-addr=${dbs_listen_ip} \
--db-nb-create-insecure-remote=yes --db-sb-create-insecure-remote=yes\"'",
before => Service['northd'],
}
}
service { 'northd': service { 'northd':
ensure => true, ensure => true,
enable => true, enable => true,

View File

@ -2,6 +2,19 @@ require 'spec_helper'
describe 'ovn::northd' do describe 'ovn::northd' do
shared_examples_for 'systemd env' do
it 'creates systemd conf' do
is_expected.to contain_file('/etc/sysconfig/ovn-northd').with(
:ensure => 'file',
:mode => '0644',
:owner => 'root',
:group => 'root',
:content => "OVN_NORTHD_OPTS=--db-nb-addr=0.0.0.0 --db-sb-addr=0.0.0.0 --db-nb-create-insecure-remote=yes --db-sb-create-insecure-remote=yes",
:before => 'Service[northd]',
)
end
end
shared_examples_for 'ovn northd' do shared_examples_for 'ovn northd' do
it 'includes params' do it 'includes params' do
is_expected.to contain_class('ovn::params') is_expected.to contain_class('ovn::params')
@ -56,6 +69,7 @@ describe 'ovn::northd' do
} }
end end
it_behaves_like 'ovn northd' it_behaves_like 'ovn northd'
it_behaves_like 'systemd env'
end end
end end
end end