Commit 551f5e47 authored by Peter Fern's avatar Peter Fern Committed by Sean OMeara
Browse files

[COOK-4022] Add use_local_ipv4 option


Signed-off-by: default avatarSean OMeara <someara@opscode.com>
parent b854be8d
......@@ -49,6 +49,7 @@ See `attributes/default.rb` for default values.
* `node['rsyslog']['tls_certificate_file']` - Path to TLS certificate file. Required for server, optional for clients.
* `node['rsyslog']['tls_key_file']` - Path to TLS key file. Required for server, optional for clients.
* `node['rsyslog']['tls_auth_mode']` - Value for `$InputTCPServerStreamDriverAuthMode`/`$ActionSendStreamDriverAuthMode`, determines whether client certs are validated. Defaults to `anon` (no validation).
* `node['rsyslog']['use_local_ipv4']` - Whether or not to make use the remote local IPv4 address on cloud systems when searching for servers (where available). Default is 'false'.
Recipes
-------
......
......@@ -41,6 +41,7 @@ default['rsyslog']['tls_ca_file'] = nil
default['rsyslog']['tls_certificate_file'] = nil
default['rsyslog']['tls_key_file'] = nil
default['rsyslog']['tls_auth_mode'] = 'anon'
default['rsyslog']['use_local_ipv4'] = false
# The most likely platform-specific attributes
default['rsyslog']['service_name'] = 'rsyslog'
......
......@@ -88,6 +88,7 @@ attribute 'rsyslog/priv_seperation',
:description => 'Whether or not to make use of Rsyslog privilege separation',
:default => 'false'
<<<<<<< HEAD
attribute 'rsyslog/enable_tls',
:display_name => 'Enable TLS',
:description => 'Whether or not to enable TLS encryption. When enabled, forces protocol to "tcp"',
......@@ -109,3 +110,9 @@ attribute 'rsyslog/tls_auth_mode',
:display_name => 'TLS auth mode',
:description => 'Value for "$InputTCPServerStreamDriverAuthMode"/"$ActionSendStreamDriverAuthMode", determines whether client certs are validated.',
:default => 'anon'
=======
attribute 'rsyslog/use_local_ipv4',
:display_name => 'Try to use local IPv4 address',
:description => 'Whether or not to make use the remote local IPv4 address on cloud systems when searching for servers (where available).',
:default => 'false'
>>>>>>> pdf-COOK-4022
......@@ -31,7 +31,15 @@ if Chef::Config[:solo]
Chef::Application.fatal!("Chef Solo does not support search. You must set node['rsyslog']['server_ip']!")
end
else
results = search(:node, node['rsyslog']['server_search']).map { |n| n['ipaddress'] }
results = search(:node, node['rsyslog']['server_search']).map do |server|
ipaddress = server['ipaddress']
# If both server and client are on the same cloud and local network, they may be
# instructed to communicate via the internal interface by enabling `use_local_ipv4`
if node['rsyslog']['use_local_ipv4'] && server.attribute?('cloud') && server['cloud']['local_ipv4']
ipaddress = server['cloud']['local_ipv4']
end
ipaddress
end
rsyslog_servers = Array(node['rsyslog']['server_ip']) + Array(results)
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment