For container enabled role, display warning only when not ANSIBLE_CONTAINER (#18717)

This commit is contained in:
Chris Houseknecht 2016-12-02 10:08:10 -05:00 committed by GitHub
parent a252d71573
commit 599e016315

View file

@ -212,8 +212,8 @@ class GalaxyRole(object):
if not role_data: if not role_data:
raise AnsibleError("- sorry, %s was not found on %s." % (self.src, api.api_server)) raise AnsibleError("- sorry, %s was not found on %s." % (self.src, api.api_server))
if role_data.get('role_type') == 'CON': if role_data.get('role_type') == 'CON' and not os.environ.get('ANSIBLE_CONTAINER'):
# Container Enabled # Container Enabled, running outside of a container
display.warning("%s is a Container Enabled role and should only be installed using " display.warning("%s is a Container Enabled role and should only be installed using "
"Ansible Container" % self.name) "Ansible Container" % self.name)