-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fail to add printer on first puppetrun precise #50
Comments
same problem on trusty. What I discovered is that if I set "enabled: false" it will fail but now on Failed to add printer successfully, deleting destination. error: undefi ned method `cupsdisable' for # Will continue to test. |
Found the problem. Will provide some code later today. |
The problem seems to be defining of commands. For unknown reason the code that assign cupsenable/cupsdisable/cupsaccept/cupsreject is run after the methods is created. If I remove the: [ "/usr/sbin/cupsenable", "/usr/bin/cupsenable", "/usr/sbin/enable", "/usr/bin/enable"].each do |cups_command| if File.exists?(cups_command) commands :cupsenable => cups_command break end end [ "/usr/sbin/cupsdisable", "/usr/bin/cupsdisable", "/usr/sbin/disable", "/usr/bin/disable"].each do |cups_command| if File.exists?(cups_command) commands :cupsdisable => cups_command break end end # # Candidate locations for the accept and reject commands # Older Fedora and RHEL/CentOS 6.x and earlier have /usr/sbin/{accept,reject} # Solaris 11 & Illumos/OpenIndiana have the same. # [ "/usr/sbin/cupsaccept", "/usr/bin/cupsaccept", "/usr/sbin/accept", "/usr/bin/accept"].each do |cups_command| if File.exists?(cups_command) commands :cupsaccept => cups_command break end end [ "/usr/sbin/cupsreject", "/usr/bin/cupsreject", "/usr/sbin/reject", "/usr/bin/reject"].each do |cups_command| if File.exists?(cups_command) commands :cupsreject => cups_command break end end and replace it with commands :cupsenable => 'cupsenable' commands :cupsdisable => 'cupsdisable' commands :cupsaccept => 'cupsaccept' commands :cupsreject => 'cupsreject' It will work. This require that the needed binaries are available in the path on the client, otherwise it will fail, as described here: https://docs.puppetlabs.com/guides/provider_development.html#suitability The only problem with this approach is on the system where the binaries have other names like accept, reject, enable and disable. I need to find a way to accomodate for those OSes. I run puppet 3.4.2 on client and server. |
Hi,
Tried the new code (master today) and got problems on the first run.
It seems that it add the printers, but then removes them again :/. If I run puppet once more the will come in as normal.
Have tried on precise so far, will try on trusty tomorrow.
The text was updated successfully, but these errors were encountered: