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

Commit

Permalink
Sensu: Ensure we initialize the backend w/ the normal defaults
Browse files Browse the repository at this point in the history
Signed-off-by: Jared Ledvina <[email protected]>
  • Loading branch information
jaredledvina committed Mar 29, 2020
1 parent fe38cd6 commit 354081e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ sensu_go_configs:
- ws://127.0.0.1:8081
cache-dir: /var/cache/sensu/sensu-agent

sensu_go_backend_init_admin_username: admin
sensu_go_backend_init_admin_password: P@ssw0rd!

sensu_go_services_override: {}
sensu_go_services:
backend:
Expand Down
10 changes: 10 additions & 0 deletions tasks/service/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@
when:
- sensu_go_services.backend.state == 'started'
- sensu_go_backend_service_state is changed

- name: Ensure sensu-backend is initialized
command:
cmd: sensu-backend init
environment:
SENSU_BACKEND_CLUSTER_ADMIN_USERNAME: "{{ sensu_go_backend_init_admin_username }}"
SENSU_BACKEND_CLUSTER_ADMIN_PASSWORD: "{{ sensu_go_backend_init_admin_password }}"
register: sensu_backend_init_result
failed_when: sensu_backend_init_result.rc not in (0, 3)
changed_when: sensu_backend_init_result.rc == 0

0 comments on commit 354081e

Please sign in to comment.