Merge pull request #2078 from john-westcott-iv/2073_no_galaxy

#2073 - Support setting to prevent Tower from pulling roles
This commit is contained in:
Matthew Jones 2018-07-24 12:01:18 -04:00 committed by GitHub
commit 74123647fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 1 deletions

View File

@ -277,6 +277,16 @@ register(
placeholder={'HTTP_PROXY': 'myproxy.local:8080'},
)
register(
'AWX_ROLES_ENABLED',
field_class=fields.BooleanField,
default=True,
label=_('Enable Role Download'),
help_text=_('Allows roles to be dynamically downlaoded from a requirements.yml file for SCM projects.'),
category=_('Jobs'),
category_slug='jobs',
)
register(
'STDOUT_MAX_BYTES_DISPLAY',
field_class=fields.IntegerField,

View File

@ -1521,6 +1521,7 @@ class RunProjectUpdate(BaseTask):
'scm_full_checkout': True if project_update.job_type == 'run' else False,
'scm_revision_output': self.revision_path,
'scm_revision': project_update.project.scm_revision,
'roles_enabled': getattr(settings, 'AWX_ROLES_ENABLED', True)
})
extra_vars_path = self.build_extra_vars_file(vars=extra_vars, **kwargs)
args.extend(['-e', '@%s' % (extra_vars_path)])

View File

@ -13,6 +13,7 @@
# scm_accept_hostkey: true/false (only for git, set automatically)
# scm_revision: current revision in tower
# scm_revision_output: where to store gathered revision (temporary file)
# roles_enabled: Allow us to pull roles from a requirements.yml file
- hosts: all
connection: local
@ -152,4 +153,4 @@
chdir: "{{project_path|quote}}/roles"
when: doesRequirementsExist.stat.exists and scm_result is defined
when: scm_full_checkout|bool
when: scm_full_checkout|bool and roles_enabled|bool

View File

@ -649,6 +649,11 @@ AWX_REBUILD_SMART_MEMBERSHIP = False
# By default, allow arbitrary Jinja templating in extra_vars defined on a Job Template
ALLOW_JINJA_IN_EXTRA_VARS = 'template'
# Enable dynamically pulling roles from a requirement.yml file
# when updating SCM projects
# Note: This setting may be overridden by database settings.
AWX_ROLES_ENABLED = True
# Enable bubblewrap support for running jobs (playbook runs only).
# Note: This setting may be overridden by database settings.
AWX_PROOT_ENABLED = True

View File

@ -77,6 +77,11 @@ CELERYD_LOG_COLOR = True
CALLBACK_QUEUE = "callback_tasks"
# Enable dynamically pulling roles from a requirement.yml file
# when updating SCM projects
# Note: This setting may be overridden by database settings.
AWX_ROLES_ENABLED = True
# Enable PROOT for tower-qa integration tests.
# Note: This setting may be overridden by database settings.
AWX_PROOT_ENABLED = True

View File

@ -58,6 +58,9 @@ export default ['i18n', function(i18n) {
type: 'text',
reset: 'ANSIBLE_FACT_CACHE_TIMEOUT',
},
AWX_ROLES_ENABLED: {
type: 'toggleSwitch',
},
AWX_TASK_ENV: {
type: 'textarea',
reset: 'AWX_TASK_ENV',