diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7042071..2052dab 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -138,4 +138,5 @@ 3.0.1: RD-5970 ansible plugin role installation 3.0.2: CYBL-1898 fix update venv workflow propositional argument and fix mis-match between plugin files. 3.1.0: RD-5392 Kerberos Support -3.1.1: Add missing configure task \ No newline at end of file +3.1.1: Add missing configure task +3.1.2: Ignore system default for ansible because Cloudify requires python 3. diff --git a/cloudify_ansible/tasks.py b/cloudify_ansible/tasks.py index 34a65bc..86c2d38 100644 --- a/cloudify_ansible/tasks.py +++ b/cloudify_ansible/tasks.py @@ -123,6 +123,7 @@ def run(playbook_args, ansible_env_vars, _ctx, **kwargs): _instance.runtime_properties[constants.WORKSPACE], 'ansible.cfg') } + os.environ['CTX_NODE_INSTANCE_ID'] = _instance.id if 'KRB5_CONFIG' in _instance.runtime_properties: os.environ['KRB5_CONFIG'] = _instance.runtime_properties['KRB5_CONFIG'] @@ -132,6 +133,16 @@ def run(playbook_args, ansible_env_vars, _ctx, **kwargs): } ) + playbook_env = _instance.runtime_properties.get('playbook_env') + if playbook_env and 'ANSIBLE_PYTHON_INTERPRETER' not in \ + playbook_args['environment_variables']: + playbook_args['environment_variables'].update( + { + 'ANSIBLE_PYTHON_INTERPRETER': os.path.join( + playbook_env, 'bin/python') + } + ) + secure_log_playbook_args(_ctx, playbook_args) playbook = AnsiblePlaybookFromFile(**playbook_args) # check if ansible_playbook_executable_path was provided @@ -277,6 +288,15 @@ def store_facts(playbook_args, ansible_env_vars, _ctx, **kwargs): 'CTX_NODE_INSTANCE_ID': _instance.id, } os.environ['CTX_NODE_INSTANCE_ID'] = _instance.id + playbook_env = _instance.runtime_properties.get('playbook_env') + if playbook_env and 'ANSIBLE_PYTHON_INTERPRETER' not in \ + playbook_args['environment_variables']: + playbook_args['environment_variables'].update( + { + 'ANSIBLE_PYTHON_INTERPRETER': os.path.join( + playbook_env, 'bin/python') + } + ) _store_facts( playbook, ansible_env_vars, diff --git a/plugin.yaml b/plugin.yaml index ce71ca8..40de9ae 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -3,7 +3,7 @@ plugins: ansible: executor: central_deployment_agent package_name: cloudify-ansible-plugin - package_version: '3.1.1' + package_version: '3.1.2' dsl_definitions: diff --git a/plugin_1_4.yaml b/plugin_1_4.yaml index d988f1b..c01282a 100644 --- a/plugin_1_4.yaml +++ b/plugin_1_4.yaml @@ -3,7 +3,7 @@ plugins: ansible: executor: central_deployment_agent package_name: cloudify-ansible-plugin - package_version: '3.1.1' + package_version: '3.1.2' dsl_definitions: diff --git a/v2_plugin.yaml b/v2_plugin.yaml index 80f2cd8..d8b1a7e 100644 --- a/v2_plugin.yaml +++ b/v2_plugin.yaml @@ -3,7 +3,7 @@ plugins: ansible: executor: central_deployment_agent package_name: cloudify-ansible-plugin - package_version: '3.1.1' + package_version: '3.1.2' dsl_definitions: