Skip to content

Commit

Permalink
Provide Apache & PostgreSQL params via Hiera
Browse files Browse the repository at this point in the history
By using beaker-hiera there is no need to provide it in every acceptance
test.
  • Loading branch information
ekohl committed Nov 6, 2023
1 parent 7072ec7 commit 77c3afc
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 82 deletions.
7 changes: 7 additions & 0 deletions spec/acceptance/hieradata/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apache::mpm_module: 'prefork'

postgresql::globals::encoding: 'UTF-8'
postgresql::globals::locale: 'en_US.UTF-8'
postgresql::globals::manage_package_repo: true
postgresql::globals::version: '13'
3 changes: 3 additions & 0 deletions spec/acceptance/hieradata/os/RedHat/8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
postgresql::globals::manage_dnf_module: true
postgresql::globals::manage_package_repo: false
18 changes: 2 additions & 16 deletions spec/acceptance/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@

# this will actually deploy apache + postgres + zabbix-server + zabbix-web
pp = <<-EOS
class { 'postgresql::globals':
encoding => 'UTF-8',
locale => 'en_US.UTF-8',
manage_package_repo => $facts['os']['release']['major'] != '8',
manage_dnf_module => $facts['os']['release']['major'] == '8',
version => '13',
}
-> class { 'zabbix::database': }
class { 'zabbix::database': }
-> class { 'zabbix::server': }
EOS

Expand Down Expand Up @@ -65,14 +58,7 @@ class { 'postgresql::globals':

# this will actually deploy apache + postgres + zabbix-server + zabbix-web
pp = <<-EOS
class { 'postgresql::globals':
encoding => 'UTF-8',
locale => 'en_US.UTF-8',
manage_package_repo => $facts['os']['release']['major'] != '8',
manage_dnf_module => $facts['os']['release']['major'] == '8',
version => '13',
}
-> class { 'zabbix::database': }
class { 'zabbix::database': }
-> class { 'zabbix::server':
zabbix_version => "#{zabbix_version}"
}
Expand Down
11 changes: 0 additions & 11 deletions spec/acceptance/zabbix_application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,13 @@
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests
pp1 = <<-EOS
class { 'apache':
mpm_module => 'prefork',
}
class { 'postgresql::globals':
locale => 'en_US.UTF-8',
manage_package_repo => $facts['os']['release']['major'] != '8',
manage_dnf_module => $facts['os']['release']['major'] == '8',
version => '13',
}
class { 'zabbix':
zabbix_version => "#{zabbix_version}",
zabbix_url => 'localhost',
zabbix_api_user => 'Admin',
zabbix_api_pass => 'zabbix',
apache_use_ssl => false,
manage_resources => true,
require => Class['apache'],
}
EOS
Expand Down
11 changes: 0 additions & 11 deletions spec/acceptance/zabbix_host_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,13 @@
end

pp1 = <<-EOS
class { 'apache':
mpm_module => 'prefork',
}
class { 'postgresql::globals':
locale => 'en_US.UTF-8',
manage_package_repo => $facts['os']['release']['major'] != '8',
manage_dnf_module => $facts['os']['release']['major'] == '8',
version => '13',
}
class { 'zabbix':
zabbix_version => "#{zabbix_version}",
zabbix_url => 'localhost',
zabbix_api_user => 'Admin',
zabbix_api_pass => 'zabbix',
apache_use_ssl => false,
manage_resources => true,
require => Class['apache'],
}
EOS

Expand Down
11 changes: 0 additions & 11 deletions spec/acceptance/zabbix_hostgroup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,13 @@
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests
pp1 = <<-EOS
class { 'apache':
mpm_module => 'prefork',
}
class { 'postgresql::globals':
locale => 'en_US.UTF-8',
manage_package_repo => $facts['os']['release']['major'] != '8',
manage_dnf_module => $facts['os']['release']['major'] == '8',
version => '13',
}
class { 'zabbix':
zabbix_version => "#{zabbix_version}",
zabbix_url => 'localhost',
zabbix_api_user => 'Admin',
zabbix_api_pass => 'zabbix',
apache_use_ssl => false,
manage_resources => true,
require => Class['apache'],
}
EOS

Expand Down
11 changes: 0 additions & 11 deletions spec/acceptance/zabbix_proxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,13 @@
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests
pp1 = <<-EOS
class { 'apache':
mpm_module => 'prefork',
}
class { 'postgresql::globals':
locale => 'en_US.UTF-8',
manage_package_repo => $facts['os']['release']['major'] != '8',
manage_dnf_module => $facts['os']['release']['major'] == '8',
version => '13',
}
class { 'zabbix':
zabbix_version => "#{zabbix_version}",
zabbix_url => 'localhost',
zabbix_api_user => 'Admin',
zabbix_api_pass => 'zabbix',
apache_use_ssl => false,
manage_resources => true,
require => Class['apache'],
}
EOS

Expand Down
11 changes: 0 additions & 11 deletions spec/acceptance/zabbix_template_host_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,13 @@
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests
pp1 = <<-EOS
class { 'apache':
mpm_module => 'prefork',
}
class { 'postgresql::globals':
locale => 'en_US.UTF-8',
manage_package_repo => $facts['os']['release']['major'] != '8',
manage_dnf_module => $facts['os']['release']['major'] == '8',
version => '13',
}
class { 'zabbix':
zabbix_version => "#{zabbix_version}",
zabbix_url => 'localhost',
zabbix_api_user => 'Admin',
zabbix_api_pass => 'zabbix',
apache_use_ssl => false,
manage_resources => true,
require => Class['apache'],
}
EOS

Expand Down
11 changes: 0 additions & 11 deletions spec/acceptance/zabbix_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,13 @@
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests
pp1 = <<-EOS
class { 'apache':
mpm_module => 'prefork',
}
class { 'postgresql::globals':
locale => 'en_US.UTF-8',
manage_package_repo => $facts['os']['release']['major'] != '8',
manage_dnf_module => $facts['os']['release']['major'] == '8',
version => '13',
}
class { 'zabbix':
zabbix_version => "#{zabbix_version}",
zabbix_url => 'localhost',
zabbix_api_user => 'Admin',
zabbix_api_pass => 'zabbix',
apache_use_ssl => false,
manage_resources => true,
require => Class['apache'],
}
EOS

Expand Down

0 comments on commit 77c3afc

Please sign in to comment.