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

Unable to set database to readonly #207

Open
tdb opened this issue Sep 1, 2017 · 2 comments · May be fixed by #422
Open

Unable to set database to readonly #207

tdb opened this issue Sep 1, 2017 · 2 comments · May be fixed by #422

Comments

@tdb
Copy link
Contributor

tdb commented Sep 1, 2017

I'm having trouble setting a database to readonly using the olc provider. It seems whatever value I set the database property to I'm unable to make this test true:

https://github.com/camptocamp/puppet-openldap/blob/d81f18f0cec4e9b2e6b4981f545b09e6339ea342/lib/puppet/provider/openldap_database/olc.rb#L367

Am I missing something? Locally I've done this little hack to make it work, but it doesn't look like the right solution:

--- a/lib/puppet/provider/openldap_database/olc.rb
+++ b/lib/puppet/provider/openldap_database/olc.rb
@@ -228,7 +228,7 @@ Puppet::Type.
     end
     t << "olcRootDN: #{resource[:rootdn]}\n" if resource[:rootdn]
     t << "olcRootPW: #{resource[:rootpw]}\n" if resource[:rootpw]
-    t << "olcReadOnly: #{resource[:readonly] == :true ? 'TRUE' : 'FALSE'}\n" if resource[:readonly]
+    t << "olcReadOnly: #{resource[:readonly] == 'TRUE' ? 'TRUE' : 'FALSE'}\n" if resource[:readonly]
     t << "olcSizeLimit: #{resource[:sizelimit]}\n" if resource[:sizelimit]
     t << "olcDbMaxSize: #{resource[:dbmaxsize]}\n" if resource[:dbmaxsize]
     t << "olcTimeLimit: #{resource[:timelimit]}\n" if resource[:timelimit]
@@ -364,7 +364,7 @@ Puppet::Type.
       t << "replace: olcRootPW\nolcRootPW: #{resource[:rootpw]}\n-\n" if @property_flush[:rootpw]
       t << "replace: olcSuffix\nolcSuffix: #{resource[:suffix]}\n-\n" if @property_flush[:suffix]
       t << "replace: olcRelay\nolcRelay: #{resource[:relay]}\n-\n" if @property_flush[:relay]
-      t << "replace: olcReadOnly\nolcReadOnly: #{resource[:readonly] == :true ? 'TRUE' : 'FALSE'}\n-\n" if @property_flush[:readonly]
+      t << "replace: olcReadOnly\nolcReadOnly: #{resource[:readonly] == 'TRUE' ? 'TRUE' : 'FALSE'}\n-\n" if @property_flush[:readonly]
       t << "replace: olcSizeLimit\nolcSizeLimit: #{resource[:sizelimit]}\n-\n" if @property_flush[:sizelimit]
       t << "replace: olcTimeLimit\nolcTimeLimit: #{resource[:timelimit]}\n-\n" if @property_flush[:timelimit]
       t << "replace: olcDbMaxSize\nolcDbMaxSize: #{resource[:dbmaxsize]}\n-\n" if @property_flush[:dbmaxsize]

I'm thinking the property probably needs to be defined as a boolean, similar to mirrormode has been done.

@stale
Copy link

stale bot commented Apr 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 19, 2021
@stale stale bot closed this as completed Apr 27, 2021
@smortex
Copy link
Member

smortex commented May 23, 2024

PLEASE KILL THESE FSCKING ROBOTS!

@smortex smortex reopened this May 23, 2024
@smortex smortex removed the wontfix label May 23, 2024
@tdb tdb linked a pull request May 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants