Hi everyone,
i am currently digging through a couple of notes that i and a colleague
created during Foreman installations during the last 2-3 months.
One "challenge" we ran into, was that the current ISC DHCP smart proxy
implementation and docs [1]+[2] reference the omapi-port (default 7911),
but does not actually read this setting from dhcpd.conf.
A call to omshell from smart-proxy/modules/dhcp/providers/server/isc.rb is
therefore falling back to the default port 7911.
Of course in OUR setup, it used to listen on another port …
I prepared a simple fix (needs further testing) and do think it might also
be helpful to add this default to the configuration example.
1 commit a8f96841d6b31fbf6e1f9bdc084a2f28f067cc76
2 Author: Florian Maier <blablubb@atix.de>
3 Date: Wed Apr 22 13:40:37 2015 +0200
4
5 honor omapi port for isc dhcpd
6
7 diff --git a/config/settings.d/dhcp.yml.example
b/config/settings.d/dhcp.yml.example
8 index d7928fc…7bb9bab 100644
9 — a/config/settings.d/dhcp.yml.example
10 +++ b/config/settings.d/dhcp.yml.example
11 @@ -21,3 +21,4 @@
12 #:dhcp_leases: /var/lib/dhcpd/dhcpd.leases
13 #:dhcp_key_name: secret_key_name
14 #:dhcp_key_secret: secret_key
15 +#:dhcp_omapi_port: 7911
16 diff --git a/modules/dhcp/providers/server/isc.rb
b/modules/dhcp/providers/server/isc.rb
17 index 5a8c0ee…fd6d747 100644
18 — a/modules/dhcp/providers/server/isc.rb
19 +++ b/modules/dhcp/providers/server/isc.rb
20 @@ -188,6 +188,7 @@ module Proxy::DHCP
21 @om = IO.popen("/bin/sh -c '#{om_binary} 2>&1'", "r+")
22 @om.puts "key #{Proxy::DhcpPlugin.settings.dhcp_key_name}
"#{Proxy::DhcpPlugin.settings.dhcp_key_secret}"" if
Proxy::DhcpPlugin.settings.dhcp_key_name &&
Proxy::DhcpPlugin.settings.dhcp_key_secret
23 @om.puts "server #{name}"
24 + @om.puts "port #{Proxy::DhcpPlugin.settings.dhcp_omapi_port}
"#{Proxy::DhcpPlugin.settings.dhcp_omapi_port}"" if
Proxy::DhcpPlugin.settings.dhcp_omapi_port
25 @om.puts "connect"
26 @om.puts "new host"
27 elsif cmd == "disconnect"
Thanks for your feedback, please let me know if i missed anything.
Best wishes
Florian
PS.: I just created a Redmine account, but i am currently not yet able to
open new issues.
[1] ISC DHCP - Smart Proxy - Foreman
[2]
Sample dhcpdconf - Smart Proxy - Foreman