kindredgroup / puppet-go

Puppet module for managing Thoughtworks Go
Other
8 stars 12 forks source link

"Provider init is not functional on this host" with puppet 4.2 on Ubuntu due to provider 'init' #4

Closed lzecca78 closed 8 years ago

lzecca78 commented 8 years ago

In the commit bf91cf0c1f243ec808bf481d47fce85b0c4354d5 there is an hardcoded provider definition that is broking the handling of the service with the message of the issue in my setup :

Ubuntu 14.04.4 Puppet 4.2 unibet/go 0.2.1

Is it possible to handle the provider in the service definition with a class parameter or with a case switch based on the operativesystem facter? I fixed it using 'debian' instead of 'init' and it work, but using librarian-puppet i cannot keep it unless is fixed.

jlyheden commented 8 years ago

Are you providing start scripts outside of the module? I just added Ubuntu 14.04 to the test-kitchen suite and it ran perfectly fine:

$ bundle exec kitchen converge go-agent-ubuntu-trusty64
-----> Starting Kitchen (v1.7.3)
-----> Converging <go-agent-ubuntu-trusty64>...
       Preparing files for transfer
       Preparing modules
       Resolving module dependencies with Librarian-Puppet 2.1.0...
       nothing to do for modules
       Preparing manifests
       Preparing files
       nothing to do for files
       Preparing spec files
       Finished Preparing files for transfer
       Installing puppet, will try to determine platform os
       Transferring files to <go-agent-ubuntu-trusty64>
       Going to invoke puppet apply with:   export MANIFESTDIR='/tmp/kitchen/manifests'; sudo -E puppet apply /tmp/kitchen/manifests/site.pp --modulepath=/tmp/kitchen/modules --fileserverconfig=/tmp/kitchen/fileserver.conf
       Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
       Notice: Compiled catalog for go-agent-ubuntu-trusty64.unibet.com in environment production in 0.31 seconds
       Notice: /Stage[main]/Main/Package[openjdk-7-jdk]/ensure: ensure changed 'purged' to 'present'
       Notice: /Stage[main]/Go::Agent::Package/Package[go-agent]/ensure: ensure changed 'purged' to 'present'
       Notice: /Stage[main]/Go::Agent::Service/Service[go-agent]/enable: enable changed 'true' to 'false'
       Notice: /Stage[main]/Main/Go::Agent::Instance[goinstance1]/File[/etc/init.d/goinstance1]/ensure: created
       Notice: /Stage[main]/Main/Go::Agent::Instance[goinstance1]/Exec[create_parent_dir_goinstance1]/returns: executed successfully
       Notice: /Stage[main]/Main/Go::Agent::Instance[goinstance1]/File[/usr/share/go-agent/goinstance1.sh]/ensure: created
       Notice: /Stage[main]/Main/Go::Agent::Instance[goinstance1]/Group[goinstance1]/ensure: created
       Notice: /Stage[main]/Main/Go::Agent::Instance[goinstance1]/User[goinstance1]/ensure: created
       Notice: /Stage[main]/Main/Go::Agent::Instance[goinstance1]/File[/etc/default/goinstance1]/ensure: created
       Notice: /Stage[main]/Main/Go::Agent::Instance[goinstance1]/File[/opt/go-instances/goinstance1]/ensure: created
       Notice: /Stage[main]/Main/Go::Agent::Instance[goinstance1]/File[/opt/go-instances/goinstance1/go-agent]/ensure: created
       Notice: /Stage[main]/Main/Go::Agent::Instance[goinstance1]/Service[goinstance1]/ensure: ensure changed 'stopped' to 'running'
       Notice: Finished catalog run in 92.07 seconds
       Finished converging <go-agent-ubuntu-trusty64> (1m35.99s).
-----> Kitchen is finished. (1m36.49s)

That is, provisioning this manifest: https://github.com/unibet/puppet-go/blob/master/test/integration/go-agent/puppet/manifests/site.pp

lzecca78 commented 8 years ago

Hi @jlyheden , thank you for your quick answer, mmm no, i am handling all with your module, and the only error i have is given due to the provider => 'init' in the definition of service instance. Which details i can give to you to understand more?

jlyheden commented 8 years ago

Sorry I totally missed the fact that it was regarding Puppet 4, there hasn't been any extensive testing or pronounced support for Puppet 4 - but if you successfully used it up until my recent introduced regression that might be good enough to stamp it as "working in Puppet 4".

So, apparently 'init' was removed as a supported provider in Ubuntu 14.04 and Puppet 4 specifically. I pushed a fix to this branch: https://github.com/unibet/puppet-go/tree/fix-for-issue-4 please try it out if it works for you, then I'll merge it.

lzecca78 commented 8 years ago

Hi @jlyheden , i tried your fix and now it works perfectly :+1: . Thanks a lot for your quick feedback!

jlyheden commented 8 years ago

Thanks for verifying, I've released version 0.2.2 and will probably kill the branch. If you are pinning versions in librarian please use the v0.2.2 tag