diff --git a/manifests/quota.pp b/manifests/quota.pp index f30b9221..531e1ec6 100644 --- a/manifests/quota.pp +++ b/manifests/quota.pp @@ -6,15 +6,15 @@ # # [*max_instances_per_tenant*] # (optional) Default maximum number of instances per tenant. -# Defaults to 5. +# Defaults to $facts['os_service_default']. # # [*max_ram_per_tenant*] # (optional) Default maximum amount of RAM (in MB) per tenant. -# Defaults to -1. +# Defaults to $facts['os_service_default']. # # [*max_accepted_volume_size*] # (optional) Default maximum volume size (in GB) for an instance. -# Defaults to 5. +# Defaults to $facts['os_service_default']. # # [*max_volumes_per_tenant*] # (optional) Default maximum volume capacity (in GB) spanning across @@ -23,19 +23,19 @@ # # [*max_backups_per_tenant*] # (optional) Default maximum number of backups created by a tenant. -# Defaults to 50. +# Defaults to $facts['os_service_default']. # # [*quota_driver*] # (optional) Default driver to use for quota checks. # Defaults to 'trove.quota.quota.DbQuotaDriver'. # class trove::quota ( - $max_instances_per_tenant = 5, - $max_ram_per_tenant = -1, - $max_accepted_volume_size = 5, - $max_volumes_per_tenant = 20, - $max_backups_per_tenant = 50, - $quota_driver = 'trove.quota.quota.DbQuotaDriver', + $max_instances_per_tenant = $facts['os_service_default'], + $max_ram_per_tenant = $facts['os_service_default'], + $max_accepted_volume_size = $facts['os_service_default'], + $max_volumes_per_tenant = $facts['os_service_default'], + $max_backups_per_tenant = $facts['os_service_default'], + $quota_driver = $facts['os_service_default'], ) { include trove::deps diff --git a/releasenotes/notes/use-service-default-for-quota-opts-d06793e6832314d3.yaml b/releasenotes/notes/use-service-default-for-quota-opts-d06793e6832314d3.yaml new file mode 100644 index 00000000..d56afafa --- /dev/null +++ b/releasenotes/notes/use-service-default-for-quota-opts-d06793e6832314d3.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + Default values of the ``trove::quota`` class parameters have been updated + and now the service default values are used by default. diff --git a/spec/classes/trove_quota_spec.rb b/spec/classes/trove_quota_spec.rb index 1cf5329b..9c372698 100644 --- a/spec/classes/trove_quota_spec.rb +++ b/spec/classes/trove_quota_spec.rb @@ -5,18 +5,12 @@ describe 'trove::quota' do shared_examples_for 'trove::quota' do context 'with default parameters' do it 'contains default values' do - is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with( - :value => 5) - is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with( - :value => -1) - is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with( - :value => 5) - is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with( - :value => 20) - is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with( - :value => 50) - is_expected.to contain_trove_config('DEFAULT/quota_driver').with( - :value => 'trove.quota.quota.DbQuotaDriver') + is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with_value('') + is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with_value('') + is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with_value('') + is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with_value('') + is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with_value('') + is_expected.to contain_trove_config('DEFAULT/quota_driver').with_value('') end end @@ -27,19 +21,16 @@ describe 'trove::quota' do :max_accepted_volume_size => 10, :max_volumes_per_tenant => 100, :max_backups_per_tenant => 100, + :quota_driver => 'trove.quota.quota.DbQuotaDriver', } end it 'contains overrided values' do - is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with( - :value => 10) - is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with( - :value => 10) - is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with( - :value => 10) - is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with( - :value => 100) - is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with( - :value => 100) + is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with_value(10) + is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with_value(10) + is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with_value(10) + is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with_value(100) + is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with_value(100) + is_expected.to contain_trove_config('DEFAULT/quota_driver').with_value('trove.quota.quota.DbQuotaDriver') end end end