diff --git a/manifests/params.pp b/manifests/params.pp index 5cae942..0d0982a 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -6,7 +6,7 @@ class ovn::params { include openstacklib::defaults case $::osfamily { - 'Redhat': { + 'RedHat': { $ovn_northd_package_name = 'openvswitch-ovn-central' $ovn_controller_package_name = 'openvswitch-ovn-host' $ovn_northd_service_name = 'ovn-northd' diff --git a/spec/classes/ovn_controller_spec.rb b/spec/classes/ovn_controller_spec.rb index bcaadf0..fa3daf6 100644 --- a/spec/classes/ovn_controller_spec.rb +++ b/spec/classes/ovn_controller_spec.rb @@ -111,13 +111,13 @@ describe 'ovn::controller' do } end it_behaves_like 'ovn controller' - when 'Redhat' + when 'RedHat' let :platform_params do { :ovn_controller_package_name => 'openvswitch-ovn-host', :ovn_controller_service_name => 'ovn-controller', :ovn_controller_service_status => true, - :ovn_controller_service_pattern => 'undef' + :ovn_controller_service_pattern => nil } end it_behaves_like 'ovn controller' diff --git a/spec/classes/ovn_northd_spec.rb b/spec/classes/ovn_northd_spec.rb index 07d4307..8673ed3 100644 --- a/spec/classes/ovn_northd_spec.rb +++ b/spec/classes/ovn_northd_spec.rb @@ -4,14 +4,11 @@ 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]', - ) + is_expected.to contain_augeas('config-ovn-northd').with({ + :context => platform_params[:ovn_northd_context], + :changes => "set " + platform_params[:ovn_northd_option_name] + + " '\"--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 \"'", + }) end end @@ -55,17 +52,22 @@ describe 'ovn::northd' do :ovn_northd_package_name => 'ovn-central', :ovn_northd_service_name => 'ovn-central', :ovn_northd_service_status => false, - :ovn_northd_service_pattern => 'ovn-northd' + :ovn_northd_service_pattern => 'ovn-northd', + :ovn_northd_context => '/files/etc/default/ovn-central', + :ovn_northd_option_name => 'OVN_CTL_OPTS' } end it_behaves_like 'ovn northd' - when 'Redhat' + it_behaves_like 'systemd env' + when 'RedHat' let(:platform_params) do { :ovn_northd_package_name => 'openvswitch-ovn-central', :ovn_northd_service_name => 'ovn-northd', :ovn_northd_service_status => true, - :ovn_northd_service_pattern => 'undef' + :ovn_northd_service_pattern => nil, + :ovn_northd_context => '/files/etc/sysconfig/ovn-northd', + :ovn_northd_option_name => 'OVN_NORTHD_OPTS' } end it_behaves_like 'ovn northd'