Skip to content
Snippets Groups Projects
Commit 2a9288b9 authored by jurgenhaas's avatar jurgenhaas
Browse files

Implement a read-only mode

parent 16d00a2f
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ There are plugin parameters to define how the plugin will behave:
**force** (optional, defaults to False): If an object already exists whether it should be updated
**cache** (optional, defaults to None): Fully qualified filename for a cache of der Server Density data
**cleanup** (optional, defaults to False): Decides if undefined alerts in your Ansible inventory available at Server Density should be deleted
**readonly** (optional, defaults to False): If set to True it will only read the current settings from SD and stores them in a temporary file and does nothing else. This is useful when you want to find out some variable names for alerts or similar things
##Installation##
......
......@@ -44,11 +44,21 @@ class ActionModule(object):
self.force_update = args.get('force', False)
self.cache_file_name = args.get('cache', None)
cleanup = args.get('cleanup', False)
just_download = args.get('readonly', False)
if just_download:
self.force_update = False
self.cache_file_name = os.tmpnam()
cleanup = False
result = {}
self.list_all()
if just_download:
vv('Downloaded settings to %s' % self.cache_file_name)
return
services = {}
devicegroup_alerts = {}
servicegroup_alerts = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment