Created
December 21, 2014 14:30
-
-
Save s0enke/d39872d282b4c262c56a to your computer and use it in GitHub Desktop.
Skeleton of an Ansible module for ElastiCache replication groups
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import os | |
import time | |
try: | |
import boto | |
from boto.elasticache.layer1 import ElastiCacheConnection | |
from boto.regioninfo import RegionInfo | |
except ImportError: | |
print "failed=True msg='boto required for this module'" | |
sys.exit(1) | |
class ElastiCacheReplicationGroupManager(object): | |
def __init__(self): | |
pass | |
def main(): | |
argument_spec = ec2_argument_spec() | |
# TODO: | |
# Implement: | |
# - cache_security_group_names | |
# - preferred_maintenance_window | |
# - notification_topic_arn | |
# - notification_topic_status | |
# - apply_immediately | |
# - engine_version | |
# - auto_minor_version_upgrade | |
# - primary_cluster_id| | |
argument_spec.update(dict( | |
state={'required': True, 'choices': ['present', 'absent', 'rebooted']}, | |
name={'required': True}, | |
primary_cluster_id={'required': False}, | |
replication_group_description={'required': False}, | |
security_group_ids={'required': False, 'default': [], | |
'type': 'list'}, | |
engine_version={'required': False, 'default': '1.4.14'}, | |
cache_parameter_group_name={'required': False}, | |
) | |
) | |
module = AnsibleModule( | |
argument_spec=argument_spec, | |
) | |
facts_result = dict(changed=False, | |
elasticache_replication_group=None) | |
module.exit_json(**facts_result) | |
# import module snippets | |
from ansible.module_utils.basic import * | |
from ansible.module_utils.ec2 import * | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment