oswaldlabs/chef-rundeck

Make the Attribute Reported as Hostname Configurable

dennis-benzinger-hybris opened this issue · 4 comments

It would be nice if the attribute which is reported as the hostname to Rundeck was configurable. So that Rundeck can use any of the attributes returned by Chef to connect to the VMs.
For example to use the nodename instead of the hostname. Not every network setup let's you connect to the VMs using the hostname of the VM.
This would also help with the tickets #59 and #4.

Hm, after reading the code I think this is already possible by setting the hostname variable in the project configuration. Unfortunately the format of this configuration file is not documented.

A very basic example of a project configuration would be:

{
  "URL_PATH": {
    "hostname": "CUSTOM_HOSTNAME_ATTRIBUTE",
    "pattern": "*:*"
  }
}

Then chef-rundeck serves the node information with your custom hostname at URL_PATH.

How would one reference an attribute such as ec2::public_hostname ?

I have tried a few different formats / syntaxes but not getting anything

To answer my own question... You can't without modifying the code at Line 229

Change to:

   n['hostname'] = get_custom_attr(node, hostname.split('.'))