Summary
This gem lets users create and manage DNS entries against an Infoblox Grid. For now, only the following entries are supported.
-
A
-
CNAME
-
AAAA
-
PTR
Managing DNS entries via SDK
Managing DNS entries via Infoblox Classes
require 'mintpress-infrastructure-infoblox'
# Define the platform
MintPress::InfrastructureInfoblox::UsingInfobloxPlatform.new(
name: 'dns_platform',
all_platform_services: true,
user: 'test_user',
password: 'test_password',
# The url must be the until the version
url: 'https://infoblox-grid/wapi/v2.3'
)
# Create A record
e1 = MintPress::InfrastructureInfoblox::InfobloxDnsEntry.new(type: 'A',
name: 'rb4.primary1.com',
values: '10.10.10.5'
)
e1.create
# check if the record exists
e1.exists?
# Remove a record
e1.remove
# AAAA record, ipv6 values
e1 = MintPress::InfrastructureInfoblox::InfobloxDnsEntry.new(type: 'AAAA',
name: 'rb4.primary1.com',
values: 'd60:e32:f1b9::2'
)
e1.create
# Create CNAME
e1 = MintPress::InfrastructureInfoblox::InfobloxDnsEntry.new(type: 'CNAME',
name: 'rb4-cname.primary1.com',
values: 'rb4.primary1.com'
)
e1.create
# Create a PTR entry, ensure that the user has access to write to the IP zone.
# The code automatically converts this into %d.%d.%d.%d.in-addr.arpa format
e1 = MintPress::InfrastructureInfoblox::InfobloxDnsEntry.new(type: 'PTR',
name: 'rb4.primary1.com',
values: '10.10.10.5'
)
e1.create
Managing DNS entries via Generic Classes
# A record
e1 = MintPress::Infrastructure::DnsEntry.new(type: 'A',
name: 'rb4.primary1.com',
values: '10.10.10.5'
)
# create
e1.create
# check for existence
e1.exists?
# remove it
e1.remove
Similarly, other supported types can be created.
Managing DNS Entries via CINC Resources
# Define the platform
using_infoblox_platform "infoblox_platform" do
user: 'username'
password: 'password'
url: 'https://infoblox-grid/wapi/v2.3'
end
# Create a DNS Entry
infrastructure_infoblox_dns_entry 'host1.primaryexample.com' do
my_type 'A'
values '192.168.1.156'
action :create
end
# Removes a DNS Entry
infrastructure_infoblox_dns_entry 'host1.primaryexample.com' do
my_type 'A'
values '192.168.1.156'
action :remove
end
Reference
Infoblox API ref insights.infoblox.com/resources-deployment-guides/infoblox-deployment-infoblox-rest-api