Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Parse_databases.rb snip
- module Puppet::Parser::Functions
- newfunction(:parse_databases, :type => :rvalue, :doc =>
- "This function accepts an input hash, a filter and a matcher value.
- It then parses the hash based on the filter, and any matches are returned in a hash.
- If no results are found, then nil is returned.
- Valid filters are:
- * 'database',
- * 'netapp_primary_controller',
- * 'netapp_snapmirror_controller',
- * 'database_primary_server',
- * 'database_replication_server'"
- ) do |arguments|
- Puppet::Parser::Functions.autoloader.loadall
- ...
- db_servers = function_foreman(['fact_values', "fact = ipaddress and (host = #{value['database_primary_server']} or host = #{value['database_replication_server']})"])
- raise Puppet::ParseError, "Foreman function returned no details." if db_servers.nil?
- function_notice(["DB_servers looks like: #{db_servers}. Nil = #{db_servers.nil?}. Class = #{db_servers.class}."])
- db_servers.each do |name, details|
- # Add ipaddress value to allowed_hosts array
- debug "Name = #{name}"
- debug "IPAddress = #{details['ipaddress']}"
- allowed_hosts << details['ipaddress'] unless details['ipaddress'].nil?
- end
- # Puppet error
- Error: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `each' for nil:NilClass at /etc/puppet/modules/common/act/manifests/server/linux/db/oracle.pp:175 on node act-star-db05.card.co.uk
- Warning: Not using cache on failed catalog
- Error: Could not retrieve catalog; skipping run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement