diff --git a/manifests/drivers/ansible.pp b/manifests/drivers/ansible.pp index 3a423df2..f5e0c460 100644 --- a/manifests/drivers/ansible.pp +++ b/manifests/drivers/ansible.pp @@ -62,6 +62,9 @@ # cleaning. # Defaults to $::os_service_default # +# [*default_python_interpreter*] +# (optional) Absolute path to the python interpreter on the managed machines. +# Defaults to $::os_service_default class ironic::drivers::ansible ( $package_ensure = 'present', @@ -75,6 +78,7 @@ class ironic::drivers::ansible ( $default_shutdown_playbook = $::os_service_default, $default_clean_playbook = $::os_service_default, $default_clean_steps_config = $::os_service_default, + $default_python_interpreter = $::os_service_default, ) { include ::ironic::deps @@ -92,6 +96,7 @@ class ironic::drivers::ansible ( 'ansible/default_shutdown_playbook': value => $default_shutdown_playbook; 'ansible/default_clean_playbook': value => $default_clean_playbook; 'ansible/default_clean_steps_config': value => $default_clean_steps_config; + 'ansible/default_python_interpreter': value => $default_python_interpreter; } ensure_packages('ansible', diff --git a/releasenotes/notes/add-ansible-python-interpreter-fedc6fbdc4839f70.yaml b/releasenotes/notes/add-ansible-python-interpreter-fedc6fbdc4839f70.yaml new file mode 100644 index 00000000..5f96c075 --- /dev/null +++ b/releasenotes/notes/add-ansible-python-interpreter-fedc6fbdc4839f70.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Allow configuring the ``default_python_interpreter`` parameter for the + ansible deploy interface in the ``ironic::drivers::ansible`` manifest. \ No newline at end of file diff --git a/spec/classes/ironic_drivers_ansible_spec.rb b/spec/classes/ironic_drivers_ansible_spec.rb index e2fc36cf..c69d0cd0 100644 --- a/spec/classes/ironic_drivers_ansible_spec.rb +++ b/spec/classes/ironic_drivers_ansible_spec.rb @@ -37,6 +37,7 @@ describe 'ironic::drivers::ansible' do is_expected.to contain_ironic_config('ansible/default_shutdown_playbook').with_value('') is_expected.to contain_ironic_config('ansible/default_clean_playbook').with_value('') is_expected.to contain_ironic_config('ansible/default_clean_steps_config').with_value('') + is_expected.to contain_ironic_config('ansible/default_python_interpreter').with_value('') end it 'installs ansible package' do @@ -63,7 +64,8 @@ describe 'ironic::drivers::ansible' do :default_deploy_playbook => 'deploy-extra.yaml', :default_shutdown_playbook => 'shutdown-extra.yaml', :default_clean_playbook => 'clean-extra.yaml', - :default_clean_steps_config => 'custom-clean-steps.yaml') + :default_clean_steps_config => 'custom-clean-steps.yaml', + :default_python_interpreter => '/usr/bin/python3') end it 'should replace default parameter with new value' do is_expected.to contain_ironic_config('ansible/ansible_extra_args').with_value(p[:ansible_extra_args]) @@ -76,6 +78,7 @@ describe 'ironic::drivers::ansible' do is_expected.to contain_ironic_config('ansible/default_shutdown_playbook').with_value(p[:default_shutdown_playbook]) is_expected.to contain_ironic_config('ansible/default_clean_playbook').with_value(p[:default_clean_playbook]) is_expected.to contain_ironic_config('ansible/default_clean_steps_config').with_value(p[:default_clean_steps_config]) + is_expected.to contain_ironic_config('ansible/default_python_interpreter').with_value(p[:default_python_interpreter]) end end