Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1548 #1549

Merged
merged 4 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions IM/ansible_utils/ansible_executor_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,13 @@ def run(self):
# Create a specific dir for the local temp
C.DEFAULT_LOCAL_TMP = tempfile.mkdtemp()

try:
# Initialize the plugin loader for ansible 2.15.0 or higher
from ansible.plugins.loader import init_plugin_loader
init_plugin_loader([])
except ImportError:
pass

result = 0
try:
pb = Playbook.load(self._playbook, variable_manager=self._variable_manager, loader=self._loader)
Expand Down
4 changes: 2 additions & 2 deletions contextualization/conf-ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@

- name: Set Ansible newer version for python 3.12
set_fact:
ANSIBLE_VERSION: 6.7.0
ANSIBLE_VERSION: 8.7.0
when:
- ansible_python_version is version('3.12', '>=')
- ANSIBLE_VERSION is version('6.7.0', '<')
- ANSIBLE_VERSION is version('8.7.0', '<')

- name: Install ansible {{ ANSIBLE_VERSION }} with Pip
pip:
Expand Down