smart_proxy_dhcp_infoblox 0.0.15 → 0.0.16

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
  SHA256:
3
- metadata.gz: c031d153855f68611243ce742482f2c3e0274ad9187dc638cb4f691b3d687448
4
- data.tar.gz: 330d031ca651443261dd0df8921577f4c545e2aba97018d42953b71178ed1aae
3
+ metadata.gz: 386bb53985d3965e87d2ed0b4928858efe542d1a6bc28e1147795aae21871691
4
+ data.tar.gz: fffe1218aacbb214c899c01f72900756d3c92d13ec64b019e75fdc1307df0712
5
5
  SHA512:
6
- metadata.gz: a694d48389e3da2154b4d2d6b1ecca186c2e8e8b91d146c4641b06bd7b1f6912c0679979f362a68b63ec9205b570fd71959f916be109036c9721eb36801b1bab
7
- data.tar.gz: 324fe4540b931eedb3c913c52b5bb17a02968646d43abf324a5bd34030199632157750e13618046fbd68fd7c64887fcbbac1657b72d00a3e81fc6443defe56e8
6
+ metadata.gz: 9e6e8069b8151c468aa55e93aacb28bb657ce7b08a5b8ad2fb3a487b016672fb96dcf4c5c32be628d2a2500d890ab498be486c00aad4a94e3a08dac6e918041c
7
+ data.tar.gz: a63c13ca94c2e74a5fc7ffc0819d2df23a087c8650e817df7d303a695e56140f605a426108982be65fab94b5c3aa6547c578be701cb602c51cb009a9812052cf
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # SmartProxyDhcpInfoblox
2
2
 
3
- [![Build Status](https://travis-ci.org/theforeman/smart_proxy_dhcp_infoblox.svg?branch=master)](https://travis-ci.org/theforeman/smart_proxy_dhcp_infoblox)
4
-
5
3
  This plugin adds a new DHCP provider for managing records with infoblox servers
6
4
 
7
5
  ## Installation
@@ -22,3 +22,12 @@
22
22
  # Number of seconds to wait after successful Grid restart (make sure to increase Foreman and CLI timeouts).
23
23
  # Set to 0 to disable the delay.
24
24
  #:wait_after_restart: 10
25
+
26
+ # DHCP custom options (name, num, value and vendor_class). Set to blank to ignore.
27
+ # This is only used for 'fixedaddress' record types.
28
+ #:options:
29
+ #-
30
+ #name: "DHCP option name"
31
+ #num: 1234
32
+ #value: "A value"
33
+ #vendor_class: "A vendor class"
@@ -17,6 +17,8 @@ module ::Proxy::DHCP::Infoblox
17
17
  def all_leases(network_address, subnet)
18
18
  address_range_regex = NetworkAddressesRegularExpressionGenerator.new.generate_regex(network_address)
19
19
  ::Infoblox::Lease.find(@connection, 'address~' => address_range_regex).map do |lease|
20
+ # Infoblox can return MAC address set to nil
21
+ next unless lease.hardware
20
22
  Proxy::DHCP::Lease.new(
21
23
  lease.client_hostname,
22
24
  lease.address,
@@ -27,7 +29,7 @@ module ::Proxy::DHCP::Infoblox
27
29
  lease.binding_state,
28
30
  :hostname => lease.client_hostname
29
31
  )
30
- end
32
+ end.compact
31
33
  end
32
34
 
33
35
  def find_record(subnet_address, an_address)
@@ -6,7 +6,8 @@ module Proxy::DHCP::Infoblox
6
6
  :dns_view => "default",
7
7
  :network_view => "default",
8
8
  :blacklist_duration_minutes => 30 * 60,
9
- :wait_after_restart => 10
9
+ :wait_after_restart => 10,
10
+ :options => []
10
11
 
11
12
  validate_presence :username, :password
12
13
 
@@ -1,7 +1,7 @@
1
1
  module Proxy
2
2
  module DHCP
3
3
  module Infoblox
4
- VERSION = '0.0.15'.freeze
4
+ VERSION = '0.0.16'.freeze
5
5
  end
6
6
  end
7
7
  end
@@ -1,3 +1,4 @@
1
+ require 'yaml'
1
2
  require 'smart_proxy_dhcp_infoblox/common_crud'
2
3
 
3
4
  module ::Proxy::DHCP::Infoblox
@@ -58,6 +59,7 @@ module ::Proxy::DHCP::Infoblox
58
59
  host.bootfile = options[:filename]
59
60
  host.use_bootfile = true
60
61
  host.network_view = network_view
62
+ host.options = Proxy::DHCP::Infoblox::Plugin.settings.options
61
63
  host
62
64
  end
63
65
  end
@@ -14,7 +14,7 @@ module Proxy::DHCP::Infoblox
14
14
  c.dependency :connection, (lambda {
15
15
  ::Infoblox.wapi_version = '2.0'
16
16
  ::Infoblox::Connection.new(:username => settings[:username], :password => settings[:password],
17
- :host => settings[:server], :ssl_opts => { :verify => true },
17
+ :host => settings[:server], :ssl_opts => { :verify => !ENV['FOREMAN_INFOBLOX_NOSSLVERIFY'] },
18
18
  :logger => ::Proxy::LogBuffer::Decorator.instance)
19
19
  })
20
20
 
@@ -208,6 +208,17 @@ class FixedaddressCrudTest < Test::Unit::TestCase
208
208
  assert_equal @network_view, built.network_view
209
209
  end
210
210
 
211
+ def test_build_host_with_options
212
+ begin
213
+ Proxy::DHCP::Infoblox::Plugin.settings.options = [{"name" => "xyz"}]
214
+
215
+ host = @crud.build_host(:ip => @ip, :mac => @mac, :hostname => @hostname)
216
+ assert_equal [{"name" => "xyz"}], host.instance_variable_get("@options")
217
+ ensure
218
+ Proxy::DHCP::Infoblox::Plugin.settings.options = []
219
+ end
220
+ end
221
+
211
222
  def test_add_record_with_collision
212
223
  @crud.expects(:build_host).with(:ip => @ip, :mac => @mac, :hostname => @hostname).returns(@host)
213
224
  @host.expects(:post).raises(Infoblox::Error.new("IB.Data.Conflict"))
@@ -16,6 +16,7 @@ class PluginDefaultConfigurationTest < Test::Unit::TestCase
16
16
  :blacklist_duration_minutes => 30 * 60,
17
17
  :wait_after_restart => 10,
18
18
  :dns_view => "default",
19
+ :options => [],
19
20
  :network_view => "default" },
20
21
  Proxy::DHCP::Infoblox::Plugin.default_settings)
21
22
  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.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Klaas Demter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-30 00:00:00.000000000 Z
11
+ date: 2020-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: infoblox