diff --git a/manifests/init.pp b/manifests/init.pp index d0013b00..7b511962 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -29,6 +29,10 @@ # (optional) The state of the package # Defaults to 'present' # +# [*host*] +# (optional) Name of this node. +# Defaults to $facts['os_service_default']. +# # [*my_ip*] # (optional) IP address of this host. # If unset, will determine the IP programmatically. If unable to do so, will use @@ -215,6 +219,7 @@ class ironic ( Boolean $enabled = true, $package_ensure = 'present', + $host = $facts['os_service_default'], $my_ip = $facts['os_service_default'], $my_ipv6 = $facts['os_service_default'], $auth_strategy = 'keystone', @@ -279,6 +284,7 @@ class ironic ( ironic_config { 'DEFAULT/auth_strategy': value => $auth_strategy; + 'DEFAULT/host': value => $host; 'DEFAULT/my_ip': value => $my_ip; 'DEFAULT/my_ipv6': value => $my_ipv6; 'DEFAULT/default_resource_class': value => $default_resource_class; diff --git a/releasenotes/notes/host-opt-df3665183e207085.yaml b/releasenotes/notes/host-opt-df3665183e207085.yaml new file mode 100644 index 00000000..62a9ce0b --- /dev/null +++ b/releasenotes/notes/host-opt-df3665183e207085.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The new ``ironic::host`` parameter has been added. diff --git a/spec/classes/ironic_init_spec.rb b/spec/classes/ironic_init_spec.rb index 1648c146..4d8773a8 100644 --- a/spec/classes/ironic_init_spec.rb +++ b/spec/classes/ironic_init_spec.rb @@ -63,6 +63,7 @@ describe 'ironic' do it 'configures ironic.conf' do is_expected.to contain_ironic_config('DEFAULT/auth_strategy').with_value('keystone') + is_expected.to contain_ironic_config('DEFAULT/host').with_value('') is_expected.to contain_ironic_config('DEFAULT/my_ip').with_value('') is_expected.to contain_ironic_config('DEFAULT/my_ipv6').with_value('') is_expected.to contain_ironic_config('DEFAULT/default_resource_class').with_value('') @@ -108,6 +109,7 @@ describe 'ironic' do context 'with parameters' do let :params do { + :host => 'host.example.com', :my_ip => '127.0.0.1', :my_ipv6 => '::1', :default_resource_class => 'myclass', @@ -144,6 +146,7 @@ describe 'ironic' do it 'configures ironic.conf' do is_expected.to contain_ironic_config('DEFAULT/auth_strategy').with_value('keystone') + is_expected.to contain_ironic_config('DEFAULT/host').with_value('host.example.com') is_expected.to contain_ironic_config('DEFAULT/my_ip').with_value('127.0.0.1') is_expected.to contain_ironic_config('DEFAULT/my_ipv6').with_value('::1') is_expected.to contain_ironic_config('DEFAULT/default_resource_class').with_value('myclass')