Skip to content

Commit

Permalink
Listen on IPv6 on EL7
Browse files Browse the repository at this point in the history
On Ruby 2.0 listening on * only listens on IPv4. Listening on :: listens
on both IPv4 and IPv6.

Original issue:

https://bugs.ruby-lang.org/issues/7100
ruby/ruby@b1f493d
  • Loading branch information
ekohl authored and mmoll committed Apr 9, 2018
1 parent 839944a commit 77ed56f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@
$plugin_version = 'installed'

# Enable listening on http
$bind_host = ['*']
if $::osfamily == 'RedHat' and versioncmp($::operatingsystemmajrelease, '7') <= 0 {
$bind_host = ['::']
} else {
$bind_host = ['*']
}
$http = false
$http_port = 8000

Expand Down
8 changes: 7 additions & 1 deletion spec/classes/foreman_proxy__config__spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
ssl_dir = '/var/lib/puppet/ssl'
end

if facts[:osfamily] == 'RedHat' and facts[:operatingsystemmajrelease].to_i <= 7
bind_host = '::'
else
bind_host = '*'
end

puppetca_command = "#{usr_dir}/bin/puppet cert *"
puppetrun_command = "#{usr_dir}/bin/puppet kick *"

Expand Down Expand Up @@ -103,7 +109,7 @@
" - #{facts[:fqdn]}",
":foreman_url: https://#{facts[:fqdn]}",
':daemon: true',
':bind_host: \'*\'',
":bind_host: '#{bind_host}'",
':https_port: 8443',
':log_file: /var/log/foreman-proxy/proxy.log',
':log_level: INFO',
Expand Down

0 comments on commit 77ed56f

Please sign in to comment.