Add support for the state_path parameter

Change-Id: I42506c1c4395f547691b7d527329ffefd6bea3d9
This commit is contained in:
Takashi Kajinami 2020-08-04 10:55:47 +09:00
parent 57daa72bea
commit fdd8011284
3 changed files with 13 additions and 0 deletions

View File

@ -12,6 +12,10 @@
# (Optional) Run db sync on the node. # (Optional) Run db sync on the node.
# Defaults to true # Defaults to true
# #
# [*state_path*]
# (optional) Directory for storing state.
# Defaults to $::os_service_default
#
# [*randomize_allocation_candidates*] # [*randomize_allocation_candidates*]
# (Optional) Randomize the results of the returned # (Optional) Randomize the results of the returned
# allocation candidates. # allocation candidates.
@ -25,6 +29,7 @@
class placement( class placement(
$ensure_package = 'present', $ensure_package = 'present',
$sync_db = true, $sync_db = true,
$state_path = $::os_service_default,
$randomize_allocation_candidates = $::os_service_default, $randomize_allocation_candidates = $::os_service_default,
$allocation_conflict_retry_count = $::os_service_default, $allocation_conflict_retry_count = $::os_service_default,
) inherits placement::params { ) inherits placement::params {
@ -49,6 +54,7 @@ class placement(
} }
placement_config { placement_config {
'DEFAULT/state_path' : value => $state_path;
'placement/randomize_allocation_candidates': value => $randomize_allocation_candidates; 'placement/randomize_allocation_candidates': value => $randomize_allocation_candidates;
'placement/allocation_conflict_retry_count': value => $allocation_conflict_retry_count; 'placement/allocation_conflict_retry_count': value => $allocation_conflict_retry_count;
} }

View File

@ -0,0 +1,5 @@
---
features:
- |
The new ``placemaner::state_path`` parameter has been added to specify
the directory for storing state.

View File

@ -30,6 +30,7 @@ describe 'placement' do
{ {
:ensure_package => 'absent', :ensure_package => 'absent',
:sync_db => false, :sync_db => false,
:state_path => '/var/lib/placement',
:randomize_allocation_candidates => true, :randomize_allocation_candidates => true,
:allocation_conflict_retry_count => 10, :allocation_conflict_retry_count => 10,
} }
@ -53,6 +54,7 @@ describe 'placement' do
:tag => ['openstack', 'placement-package'], :tag => ['openstack', 'placement-package'],
)} )}
it { should contain_placement_config('DEFAULT/state_path').with_value('/var/lib/placement') }
it { should contain_placement_config('placement/randomize_allocation_candidates').with_value(true) } it { should contain_placement_config('placement/randomize_allocation_candidates').with_value(true) }
it { should contain_placement_config('placement/allocation_conflict_retry_count').with_value(10) } it { should contain_placement_config('placement/allocation_conflict_retry_count').with_value(10) }
end end