Skip to content
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

Added passthrough pulp mode #372

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@
}

if $pulp::manage_squid {
class { 'pulp::squid':
passthrough_pulp_enabled => $pulp::enable_passthrough_pulp,
passthrough_pulp_http_port => $pulp::passthrough_pulp_http_port,
passthrough_pulp_allowed_net => $pulp::passthrough_pulp_allowed_net,
passthrough_pulp_master_host => $pulp::passthrough_pulp_master_host,
}
contain pulp::squid
}

Expand Down
21 changes: 21 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,22 @@
# Pulp's mongo database has slow I/O, then setting a higher number may
# resolve issues where workers are going missing incorrectly. Defaults to 30.
#
# @param enable_passthrough_pulp
# Enable passthrough mode to pulp master via squid
#
# @param passthrough_pulp_http_port
# Port at squid for the passthrough pulp mode
# Can not be 3128
# Example: 3129
#
# @param passthrough_pulp_allowed_net
# Allowed network to access squid for the passthrough pulp mode
# Format: network/CIDR
# Example: 192.168.2.0/24
#
# @param passthrough_pulp_master_host
# Pulp master hostname to be used for the passhthrough pulp mode via squid
#
class pulp (
String $version = $pulp::params::version,
Boolean $crane_debug = $pulp::params::crane_debug,
Expand Down Expand Up @@ -517,6 +533,11 @@
Optional[String] $ldap_bind_dn = $pulp::params::ldap_bind_dn,
Optional[String] $ldap_bind_password = $pulp::params::ldap_bind_password,
String $ldap_remote_user_attribute = $pulp::params::ldap_remote_user_attribute,
Boolean $enable_passthrough_pulp = $pulp::params::enable_passthrough_pulp,
Stdlib::Port $passthrough_pulp_http_port = $pulp::params::passthrough_pulp_http_port,
Optional[String] $passthrough_pulp_allowed_net = $pulp::params::passthrough_pulp_allowed_net,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekohl See #372 (comment) regarding your answer about "full pulp instance deployment".

Optional[Stdlib::Host] $passthrough_pulp_master_host = $pulp::params::passthrough_pulp_master_host,

) inherits pulp::params {
if $yum_max_speed {
$real_yum_max_speed = to_bytes($yum_max_speed)
Expand Down
5 changes: 5 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,9 @@
$ldap_bind_dn = undef
$ldap_bind_password = undef
$ldap_remote_user_attribute = 'sAMAccountName'

$enable_passthrough_pulp = false
$passthrough_pulp_http_port = 3139
$passthrough_pulp_allowed_net = undef
$passthrough_pulp_master_host = undef
}
26 changes: 25 additions & 1 deletion manifests/squid.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
String $maximum_object_size = '5 GB',
String $maximum_object_size_in_memory = '100 MB',
Stdlib::Absolutepath $cache_dir = '/var/spool/squid',
Boolean $passthrough_pulp_enabled = false,
Stdlib::Port $passthrough_pulp_http_port = 3129,
String $passthrough_pulp_allowed_net = '0.0.0.0/0',
Stdlib::Host $passthrough_pulp_master_host = 'unset.domain',
) {
class { 'squid':
maximum_object_size_in_memory => $maximum_object_size_in_memory,
Expand All @@ -22,6 +26,26 @@
options => "accel defaultsite=${streamer_host}:${streamer_port}",
}

if $passthrough_pulp_enabled {
squid::http_port { 'passthrough to pulp master port':
port => $passthrough_pulp_http_port,
}

squid::acl { 'passthrough_pulp_allowed_net':
type => 'src',
entries => [$passthrough_pulp_allowed_net],
}

squid::acl { 'passthrough_pulp_master_host':
type => 'dstdomain',
entries => [$passthrough_pulp_master_host],
}

squid::http_access { 'passthrough_pulp_allowed_net passthrough_pulp_master_host':
action => 'allow',
}
}

squid::http_access { 'localhost':
action => 'allow',
}
Expand All @@ -47,7 +71,7 @@
order => '60',
config_entries => {
'cache_peer' => "${streamer_host} parent ${streamer_port} 0 no-digest no-query originserver name=PulpStreamer",
'cache_peer_access' => 'PulpStreamer allow all',
'cache_peer_access' => 'PulpStreamer allow localhost',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a general thing that can be applied to all installations, correct? Only Apache/Pulp connect to squid.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. I think so.

'range_offset_limit' => 'none',
'maximum_object_size' => $maximum_object_size,
'minimum_object_size' => '0 kB',
Expand Down