smart_proxy_dhcp_infoblox 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9d476422505f0de1b398cec16d1dc065b5906e9
|
4
|
+
data.tar.gz: 59b2f67f873701ffc0e21a4f553cf50c055f627d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 169b3d6d58d49639054c06b65f7bd4f2ea847b0e01f5569db7a80e1b7750b220aceee8d8cf295010f87c0a9f80b870120f18042a6867c03173e709ef2809504b
|
7
|
+
data.tar.gz: 5ba39c49492d1ac3c7a6c90ed30737b0549f3a406e7b9396245561f805c12a9fdb1445ae5598420a9ace11b699bb122e4ed7fbc00638dbfd94b4bda27cb04f68
|
@@ -14,6 +14,7 @@ module Proxy::DHCP::Infoblox
|
|
14
14
|
infoblox_user = Proxy::DHCP::Infoblox::Plugin.settings.infoblox_user
|
15
15
|
infoblox_pw = Proxy::DHCP::Infoblox::Plugin.settings.infoblox_pw
|
16
16
|
@record_type = Proxy::DHCP::Infoblox::Plugin.settings.record_type
|
17
|
+
@range = Proxy::DHCP::Infoblox::Plugin.settings.range
|
17
18
|
wapi_version = Proxy::DHCP::Infoblox::Plugin.settings.wapi_version
|
18
19
|
::Infoblox.wapi_version = "#{wapi_version}"
|
19
20
|
@connection = ::Infoblox::Connection.new(username: infoblox_user, password: infoblox_pw, host: server)
|
@@ -99,8 +100,11 @@ module Proxy::DHCP::Infoblox
|
|
99
100
|
# returns first available ip address in a subnet with network_address, for a host with mac_address, in the range of ip addresses: from_ip_address, to_ip_address
|
100
101
|
# Deliberatly ignoring everything but first argument
|
101
102
|
logger.debug "Infoblox unused_ip Network_address: #{network_address} #{mac_address}, #{from_ip_address}, #{to_ip_address}"
|
102
|
-
|
103
|
-
|
103
|
+
if @range
|
104
|
+
::Infoblox::Range.find(@connection, network: "#{network_address.network}/#{network_address.cidr}").first.next_available_ip
|
105
|
+
else
|
106
|
+
::Infoblox::Network.find(@connection, network: "#{network_address.network}/#{network_address.cidr}").first.next_available_ip
|
107
|
+
end
|
104
108
|
# Idea for randomisation in case of concurrent installs:
|
105
109
|
#::Infoblox::Network.find(@connection, network: "#{network_address.network}/#{network_address.cidr}").first.next_available_ip(15).sample
|
106
110
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_proxy_dhcp_infoblox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Klaas Demter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|