From fdd8011284d0a2f5c7088a39513eada159fd5208 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 4 Aug 2020 10:55:47 +0900 Subject: [PATCH] Add support for the state_path parameter Change-Id: I42506c1c4395f547691b7d527329ffefd6bea3d9 --- manifests/init.pp | 6 ++++++ releasenotes/notes/state_path-d656b10e4ad97f39.yaml | 5 +++++ spec/classes/placement_init_spec.rb | 2 ++ 3 files changed, 13 insertions(+) create mode 100644 releasenotes/notes/state_path-d656b10e4ad97f39.yaml diff --git a/manifests/init.pp b/manifests/init.pp index ce7f5a9..e809aa2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -12,6 +12,10 @@ # (Optional) Run db sync on the node. # Defaults to true # +# [*state_path*] +# (optional) Directory for storing state. +# Defaults to $::os_service_default +# # [*randomize_allocation_candidates*] # (Optional) Randomize the results of the returned # allocation candidates. @@ -25,6 +29,7 @@ class placement( $ensure_package = 'present', $sync_db = true, + $state_path = $::os_service_default, $randomize_allocation_candidates = $::os_service_default, $allocation_conflict_retry_count = $::os_service_default, ) inherits placement::params { @@ -49,6 +54,7 @@ class placement( } placement_config { + 'DEFAULT/state_path' : value => $state_path; 'placement/randomize_allocation_candidates': value => $randomize_allocation_candidates; 'placement/allocation_conflict_retry_count': value => $allocation_conflict_retry_count; } diff --git a/releasenotes/notes/state_path-d656b10e4ad97f39.yaml b/releasenotes/notes/state_path-d656b10e4ad97f39.yaml new file mode 100644 index 0000000..0968ea0 --- /dev/null +++ b/releasenotes/notes/state_path-d656b10e4ad97f39.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``placemaner::state_path`` parameter has been added to specify + the directory for storing state. diff --git a/spec/classes/placement_init_spec.rb b/spec/classes/placement_init_spec.rb index 901e2dd..532f209 100644 --- a/spec/classes/placement_init_spec.rb +++ b/spec/classes/placement_init_spec.rb @@ -30,6 +30,7 @@ describe 'placement' do { :ensure_package => 'absent', :sync_db => false, + :state_path => '/var/lib/placement', :randomize_allocation_candidates => true, :allocation_conflict_retry_count => 10, } @@ -53,6 +54,7 @@ describe 'placement' do :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/allocation_conflict_retry_count').with_value(10) } end