Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Commit

Permalink
sensu_go_check - idempotent test for cron check
Browse files Browse the repository at this point in the history
Signed-off-by: Jared Ledvina <jared@techsmix.net>
  • Loading branch information
jaredledvina committed Jun 19, 2019
1 parent 196a6e6 commit 81f17e9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions molecule/shared/modules/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
protocol: https
register: https_on_http
failed_when: https_on_http is not failed

- name: Ensure agent port fails
sensu_go_check:
name: check_test
Expand All @@ -20,6 +21,7 @@
validate_certs: False
register: agent_port
failed_when: agent_port is not failed

- name: Ensure unknown host fails
sensu_go_check:
name: check_test
Expand All @@ -29,6 +31,7 @@
host: what.is.this
register: unknown_host
failed_when: unknown_host is not failed

- name: Ensure bad password fails
sensu_go_check:
name: check_test
Expand All @@ -39,6 +42,7 @@
password: thisisnottherightpassword
register: bad_password
failed_when: bad_password is not failed

- name: Ensure nonexistant namespace fails
sensu_go_check:
name: check_test
Expand All @@ -49,6 +53,7 @@
namespace: thisdoesnotexist
register: bad_namespace
failed_when: bad_namespace is not failed

- name: Ensure interval and cron fails
sensu_go_check:
name: check_test
Expand All @@ -59,13 +64,15 @@
cron: "* * * * * *"
register: interval_and_cron
failed_when: interval_and_cron is not failed

- name: Ensure check_example is configured
sensu_go_check:
name: check_example
host: localhost
command: /bin/true
interval: 300
subscriptions: all

- name: Ensure check_example is already configured
sensu_go_check:
name: check_example
Expand All @@ -75,6 +82,23 @@
subscriptions: all
register: check_example_already_configured
failed_when: check_example_already_configured is changed

- name: Ensure check_cron_example is configured
sensu_go_check:
name: check_cron_example
host: localhost
command: /bin/true
cron: "* * * * * *"

- name: Ensure check_cron_example is already configured
sensu_go_check:
name: check_cron_example
host: localhost
command: /bin/true
cron: "* * * * * *"
register: check_cron_example
failed_when: check_cron_example is changed

- name: Ensure check_example is changed
sensu_go_check:
name: check_example
Expand All @@ -87,11 +111,13 @@
ansible_managed: "true"
ttl: 300
subscriptions: all

- name: Ensure check_example is absent
sensu_go_check:
name: check_example
host: localhost
state: absent

- name: Ensure check_example is already absent
sensu_go_check:
name: check_example
Expand Down

0 comments on commit 81f17e9

Please sign in to comment.