Mercurial > repos > other > Puppet
annotate modules/apache/spec/defines/balancermember_spec.rb @ 260:5f63afb70415
Fix naming of files for new VPS overrides
$hostname is just the short host name, not the FQDN
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 29 Dec 2019 10:57:18 -0500 |
parents | 675c1cc61eaf |
children | d9352a684e62 |
rev | line source |
---|---|
36
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 require 'spec_helper' |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 describe 'apache::balancermember', :type => :define do |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 let :pre_condition do |
257
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
5 'include apache' |
36
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 end |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 let :facts do |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 { |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 :osfamily => 'Debian', |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 :operatingsystem => 'Debian', |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 :operatingsystemrelease => '6', |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 :lsbdistcodename => 'squeeze', |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 :id => 'root', |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 :concat_basedir => '/dne', |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 :kernel => 'Linux', |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 :is_pe => false, |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 } |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 end |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 describe "allows multiple balancermembers with the same url" do |
257
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
21 let :pre_condition do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
22 'include apache |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
23 apache::balancer {"balancer":} |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
24 apache::balancer {"balancer-external":} |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
25 apache::balancermember {"http://127.0.0.1:8080-external": url => "http://127.0.0.1:8080/", balancer_cluster => "balancer-external"} |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
26 ' |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
27 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
28 let :title do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
29 'http://127.0.0.1:8080/' |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
30 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
31 let :params do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
32 { |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
33 :options => [], |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
34 :url => 'http://127.0.0.1:8080/', |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
35 :balancer_cluster => 'balancer-internal' |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
36 } |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
37 end |
36
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
38 it { should contain_concat__fragment('BalancerMember http://127.0.0.1:8080/') } |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
39 end |
257
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
40 describe "allows balancermember with a different target" do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
41 let :pre_condition do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
42 'include apache |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
43 apache::balancer {"balancername": target => "/etc/apache/balancer.conf"} |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
44 apache::balancermember {"http://127.0.0.1:8080-external": url => "http://127.0.0.1:8080/", balancer_cluster => "balancername"} |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
45 ' |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
46 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
47 let :title do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
48 'http://127.0.0.1:8080/' |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
49 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
50 let :params do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
51 { |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
52 :options => [], |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
53 :url => 'http://127.0.0.1:8080/', |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
54 :balancer_cluster => 'balancername' |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
55 } |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
56 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
57 it { should contain_concat__fragment('BalancerMember http://127.0.0.1:8080/').with({ |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
58 :target => "apache_balancer_balancername", |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
59 })} |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
36
diff
changeset
|
60 end |
36
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
61 end |