Add playbook to stop and backup services
This commit is contained in:
parent
36c12a330f
commit
82c25edf8e
4 changed files with 62 additions and 15 deletions
playbooks/filter_plugins
|
@ -3,6 +3,7 @@ class FilterModule(object):
|
|||
return {
|
||||
'my_service_attributes': self.my_service_attributes,
|
||||
'services_to_dnscontrol': self.services_to_dnscontrol,
|
||||
'services_get_backups': self.services_get_backups,
|
||||
}
|
||||
|
||||
def my_service_attributes(self, services, host, attribute="name"):
|
||||
|
@ -23,6 +24,15 @@ class FilterModule(object):
|
|||
|
||||
return result
|
||||
|
||||
def services_get_backups(self, all_services, wanted_services):
|
||||
result = []
|
||||
for service in all_services:
|
||||
if service.get("name") in wanted_services:
|
||||
for backup in service.get("backup") or []:
|
||||
result.append(backup["name"])
|
||||
return result
|
||||
|
||||
|
||||
def services_to_dnscontrol(self, services):
|
||||
result = {}
|
||||
for service in services:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue