Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve coverage of new service module #51

Merged
merged 2 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/icinga_service_apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
url_password: "{{ icinga_pass }}"
object_name: "SERVICE_dummy"
assign_filter: 'host.name="foohost"'
check_command: "hostalive"
check_command: hostalive
display_name: "dummy process"
imports:
- fooservicetemplate
Expand Down
11 changes: 3 additions & 8 deletions plugins/modules/icinga_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,9 @@ def main():
"volatile": module.params["volatile"],
}

try:
icinga_object = IcingaServiceObject(
module=module, path="/service", data=data
)
except Exception as e:
module.fail_json(
msg="unable to connect to Icinga. Exception message: %s" % e
)
icinga_object = IcingaServiceObject(
module=module, path="/service", data=data
)

changed, diff = icinga_object.update(module.params["state"])
module.exit_json(
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/icinga_service_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
url_password: "{{ icinga_pass }}"
object_name: "SERVICE_dummy"
assign_filter: 'host.name="foohost"'
check_command: hostalive
display_name: "dummy process"
imports:
- fooservicetemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
url_password: "{{ icinga_pass }}"
object_name: "SERVICE_dummy"
assign_filter: 'host.name="foohost"'
check_command: "hostalive"
check_command: hostalive
display_name: "dummy process"
groups:
- fooservicegroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
url_password: "{{ icinga_pass }}"
object_name: "SERVICE_dummy"
assign_filter: 'host.name="foohost"'
check_command: "hostalive"
check_command: hostalive
display_name: "dummy process"
imports:
- fooservicetemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
- wrong_pass_icinga_host.yml
- wrong_pass_icinga_service.yml

- absent_icinga_service.yml
- absent_icinga_host.yml
- absent_icinga_host_template.yml
- absent_icinga_hostgroup.yml
Expand All @@ -104,7 +105,6 @@
- absent_icinga_timeperiod.yml
- absent_icinga_command.yml
- absent_icinga_command_template.yml
- absent_icinga_service.yml

- name: deploy changes in icinga
tags: uri
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
url_password: "{{ icinga_pass }}"
object_name: "SERVICE_dummy"
assign_filter: 'host.name="foohost"'
check_command: "hostalive"
check_command: hostalive
display_name: "dummy process"
imports:
- fooservicetemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
url_password: iamwrong
object_name: "SERVICE_dummy"
assign_filter: 'host.name="foohost"'
check_command: "hostalive"
check_command: hostalive
display_name: "dummy process"
imports:
- fooservicetemplate
Expand Down
14 changes: 0 additions & 14 deletions tests/integration/targets/icinga/tasks/icinga_service.yml

This file was deleted.