voxpupuli / puppet-openldap

Manage OpenLDAP with Puppet
Apache License 2.0
37 stars 135 forks source link

Unable to configure openldap on FreeBSD 13.0-RELEASE #338

Closed madelaney closed 3 years ago

madelaney commented 3 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

  class { 'openldap::server': }
  openldap::server::database { 'dc=office,dc=supersecretdomain.com':
    ensure => present,
  }

What are you seeing

Debug: Executing: '/usr/local/sbin/pkg query %n %v %o openldap24-server'
Debug: Executing: '/usr/local/sbin/pkg install -qy openldap24-server'
Notice: /Stage[main]/Openldap::Server::Install/Package[openldap24-server]/ensure: created
Debug: /Package[openldap24-server]: The container Class[Openldap::Server::Install] will propagate my refresh event
Debug: Class[Openldap::Server::Install]: The container Stage[main] will propagate my refresh event
Debug: /Stage[main]/Openldap::Server::Config/Exec[bootstrap cn=config]/creates: Checking that 'creates' path '/usr/local/etc/openldap/slapd.d/cn=config.ldif' exists
Error: Could not find command 'echo'
Error: /Stage[main]/Openldap::Server::Config/Exec[bootstrap cn=config]/returns: change from 'notrun' to ['0'] failed: Could not find command 'echo'
Debug: Class[Openldap::Server::Config]: Resource is being skipped, unscheduling all events
Debug: Class[Openldap::Server::Service]: Resource is being skipped, unscheduling all events
Notice: /Service[slapd]: Dependency Exec[bootstrap cn=config] has failures: true
Warning: /Service[slapd]: Skipping because of failed dependencies
Debug: /Service[slapd]: Resource is being skipped, unscheduling all events
Debug: Class[Openldap::Server::Service]: Resource is being skipped, unscheduling all events
Debug: Class[Openldap::Server::Slapdconf]: Resource is being skipped, unscheduling all events
Warning: /Stage[main]/Openldap::Server::Slapdconf/File[/usr/local/etc/openldap/slapd.d]: Skipping because of failed dependencies
Debug: /Stage[main]/Openldap::Server::Slapdconf/File[/usr/local/etc/openldap/slapd.d]: Resource is being skipped, unscheduling all events
Debug: Class[Openldap::Server::Slapdconf]: Resource is being skipped, unscheduling all events
Debug: Class[Openldap::Server]: Resource is being skipped, unscheduling all events
Debug: Class[Openldap::Server]: Resource is being skipped, unscheduling all events

What behaviour did you expect instead

I would expect the class to get applied.

Output log

Any additional information you'd like to impart

smortex commented 3 years ago

Hi @madelaney !

Can you give #339 a try?

madelaney commented 3 years ago

@smortex happy try it out. However, I should note the echo is a builtin command so I'm not sure what adding /bin to the path will do but I'm happy to be wrong here.

smortex commented 3 years ago

You are right, I can't test right now… we may in fact need to set the provider to shell :thinking:

The default would basically run echo with 7 arguments:

  1. '${ldif}'
  2. |
  3. slapadd
  4. -n
  5. 0
  6. -F
  7. ${openldap::server::confdir}
smortex commented 3 years ago

Gave it a shot, more issues fixed… see #341 for all changes.

It allows to run your code with minimal change:

class { 'openldap::server': }
openldap::server::database { 'dc=office,dc=supersecretdomain.com':
  ensure    => present,
  directory => '/var/db/openldap-data', # <--- Added
}
smortex commented 3 years ago

Check #342 for even more awesomeness @madelaney :wink:

Can you please give it a try and report success / failure? Thanks!