diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py index 87f36f4f1d..abc8136243 100644 --- a/lib/ansible/cli/galaxy.py +++ b/lib/ansible/cli/galaxy.py @@ -129,11 +129,11 @@ class GalaxyCLI(CLI): 'The default is the roles_path configured in your ' 'ansible.cfg file (/etc/ansible/roles if not configured)') - if self.action in ("import","info","init","install","login","search","setup","delete"): - self.parser.add_option('-s', '--server', dest='api_server', default=C.GALAXY_SERVER, - help='The API server destination') - self.parser.add_option('-c', '--ignore-certs', action='store_true', dest='ignore_certs', default=False, - help='Ignore SSL certificate validation errors.') + self.parser.add_option('-s', '--server', dest='api_server', default=C.GALAXY_SERVER, + help='The API server destination') + + self.parser.add_option('-c', '--ignore-certs', action='store_true', dest='ignore_certs', default=C.GALAXY_IGNORE_CERTS, + help='Ignore SSL certificate validation errors.') if self.action in ("init","install"): self.parser.add_option('-f', '--force', dest='force', action='store_true', default=False, diff --git a/lib/ansible/galaxy/api.py b/lib/ansible/galaxy/api.py index b426822d39..f1acc1b621 100644 --- a/lib/ansible/galaxy/api.py +++ b/lib/ansible/galaxy/api.py @@ -65,14 +65,11 @@ class GalaxyAPI(object): self.galaxy = galaxy self.token = GalaxyToken() self._api_server = C.GALAXY_SERVER - self._validate_certs = not C.GALAXY_IGNORE_CERTS + self._validate_certs = not galaxy.options.ignore_certs self.baseurl = None self.version = None self.initialized = False - # set validate_certs - if galaxy.options.ignore_certs: - self._validate_certs = False display.vvv('Validate TLS certificates: %s' % self._validate_certs) # set the API server diff --git a/lib/ansible/galaxy/role.py b/lib/ansible/galaxy/role.py index b5a62c5905..5c6504630e 100644 --- a/lib/ansible/galaxy/role.py +++ b/lib/ansible/galaxy/role.py @@ -54,12 +54,8 @@ class GalaxyRole(object): self._metadata = None self._install_info = None + self._validate_certs = not galaxy.options.ignore_certs - self._validate_certs = not C.GALAXY_IGNORE_CERTS - - # set validate_certs - if galaxy.options.ignore_certs: - self._validate_certs = False display.vvv('Validate TLS certificates: %s' % self._validate_certs) self.options = galaxy.options