Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifests/failover.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
owner => 'root',
}

concat::fragment {"dhcp.failover.${name}":
concat::fragment {"01.dhcp.failover.${name}":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no order parameter?

ensure => $ensure,
content => "include \"${dhcp::params::config_dir}/failover.d/${name}.conf\";\n",
target => "${dhcp::params::config_dir}/dhcpd.conf",
Expand Down
66 changes: 66 additions & 0 deletions spec/acceptance/dhcp_failover_shared_network_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
require 'spec_helper_acceptance'

describe 'dhcp::failover with dhcp::shared_network' do
describe 'with defaults' do
it 'should work with no error' do
pp = <<-EOS
class { 'dhcp::server': }

dhcp::shared_network {'office':
subnets => ['${sub}.10.0', '${sub}.11.0', '${sub}.12.0'],
}


dhcp::failover {'my-failover':
peer_address => '1.1.1.1',
options => {
'max-response-delay' => 30,
'max-unacked-updates' => 10,
'load balance max seconds' => 3,
'mclt' => 1800,
'split' => 128,
}
}
$ipaddr = split($::networking['interfaces']['eth0']['ip'], '[.]')
$sub = "${ipaddr[0]}.${ipaddr[1]}"
dhcp::subnet {${sub}.10.0:
broadcast => "${sub}.10.255",
subnet_mask => '255.255.0.0',
domain_name => 'example.com',
other_opts => [
"option domain-name-servers ${sub}.10.1, ${sub}.10.2",
'option domain-search "example.com", "internal.example.com"',
'pool {',
'}',
]
}
dhcp::subnet {${sub}.11.0:
broadcast => "${sub}.11.255",
subnet_mask => '255.255.0.0',
domain_name => 'example.com',
other_opts => [
"option domain-name-servers ${sub}.11.1, ${sub}.11.2",
'option domain-search "example.com", "internal.example.com"',
'pool {',
'}',
]
}
dhcp::subnet {${sub}.12.0:
broadcast => "${sub}.12.255",
subnet_mask => '255.255.0.0',
domain_name => 'example.com',
other_opts => [
"option domain-name-servers ${sub}.12.1, ${sub}.12.2",
'option domain-search "example.com", "internal.example.com"',
'pool {',
'failover peer "my-failover"',
"range ${sub}.12.100 ${sub}.12.250",
'}',
]
}
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
end
end
2 changes: 1 addition & 1 deletion spec/defines/dhcp_failover_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
).with_content(
/peer port 647;\n/
) }
it { should contain_concat__fragment('dhcp.failover.failover-dhcp').with({
it { should contain_concat__fragment('01.dhcp.failover.failover-dhcp').with({
:content => "include \"/etc/dhcp/failover.d/failover-dhcp.conf\";\n",
:target => '/etc/dhcp/dhcpd.conf',
})}
Expand Down