Open gerardkok opened 8 years ago
ENV puppetserver version: 2.4.0 puppet agent version: 4.5.3
TL;DR My contributions (which are very temporary) for puppet 4.5. cfpropertylist added to module dir. removed macauthdb as unable to resolve issues with sqlite3.
https://github.com/henrydobson/managedmac/tree/puppetv4.5
I had a go with your fork Gerard and puppet/type/mobileconfig seemed to load where it had previously failed. I also had no issues with property_list and confirm the softwareupdate manifest performed without error.
The following errors were common:
Could not autoload puppet/type/macgroup: no such file to load -- cfpropertylist at /etc/puppetlabs/code/environments/production/modules/managedmac/manifests/loginwindow.pp:383:3 on node test3
Could not autoload puppet/type/mobileconfig: no such file to load -- cfpropertylist at /etc/puppetlabs/code/environments/production/modules/managedmac/manifests/security.pp:175:3 on node test3
I am (like everyone else I think) still trying to absorb all of the changes from puppet 3 to 4 and because cfpropertylist was not loading I copied it to the module temporarily and referenced it there.
I did find several issues with sqlite3 as well and, despite having the gem installed via puppetserver gem install sqlite3, the module failed to load the file no such file to load -- sqlite3/sqlite3_native
. During installation I sometimes saw this error too but after reinstallation the gems it did not crop up again:
ERROR: Error installing sqlite3: ERROR: Failed to build gem native extension. java -jar /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar -r ./siteconf20160813-115-eszqtd.rb extconf.rb
It did not recognise the argument -r.
I still found I had to use the workaround of a relative path for the require in the macauthdb.rb file to find sqlite3 but this lead to another error as the sqlite3.rb file requires 'sqlite3/sqlite3_native', which was not present at all. I haven't been able to find a tidy solution but I'm hoping this experience will help everyone else.
Some things I did try were the jdbc-sqlite3 gem: This also required the relative path and so I temporarily placed a copy of the gem in the module but this was still a no go becasue...
Could not exec SQL: `uninitialized constant Class::SQLite3`
In the end I elected that I could probably live without the macauthdb type for now and removed it from my fork. This allowed the client to build a catalog successfully an has been some form of temporary workaround for me in the last 2 days.
This does not appear to work for me when it comes to Puppet4,
I am getting Failed to load feature test for cfpropertylist: cannot load such file -- CFPropertyList
on the server,
even after attempting to install the ruby gem.
@ltinker just one thought (I'm not a Puppet user anymore), but did you use the gem
binary inside /opt/puppetlabs/bin
to install cfpropertylist
? Or did you use the system's Ruby?
Hi Ginja, I installed it by running sudo puppetserver gem install CFPropertyList, so it should be installed against the puppet ruby environment.
This pull request is a first attempt to make the managedmac module compatible with puppet 4. I'm not much of a Ruby or Puppet expert, so this pull request is mostly the result of trial and error. I have tested the result on two macs: one running OS X 10.11.3 with puppet 3.8.6, and one running OS X 10.11.3 with puppet-agent 1.3.5, both against a puppet master running puppetserver 2.2.1. Unfortunately I don't have the resources to test it thoroughly; I couldn't test it against a puppet 3 master, for example.
The pull request tries to solve 3 problems: