diff --git a/manifests/plugin/container_gateway.pp b/manifests/plugin/container_gateway.pp index 56b2d03c..7f419228 100644 --- a/manifests/plugin/container_gateway.pp +++ b/manifests/plugin/container_gateway.pp @@ -6,6 +6,8 @@ # # $sqlite_db_path:: Absolute path for the SQLite DB file to exist at # +# $sqlite_timeout:: Database busy timeout in milliseconds +# # === Advanced parameters: # # $enabled:: enables/disables the pulp plugin @@ -21,6 +23,7 @@ Foreman_proxy::ListenOn $listen_on = 'https', Stdlib::HTTPUrl $pulp_endpoint = "https://${facts['networking']['fqdn']}", Stdlib::Absolutepath $sqlite_db_path = '/var/lib/foreman-proxy/smart_proxy_container_gateway.db', + Optional[Integer] $sqlite_timeout = undef, ) { foreman_proxy::plugin::module { 'container_gateway': version => $version, diff --git a/spec/classes/foreman_proxy__plugin__container_gateway_spec.rb b/spec/classes/foreman_proxy__plugin__container_gateway_spec.rb index 82281db0..0363fecd 100644 --- a/spec/classes/foreman_proxy__plugin__container_gateway_spec.rb +++ b/spec/classes/foreman_proxy__plugin__container_gateway_spec.rb @@ -22,6 +22,7 @@ let :params do { :pulp_endpoint => 'https://test.example.com', :sqlite_db_path => '/dev/null.db', + :sqlite_timeout => 12345, } end it 'container_gateway.yml should contain the correct configuration' do @@ -29,7 +30,8 @@ '---', ':enabled: https', ':pulp_endpoint: https://test.example.com', - ':sqlite_db_path: /dev/null.db' + ':sqlite_db_path: /dev/null.db', + ':sqlite_timeout: 12345' ]) end end diff --git a/templates/plugin/container_gateway.yml.erb b/templates/plugin/container_gateway.yml.erb index 245c97cc..c50b9ed4 100644 --- a/templates/plugin/container_gateway.yml.erb +++ b/templates/plugin/container_gateway.yml.erb @@ -3,3 +3,6 @@ :enabled: <%= @module_enabled %> :pulp_endpoint: <%= scope.lookupvar("foreman_proxy::plugin::container_gateway::pulp_endpoint") %> :sqlite_db_path: <%= scope.lookupvar("foreman_proxy::plugin::container_gateway::sqlite_db_path") %> +<% if scope.lookupvar("foreman_proxy::plugin::container_gateway::sqlite_timeout") -%> +:sqlite_timeout: <%= scope.lookupvar("foreman_proxy::plugin::container_gateway::sqlite_timeout") %> +<% end -%>