jamtur01 / puppet-rundeck

Puppet integration with RunDeck
Apache License 2.0
45 stars 16 forks source link

puppet entreprise #28

Open MelanieGault opened 9 years ago

MelanieGault commented 9 years ago

Hi,

I have a puppet entreprise 3.3.2 on a linux box. Another box with a puppet entreprise agent and rundeck 2.0. I install puppet-rundeck in puppet env:

# /opt/puppet/bin/gem install puppet-rundeck

I change /usr/bin/puppet-rundeck to use puppet entreprise ruby:

#!/opt/puppet/bin/ruby

I launch puppet-rundeck:

# puppet-rundeck --config /etc/puppetlabs/puppet/puppet.conf
[2015-05-22 13:26:36] INFO  WEBrick 1.3.1
[2015-05-22 13:26:36] INFO  ruby 1.9.3 (2013-11-22) [x86_64-linux]
== Sinatra (v1.4.6) has taken the stage on 8144 for development with backup from WEBrick
[2015-05-22 13:26:36] INFO  WEBrick::HTTPServer#start: pid=60050 port=8144

And next I request the service

# curl localhost:8144



I have nearly 200 hosts in puppet.

I havn't find any log or way to activate a debug mode.

Is it supposed to work with recent version of puppet ? and with puppet entreprise ?

Do you have any recommandation on what to look at to debug ?

Thanks a lot !

tass6773 commented 8 years ago

Did you ever get this working with the most recent version of puppet?

Jinkxed commented 8 years ago

I haven't yet, but if you do let me know please! @tass6773

vguillard commented 8 years ago

I try with puppet enterprise 4.5. First, I had this error message :

root@ubuntu-Lab:~# puppet-rundeck -c  /etc/puppetlabs/puppetserver/conf.d/puppetserver.conf
/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/puppet-rundeck-0.0.9/lib/puppet-rundeck.rb:38:in configure': undefined method parse_config' for Puppet:Module (NoMethodError)
from /opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/puppet-rundeck-0.0.9/bin/puppet-rundeck:67:in <top (required)>'
from /opt/puppetlabs/puppet/bin/puppet-rundeck:23:in load'
from /opt/puppetlabs/puppet/bin/puppet-rundeck:23:in <main>'

I fixed this by commenting parse_config method and adding initialize_settings in /opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/puppet-rundeck-0.0.9/lib/puppet-rundeck.rb :

   def configure
      Puppet[:config] = PuppetRundeck.config_file
      puts Puppet[:config]
      Puppet.initialize_settings
#      Puppet.parse_config
    end

After a curl test, i don't have the list of my nodes in response. According to this documentation, i found node yaml file in /opt/puppetlabs/server/data/puppetserver/yaml/node/

root@ubuntu-Lab:~# ls  /opt/puppetlabs/server/data/puppetserver/yaml/node
ubuntu-lab.yaml

Again, I add one line in /opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/puppet-rundeck-0.0.9/lib/puppet-rundeck.rb :

    def respond(required_tag=nil)
    puts "yamldir= #{Puppet[:clientyamldir]}"
    response['Content-Type'] = 'text/xml'

and, when i request by curl, I got this :

root@ubuntu-Lab:~# puppet-rundeck -c  /etc/puppetlabs/puppetserver/conf.d/puppetserver.conf
[2016-07-29 11:50:15] INFO  WEBrick 1.3.1
[2016-07-29 11:50:15] INFO  ruby 2.1.9 (2016-03-30) [x86_64-linux]
== Sinatra (v1.4.7) has taken the stage on 8144 for development with backup from WEBrick
[2016-07-29 11:50:15] INFO  WEBrick::HTTPServer#start: pid=14527 port=8144
yamldir= /opt/puppetlabs/puppet/cache/client_yaml
localhost - - [29/Jul/2016:11:50:19 CEST] "GET / HTTP/1.1" 200 150
- -> /

In my config file :

root@ubuntu-Lab:~# grep "master-var-dir:" /etc/puppetlabs/puppetserver/conf.d/puppetserver.conf
master-var-dir: /opt/puppetlabs/server/data/puppetserver

I don't understand why puppet-rundeck doesn't set clientyamldir (or yamldir) with the good path.