summaryrefslogtreecommitdiff
path: root/lib/ansible/galaxy
diff options
context:
space:
mode:
authorChris Houseknecht <chouseknecht@ansible.com>2016-12-02 10:08:10 -0500
committerGitHub <noreply@github.com>2016-12-02 10:08:10 -0500
commit599e016315bd08a7abd11952343825bae90dfe14 (patch)
treef092eda5b8a774c58752792c4ee137f8143679e7 /lib/ansible/galaxy
parenta252d71573ca7adaae1b0a5a9c915e398242007d (diff)
downloadansible-599e016315bd08a7abd11952343825bae90dfe14.tar.gz
For container enabled role, display warning only when not ANSIBLE_CONTAINER (#18717)
Diffstat (limited to 'lib/ansible/galaxy')
-rw-r--r--lib/ansible/galaxy/role.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/galaxy/role.py b/lib/ansible/galaxy/role.py
index a375210172..a3498c5e64 100644
--- a/lib/ansible/galaxy/role.py
+++ b/lib/ansible/galaxy/role.py
@@ -212,8 +212,8 @@ class GalaxyRole(object):
if not role_data:
raise AnsibleError("- sorry, %s was not found on %s." % (self.src, api.api_server))
- if role_data.get('role_type') == 'CON':
- # Container Enabled
+ if role_data.get('role_type') == 'CON' and not os.environ.get('ANSIBLE_CONTAINER'):
+ # Container Enabled, running outside of a container
display.warning("%s is a Container Enabled role and should only be installed using "
"Ansible Container" % self.name)