Skip to content

Avoid hardcoding ipaddress6 default #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/rspec-puppet/support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,18 @@ def facts_hash(node)
'hostname' => node.split('.').first,
'fqdn' => node,
'domain' => node.split('.', 2).last,
'clientcert' => node,
'ipaddress6' => 'FE80:0000:0000:0000:AAAA:AAAA:AAAA'
'clientcert' => node
}

# Puppet 6.9.0 started setting a `serverip6` server fact which is set
# using the value of the `ipaddress6` fact. If the fact set(s) provided
# by FacterDB don't have an `ipaddress6` fact set, then the normal Facter
# fact will be resolved, which can result in Ruby trying to load Windows
# only gems on Linux. This is only a problem if facter is used.
if RSpec.configuration.facter_implementation.to_sym == :facter
node_facts['ipaddress6'] = 'FE80:0000:0000:0000:AAAA:AAAA:AAAA'
end

networking_facts = {
'hostname' => node_facts['hostname'],
'fqdn' => node_facts['fqdn'],
Expand Down