Skip to content

Commit b9da9b2

Browse files
committed
Allow to setup custom hostname with agent version >= 1.1.3
1 parent e922deb commit b9da9b2

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ Usage
5454

5555
3. (Optional) Set the `node['threatstack']['policy']` to define which policy will apply to this node (defaults to 'Default Policy')
5656

57-
4. Add this recipe to your runlist or include in another recipe
57+
4. (Optional) Set the `node['threatstack']['hostname']` if you want to register the agent in the UI by a specific name (defaults to hostname)
58+
59+
5. Add this recipe to your runlist or include in another recipe

attributes/default.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@
2222
default['threatstack']['pkg_action'] = :install
2323
default['threatstack']['deploy_key'] = nil
2424
default['threatstack']['policy'] = 'Default Policy'
25+
default['threatstack']['hostname'] = nil

recipes/default.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
# in the Threat Stack UI
3030

3131
cmd = "cloudsight setup --deploy-key=#{node['threatstack']['deploy_key']} "
32-
cmd += "--policy='#{node['threatstack']['policy']}'" if node['threatstack']['policy']
32+
cmd += "--policy='#{node['threatstack']['policy']}' " if node['threatstack']['policy']
33+
cmd += "--hostname='#{node['threatstack']['hostname']}'" if node['threatstack']['hostname']
3334

3435
execute 'cloudsight setup' do
3536
command cmd

0 commit comments

Comments
 (0)