Skip to content

Commit

Permalink
Not sure why haproxy::listen doesn't work, but haproxy::frontend
Browse files Browse the repository at this point in the history
…does
  • Loading branch information
yakatz committed May 30, 2022
1 parent 635d356 commit 5175e8e
Showing 1 changed file with 17 additions and 35 deletions.
52 changes: 17 additions & 35 deletions spec/acceptance/mapfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,9 @@
content => $error_page_content,
}
file_line {'localhost':
path => '/etc/hosts',
line => '127.0.0.1 localhost',
}
file_line {'host2':
path => '/etc/hosts',
line => '127.0.0.2 host2',
}
file_line {'host3':
path => '/etc/hosts',
line => '127.0.0.3 host3',
path => '/etc/hosts',
line => '127.0.0.1 localhost host2 host3',
match => '^127\.0\.0\.1',
}
include ::haproxy
haproxy::mapfile { 'single-mapfile':
Expand All @@ -94,13 +87,11 @@
{ 'host3' => 'backend3' },
],
}
haproxy::listen { 'test00':
bind => {
'127.0.0.1:5555' => [],
'127.0.0.2:5555' => [],
'127.0.0.3:5555' => [],
},
options => {
haproxy::frontend { 'test00':
ipaddress => '127.0.0.1',
ports => '5555',
mode => 'http',
options => {
'use_backend' => '%[req.hdr(host),lower,map_dom(/etc/haproxy/single-mapfile.map,backend1)]'
},
}
Expand Down Expand Up @@ -173,16 +164,9 @@
content => $error_page_content,
}
file_line {'localhost':
path => '/etc/hosts',
line => '127.0.0.1 localhost',
}
file_line {'host2':
path => '/etc/hosts',
line => '127.0.0.2 host2',
}
file_line {'host3':
path => '/etc/hosts',
line => '127.0.0.3 host3',
path => '/etc/hosts',
line => '127.0.0.1 localhost host2 host3',
match => '^127\.0\.0\.1',
}
include ::haproxy
haproxy::mapfile { 'multiple-mapfiles':
Expand All @@ -194,14 +178,12 @@
haproxy::mapfile::entry { 'host3 backend3':
mapfile => 'multiple-mapfiles',
}
haproxy::listen { 'test00':
bind => {
'127.0.0.1:5555' => [],
'127.0.0.2:5555' => [],
'127.0.0.3:5555' => [],
},
options => {
'use_backend' => '%[req.hdr(host),lower,map_dom(/etc/haproxy/multiple-mapfiles.map,backend1)]'
haproxy::frontend { 'test00':
ipaddress => '127.0.0.1',
ports => '5555',
mode => 'http',
options => {
'use_backend' => '%[req.hdr(host),lower,map_dom(/etc/haproxy/single-mapfile.map,backend1)]'
},
}
haproxy::backend { 'backend1':
Expand Down

0 comments on commit 5175e8e

Please sign in to comment.