Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

(Local) Agent autoregistering with specified environment #80

Open
raids opened this issue Mar 24, 2016 · 2 comments
Open

(Local) Agent autoregistering with specified environment #80

raids opened this issue Mar 24, 2016 · 2 comments

Comments

@raids
Copy link

raids commented Mar 24, 2016

Hi,

When I use the LWRP the creation of local Go agents, the environments parameter doesn't seem to do anything.

By local, I mean on the same machine as the Go CD Server.

Here's an example of my LWRP implementation:

for i in 0..(node['wrapper_gocd']['agents'] -1)
  name = "go-agent-#{i}"
  gocd_agent name do
    go_server_host 'localhost'
    go_server_port 8153
    daemon true
    vnc    true
    autoregister_key
    autoregister_hostname name
    environments "Alpha"
  end
end

I've tried a few different inputs besides a string, such as an array, or referencing an attribute like #{node['wrapper_gocd']['go_env']}.

I haven't tried with remote agents, but I don't see any issues raised for that, so could this be an issue exclusive to remote agent creation or am I missing something (most likely)?

Thanks,
Raid

@tomzo
Copy link
Member

tomzo commented Mar 24, 2016

Hi, it may be a bug.
You can pass a string or array of strings, that should not be an issue.

the environments parameter doesn't seem to do anything.

Could you check the contents of autoregister.properties file in your agent's directory? It should have something like

agent.auto.register.environments = Alpha

Also do you have environment created in Go server?

@raids
Copy link
Author

raids commented Mar 24, 2016

Hey @tomzo

There's no autoregister.properties actually created in my agent's directory. The agent registers to the server just fine, however.

I ran into this when testing the Go backup/restore functionality, so the environments are created as part of the restore. The agents are created after the restore.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants