Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create olcDbDirectory before its database and the start of slapd #428

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
Class['openldap::server::install']
-> Class['openldap::server::config']
~> Class['openldap::server::service']
-> Class['openldap::server::slapdconf']
Class['openldap::server::slapdconf']
-> Class['openldap::server']
}
6 changes: 3 additions & 3 deletions manifests/server/database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@
}

Class['openldap::server::service']
-> Openldap::Server::Database[$title]
-> Openldap_database[$title]
-> Class['openldap::server']
if $title != 'dc=my-domain,dc=com' and fact('os.family') == 'RedHat' {
Openldap::Server::Database['dc=my-domain,dc=com'] -> Openldap::Server::Database[$title]
Openldap_database['dc=my-domain,dc=com'] -> Openldap_database[$title]
}

if $ensure == present and $backend != 'monitor' and $backend != 'config' and $backend != 'relay' and $backend != 'ldap' {
file { $manage_directory:
ensure => directory,
owner => $openldap::server::owner,
group => $openldap::server::group,
before => Openldap_database[$title],
before => [Class['openldap::server::service'], Openldap_database[$title]],
}
}

Expand Down
5 changes: 0 additions & 5 deletions spec/classes/openldap_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
that_notifies('Class[openldap::server::service]')
}

it {
is_expected.to contain_class('openldap::server::service').
that_comes_before('Class[openldap::server::slapdconf]')
}

it {
is_expected.to contain_class('openldap::server::slapdconf').
that_comes_before('Class[openldap::server]')
Expand Down
18 changes: 18 additions & 0 deletions spec/defines/openldap_server_database_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@
it {
is_expected.to contain_openldap__server__database('dc=foo').with(directory: '/foo/bar')
}

it {
# The slapd service must be started before we can make a database:
is_expected.to contain_class('openldap::server::service').
that_comes_before('Openldap_database[dc=foo]')
}

it {
# The containing directory for a database must exist before the database that it will contain:
is_expected.to contain_file('/foo/bar').
that_comes_before('Openldap_database[dc=foo]')
}

it {
# ... and "the specified olcDbDirectory must exist prior to starting slapd(8)":
is_expected.to contain_file('/foo/bar').
that_comes_before('Class[openldap::server::service]')
}
end

context 'with all parameters set' do
Expand Down
Loading