diff --git a/awx/main/tasks.py b/awx/main/tasks.py index b0ffbd586d..f92a2c3070 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -772,8 +772,9 @@ class RunInventoryUpdate(BaseTask): ec2_opts = dict(inventory_source.source_vars_dict.items()) regions = inventory_source.source_regions or 'all' regions = ','.join([x.strip() for x in regions.split(',')]) + regions_blacklist = ','.join(settings.EC2_REGIONS_BLACKLIST) ec2_opts['regions'] = regions - ec2_opts.setdefault('regions_exclude', 'us-gov-west-1') + ec2_opts.setdefault('regions_exclude', regions_blacklist) ec2_opts.setdefault('destination_variable', 'public_dns_name') ec2_opts.setdefault('vpc_destination_variable', 'ip_address') ec2_opts.setdefault('route53', 'False') diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index b1d55bee11..1498d9ef27 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -325,6 +325,11 @@ EC2_REGION_NAMES = { 'us-gov-west-1': 'US West (GovCloud)', } +EC2_REGIONS_BLACKLIST = [ + 'us-gov-west-1', + 'cn-north-1', +] + # Internal API URL for use by inventory scripts and callback plugin. if 'devserver' in INSTALLED_APPS: INTERNAL_API_URL = 'http://127.0.0.1:%s' % DEVSERVER_DEFAULT_PORT