diff --git a/lib/ansible/plugins/callback/slack.py b/lib/ansible/plugins/callback/slack.py index 575a1112c6..9fc406fd34 100644 --- a/lib/ansible/plugins/callback/slack.py +++ b/lib/ansible/plugins/callback/slack.py @@ -23,7 +23,10 @@ import json import os import uuid -from __main__ import cli +try: + from __main__ import cli +except ImportError: + cli = None from ansible.constants import mk_boolean from ansible.module_utils.urls import open_url