86a0453f2f
This patch provides a more advanced way of managing pg_hba rules, by providing a defined resource to manage a pg_hba file, and a defined resource for managing rules within such a file (pg_hba_rule). These new resources are wrappers around ripinaar-concat, and utilise file assemblies instead of a template to compose the pg_hba.conf file. I've provided a function that interprets the old ip4|6acl arrays and converts them to this new format for backwards compatibility as well. I slightly reformatted our documentation to allow for better documentation of defined resources in 'Usage' as well, and provided examples of how to use this new resource. This hopefully should go a long way to solving the PR's related to lack of full functionality for pg_hba.conf. Signed-off-by: Ken Barber <ken@bob.sh>
27 lines
679 B
Ruby
27 lines
679 B
Ruby
require 'puppetlabs_spec_helper/module_spec_helper'
|
|
|
|
RSpec.configure do |c|
|
|
c.include PuppetlabsSpec::Files
|
|
|
|
c.before :each do
|
|
# Ensure that we don't accidentally cache facts and environment
|
|
# between test cases.
|
|
Facter::Util::Loader.any_instance.stubs(:load_all)
|
|
Facter.clear
|
|
Facter.clear_messages
|
|
|
|
# Store any environment variables away to be restored later
|
|
@old_env = {}
|
|
ENV.each_key {|k| @old_env[k] = ENV[k]}
|
|
end
|
|
|
|
c.after :each do
|
|
PuppetlabsSpec::Files.cleanup
|
|
end
|
|
end
|
|
|
|
# Convenience helper for returning parameters for a type from the
|
|
# catalogue.
|
|
def param(type, title, param)
|
|
param_value(catalogue, type, title, param)
|
|
end
|