Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Skeleton of an Ansible module for ElastiCache replication groups
#!/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
You can’t perform that action at this time.