Revision e2a85d35
Added by Cristian Falcas over 9 years ago
manifests/admin.pp | ||
---|---|---|
# $rpm:: Install puppet extension
|
||
# type:boolean
|
||
#
|
||
# $puppet_upload_working_dir:: Directory where status files for in progress uploads will be stored
|
||
#
|
||
# $puppet_upload_chunk_size:: Maximum amount of data (in bytes) sent for an upload in a single request
|
||
# type:integer
|
||
#
|
||
class pulp::admin (
|
||
$version = $pulp::admin::params::version,
|
||
$host = $pulp::admin::params::host,
|
||
... | ... | |
$nodes = $pulp::admin::params::nodes,
|
||
$python = $pulp::admin::params::python,
|
||
$rpm = $pulp::admin::params::rpm,
|
||
$puppet_upload_working_dir = $pulp::admin::params::puppet_upload_working_dir,
|
||
$puppet_upload_chunk_size = $pulp::admin::params::puppet_upload_chunk_size,
|
||
) inherits pulp::admin::params {
|
||
class { 'pulp::admin::install': } ~>
|
||
class { 'pulp::admin::config': }
|
spec/classes/pulp_admin_spec.rb | ||
---|---|---|
|
||
it 'should set admin.conf file' do
|
||
should contain_file('/etc/pulp/admin/admin.conf').
|
||
with_content(/^\[server\]$/).
|
||
with_content(/^host: localhost$/).
|
||
with_content(/^port: 443$/).
|
||
with_content(/^api_prefix: \/pulp\/api$/).
|
||
with_content(/^verify_ssl: true$/).
|
||
with_content(/^ca_path: \/etc\/pki\/tls\/certs\/ca-bundle.crt$/).
|
||
with_content(/^upload_chunk_size: 1048576$/).
|
||
with_content(/^\[client\]$/).
|
||
with_content(/^role: admin$/).
|
||
with_content(/^\[filesystem\]$/).
|
||
with_content(/^extensions_dir: \/usr\/lib\/pulp\/admin\/extensions$/).
|
||
with_content(/^id_cert_dir: ~\/.pulp$/).
|
||
with_content(/^id_cert_filename: user-cert.pem$/).
|
||
with_content(/^upload_working_dir: ~\/.pulp\/uploads$/).
|
||
with_content(/^\[logging\]$/).
|
||
with_content(/^filename: ~\/.pulp\/admin.log$/).
|
||
with_content(/^call_log_filename: ~\/.pulp\/server_calls.log$/).
|
||
with_content(/^\[output\]$/).
|
||
with_content(/^poll_frequency_in_seconds: 1$/).
|
||
with_content(/^enable_color: true$/).
|
||
with_content(/^wrap_to_terminal: false$/).
|
||
with_content(/^wrap_width: 80$/).
|
||
with_ensure('file')
|
||
with_content(/^\[server\]$/).
|
||
with_content(/^host: localhost$/).
|
||
with_content(/^port: 443$/).
|
||
with_content(/^api_prefix: \/pulp\/api$/).
|
||
with_content(/^verify_ssl: true$/).
|
||
with_content(/^ca_path: \/etc\/pki\/tls\/certs\/ca-bundle.crt$/).
|
||
with_content(/^upload_chunk_size: 1048576$/).
|
||
with_content(/^\[client\]$/).
|
||
with_content(/^role: admin$/).
|
||
with_content(/^\[filesystem\]$/).
|
||
with_content(/^extensions_dir: \/usr\/lib\/pulp\/admin\/extensions$/).
|
||
with_content(/^id_cert_dir: ~\/.pulp$/).
|
||
with_content(/^id_cert_filename: user-cert.pem$/).
|
||
with_content(/^upload_working_dir: ~\/.pulp\/uploads$/).
|
||
with_content(/^\[logging\]$/).
|
||
with_content(/^filename: ~\/.pulp\/admin.log$/).
|
||
with_content(/^call_log_filename: ~\/.pulp\/server_calls.log$/).
|
||
with_content(/^\[output\]$/).
|
||
with_content(/^poll_frequency_in_seconds: 1$/).
|
||
with_content(/^enable_color: true$/).
|
||
with_content(/^wrap_to_terminal: false$/).
|
||
with_content(/^wrap_width: 80$/).
|
||
with_ensure('file')
|
||
end
|
||
end
|
||
|
||
... | ... | |
|
||
it 'should set puppet.conf file' do
|
||
should contain_file('/etc/pulp/admin/conf.d/puppet.conf').
|
||
with_content(/^\[puppet\]$/).
|
||
with_content(/^upload_working_dir = ~\/.pulp\/puppet-uploads$/).
|
||
with_content(/^upload_chunk_size = 1048576$/).
|
||
with_ensure('file')
|
||
with_content(/^\[puppet\]$/).
|
||
with_content(/^upload_working_dir = ~\/.pulp\/puppet-uploads$/).
|
||
with_content(/^upload_chunk_size = 1048576$/).
|
||
with_ensure('file')
|
||
end
|
||
|
||
end
|
||
... | ... | |
|
||
it 'should set the defaults file' do
|
||
should contain_file('/etc/pulp/admin/admin.conf').
|
||
with_content(/^\[server\]$/).
|
||
with_content(/^host: pulp.company.net$/).
|
||
with_content(/^verify_ssl: false$/).
|
||
with_ensure('file')
|
||
with_content(/^\[server\]$/).
|
||
with_content(/^host: pulp.company.net$/).
|
||
with_content(/^verify_ssl: false$/).
|
||
with_ensure('file')
|
||
end
|
||
end
|
||
end
|
templates/admin_puppet.conf.erb | ||
---|---|---|
### File managed with puppet ###
|
||
[puppet]
|
||
|
||
# Directory where status files for in progress uploads will be stored
|
||
upload_working_dir = ~/.pulp/puppet-uploads
|
||
upload_working_dir = <%= scope.lookupvar('pulp::admin::puppet_upload_working_dir') %>
|
||
|
||
# Maximum amount of data (in bytes) sent for an upload in a single request
|
||
upload_chunk_size = 1048576
|
||
upload_chunk_size = <%= scope.lookupvar('pulp::admin::puppet_upload_chunk_size') %>
|
Also available in: Unified diff
fixes