1 require 'spec_helper_acceptance'
3 describe 'remote-access', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
5 skip "These tests require the spec/acceptance/nodesets/centos-64-x64-2-hosts nodeset"
8 describe "configuring multi-node postgresql" do
10 # Get the database's IP to connect to from the database
11 let(:database_ip_address) do
12 hosts_as('database').inject({}) do |memo,host|
13 fact_on host, "ipaddress_eth1"
17 hosts_as('database').each do |host|
18 it "should be able to configure a host as database on #{host}" do
20 # Stop firewall so we can easily connect
25 class { 'postgresql::server':
26 ip_mask_allow_all_users => '0.0.0.0/0',
27 listen_addresses => '*',
30 postgresql::server::db { 'puppet':
32 password => postgresql_password('puppet', 'puppet'),
35 postgresql::server::pg_hba_rule { 'allow full yolo access password':
39 address => '0.0.0.0/0',
40 auth_method => 'password',
44 apply_manifest_on(host, pp, :catch_failures => true)
48 hosts_as('client').each do |host|
49 it "should be able to configure a host as client on #{host} and then access database" do
51 class { 'postgresql::client':}
53 $connection_settings = {
55 'PGPASSWORD' => "puppet",
56 'PGHOST' => "#{database_ip_address}",
58 'PGDATABASE' => "puppet",
61 postgresql_psql { 'run using connection_settings':
62 command => 'select 1',
65 connect_settings => $connection_settings,
68 apply_manifest_on(host, pp, :catch_failures => true)