Merge pull request #10097 from sean-m-sullivan/devel

add custom_venv for backward compatibility

SUMMARY
As per #10055 , this is the proposal to add back custom virtual environments to the modules. With the understanding that they will not be tested. But to allow users of Ansible Tower 3.8 the ability to use newer features and bugfixes in awx.awx as applicable, without restorting to backporting these removals. Would expect these to remain for a time after Tower moves to Execution environments as teams/companies adopt the next version of tower.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

awx_collection

AWX VERSION
19.1.0

Reviewed-by: Alan Rominger <arominge@redhat.com>
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
This commit is contained in:
softwarefactory-project-zuul[bot]
2021-05-07 17:19:24 +00:00
committed by GitHub
4 changed files with 34 additions and 0 deletions

View File

@@ -72,6 +72,12 @@ options:
description: description:
- Execution Environment to use for the source. - Execution Environment to use for the source.
type: str type: str
custom_virtualenv:
description:
- Local absolute file path containing a custom Python virtualenv to use.
- Only compatible with older versions of AWX/Tower
- Deprecated, will be removed in the future
type: str
overwrite: overwrite:
description: description:
- Delete child groups and hosts not found in source. - Delete child groups and hosts not found in source.
@@ -166,6 +172,7 @@ def main():
host_filter=dict(), host_filter=dict(),
credential=dict(), credential=dict(),
execution_environment=dict(), execution_environment=dict(),
custom_virtualenv=dict(),
organization=dict(), organization=dict(),
overwrite=dict(type='bool'), overwrite=dict(type='bool'),
overwrite_vars=dict(type='bool'), overwrite_vars=dict(type='bool'),
@@ -258,6 +265,7 @@ def main():
'source_vars', 'source_vars',
'overwrite', 'overwrite',
'overwrite_vars', 'overwrite_vars',
'custom_virtualenv',
'timeout', 'timeout',
'verbosity', 'verbosity',
'update_on_launch', 'update_on_launch',

View File

@@ -86,6 +86,12 @@ options:
description: description:
- Execution Environment to use for the JT. - Execution Environment to use for the JT.
type: str type: str
custom_virtualenv:
description:
- Local absolute file path containing a custom Python virtualenv to use.
- Only compatible with older versions of AWX/Tower
- Deprecated, will be removed in the future
type: str
instance_groups: instance_groups:
description: description:
- list of Instance Groups for this Organization to run on. - list of Instance Groups for this Organization to run on.
@@ -371,6 +377,7 @@ def main():
vault_credential=dict(), vault_credential=dict(),
credentials=dict(type='list', elements='str'), credentials=dict(type='list', elements='str'),
execution_environment=dict(), execution_environment=dict(),
custom_virtualenv=dict(),
instance_groups=dict(type="list", elements='str'), instance_groups=dict(type="list", elements='str'),
forks=dict(type='int'), forks=dict(type='int'),
limit=dict(), limit=dict(),
@@ -495,6 +502,7 @@ def main():
'become_enabled', 'become_enabled',
'diff_mode', 'diff_mode',
'allow_simultaneous', 'allow_simultaneous',
'custom_virtualenv',
'job_slice_count', 'job_slice_count',
'webhook_service', 'webhook_service',
): ):

View File

@@ -34,6 +34,12 @@ options:
description: description:
- Default Execution Environment to use for jobs owned by the Organization. - Default Execution Environment to use for jobs owned by the Organization.
type: str type: str
custom_virtualenv:
description:
- Local absolute file path containing a custom Python virtualenv to use.
- Only compatible with older versions of AWX/Tower
- Deprecated, will be removed in the future
type: str
max_hosts: max_hosts:
description: description:
- The max hosts allowed in this organizations - The max hosts allowed in this organizations
@@ -112,6 +118,7 @@ def main():
name=dict(required=True), name=dict(required=True),
description=dict(), description=dict(),
default_environment=dict(), default_environment=dict(),
custom_virtualenv=dict(),
max_hosts=dict(type='int', default="0"), max_hosts=dict(type='int', default="0"),
instance_groups=dict(type="list", elements='str'), instance_groups=dict(type="list", elements='str'),
notification_templates_started=dict(type="list", elements='str'), notification_templates_started=dict(type="list", elements='str'),
@@ -129,6 +136,7 @@ def main():
name = module.params.get('name') name = module.params.get('name')
description = module.params.get('description') description = module.params.get('description')
default_ee = module.params.get('default_environment') default_ee = module.params.get('default_environment')
custom_virtualenv = module.params.get('custom_virtualenv')
max_hosts = module.params.get('max_hosts') max_hosts = module.params.get('max_hosts')
state = module.params.get('state') state = module.params.get('state')
@@ -183,6 +191,8 @@ def main():
org_fields['description'] = description org_fields['description'] = description
if default_ee is not None: if default_ee is not None:
org_fields['default_environment'] = module.resolve_name_to_id('execution_environments', default_ee) org_fields['default_environment'] = module.resolve_name_to_id('execution_environments', default_ee)
if custom_virtualenv is not None:
org_fields['custom_virtualenv'] = custom_virtualenv
if max_hosts is not None: if max_hosts is not None:
org_fields['max_hosts'] = max_hosts org_fields['max_hosts'] = max_hosts

View File

@@ -113,6 +113,12 @@ options:
description: description:
- Default Execution Environment to use for jobs relating to the project. - Default Execution Environment to use for jobs relating to the project.
type: str type: str
custom_virtualenv:
description:
- Local absolute file path containing a custom Python virtualenv to use.
- Only compatible with older versions of AWX/Tower
- Deprecated, will be removed in the future
type: str
organization: organization:
description: description:
- Name of organization for project. - Name of organization for project.
@@ -262,6 +268,7 @@ def main():
allow_override=dict(type='bool', aliases=['scm_allow_override']), allow_override=dict(type='bool', aliases=['scm_allow_override']),
timeout=dict(type='int', default=0, aliases=['job_timeout']), timeout=dict(type='int', default=0, aliases=['job_timeout']),
default_environment=dict(), default_environment=dict(),
custom_virtualenv=dict(),
organization=dict(), organization=dict(),
notification_templates_started=dict(type="list", elements='str'), notification_templates_started=dict(type="list", elements='str'),
notification_templates_success=dict(type="list", elements='str'), notification_templates_success=dict(type="list", elements='str'),
@@ -286,6 +293,7 @@ def main():
scm_update_on_launch = module.params.get('scm_update_on_launch') scm_update_on_launch = module.params.get('scm_update_on_launch')
scm_update_cache_timeout = module.params.get('scm_update_cache_timeout') scm_update_cache_timeout = module.params.get('scm_update_cache_timeout')
default_ee = module.params.get('default_environment') default_ee = module.params.get('default_environment')
custom_virtualenv = module.params.get('custom_virtualenv')
organization = module.params.get('organization') organization = module.params.get('organization')
state = module.params.get('state') state = module.params.get('state')
wait = module.params.get('wait') wait = module.params.get('wait')