Merge "Add default_python_interpreter parameter to ansible manifest"

This commit is contained in:
Zuul 2019-03-19 16:55:14 +00:00 committed by Gerrit Code Review
commit 639f42d839
3 changed files with 14 additions and 1 deletions

View File

@ -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',

View File

@ -0,0 +1,5 @@
---
features:
- |
Allow configuring the ``default_python_interpreter`` parameter for the
ansible deploy interface in the ``ironic::drivers::ansible`` manifest.

View File

@ -37,6 +37,7 @@ describe 'ironic::drivers::ansible' do
is_expected.to contain_ironic_config('ansible/default_shutdown_playbook').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('ansible/default_clean_playbook').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('ansible/default_clean_steps_config').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('ansible/default_python_interpreter').with_value('<SERVICE DEFAULT>')
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