Closed ainestal closed 8 years ago
I updated the modules agent integration test to catch this situation but was unable to reproduce your error. The agent1 startup script should source /etc/default/agent1 and thus shouldn't matter whatever config is in the go-agent packages instance.
My test manifest:
::go::agent::instance { 'goinstance1':
ensure => present,
path => '/opt/go-instances',
go_server_host => 'localhost.localdomain',
go_server_port => '8153'
}
Log output in /opt/go-instances/goinstance1/go-agent/*.log
go-agent-launcher.log:2015-12-03 16:02:14,380 [main ] ERROR go.agent.launcher.ServerCall:69 - Couldn't access Go Server with base url: http://localhost.localdomain:8153/go/admin/agent-launcher.jar: java.net.UnknownHostException: localhost.localdomain
Last time I checked Go didn't support Java 8, could you try with Java 7 and see if it fixes it?
I now know what the problem is. For some reason I was executing the following manifest
class { '::go::agent':
ensure => 'present',
service_ensure => 'running',
service_enable => true,
manage_package_repo => true,
} ->
::go::agent::instance { 'agent1':
ensure => 'present',
path => '/opt/go',
go_server_host => '192.168.33.100',
go_server_port => 8153,
# autoregister => true,
manage_user => true,
}
this tries to use the default config and fails to connect to the server if it's not installed in localhost.
To create a new instance that connects to a server in a different host the following manifest works just fine
package { 'java-1.7.0-openjdk':
ensure => 'installed',
} ->
class { '::go::agent':
manage_package_repo => true,
} ->
::go::agent::instance { 'agent1':
ensure => 'present',
path => '/opt/go',
go_server_host => '192.168.33.100',
go_server_port => 8153,
manage_user => true,
}
BTW, I tried with Java 7 and 8, both are working.
Thank you for your help @jlyheden
When installing the package from ::go::agent there is a default configuration that is in /etc/default/go-agent
This is the manifest I'm using:
After applying I have 2 configuration files
and
The default config comes with the go-agent package:
The problem is that the agent is trying to connect to 127.0.0.1 instead of the IP of the server so it crashes.
I tried to overwrite that default configuration calling my instance 'go-agent' but I got the error when applying:
==> agent1: Error: Duplicate declaration: Service[go-agent] is already declared in file /etc/puppet/modules/go/manifests/agent/service.pp:10; cannot redeclare at /etc/puppet/modules/go/manifests/agent/instance.pp:236 on node agent1.