Skip to content

Commit

Permalink
[bugfix] introduce new handler Restart sensu services (#11)
Browse files Browse the repository at this point in the history
* [bugfix] introduce new handler Restart sensu services

fixes #10

the handler is intended to be called when all sensu services should be
restarted, such as when one of configuration files changes.

* QA

* [bugfix] restart sensu-client when patched

* [bugfix] add `listen` to existing one

instead of creating new one

* add OpenBSD 6.1, update boxes

* update meta
  • Loading branch information
Tomoyuki Sakurai authored Oct 5, 2017
1 parent 74733d4 commit 9f0aecb
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ platforms:
driver:
box: trombik/ansible-openbsd-6.0-amd64
box_check_update: false
box_version: 1.1.0
driver_config:
ssh:
shell: '/bin/sh'
provisioner:
extra_vars:
ansible_python_interpreter: '/usr/local/bin/python'

- name: openbsd-6.1-amd64
driver:
box: trombik/ansible-openbsd-6.1-amd64
box_check_update: false
box_version: 1.4.0
driver_config:
ssh:
shell: '/bin/sh'
Expand Down
1 change: 1 addition & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
service:
name: "{{ sensu_client_service }}"
state: restarted
listen: "Restart sensu services"
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ galaxy_info:
- name: OpenBSD
versions:
- 6.0
- 6.1
- name: Ubuntu
versions:
- trusty
Expand Down
2 changes: 2 additions & 0 deletions tasks/install-FreeBSD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
backup: yes
src: files/FreeBSD/patch-sensu-client
dest: /usr/local/etc/rc.d/sensu-client
notify: Restart sensu-client

- name: Get the path to "lib/sensu/transport/rabbitmq.rb"
shell: "{{ sensu_client_gem_binary }} content sensu-transport | grep 'lib/sensu/transport/rabbitmq.rb$'"
Expand All @@ -25,3 +26,4 @@
backup: yes
src: files/FreeBSD/patch_undefined_method_for_nilclass
dest: "{{ register_gem_content_sensu_transport.stdout }}"
notify: Restart sensu-client
1 change: 1 addition & 0 deletions tasks/install-OpenBSD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
src: OpenBSD.rc.j2
dest: /etc/rc.d/sensu_client
mode: 0555
validate: sh -n %s

- name: Create sensu_client_group
group:
Expand Down
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
src: config.json.j2
dest: "{{ sensu_client_config_file }}"
validate: "python -c 'import sys; import json; json.loads(open(sys.argv[1]).read())' %s"
notify: Restart sensu-client
notify: Restart sensu services


- name: Create sensu_client_log_dir
Expand All @@ -47,7 +47,7 @@
dest: "{{ sensu_client_conf_d_dir }}/{{ item }}.json"
validate: "python -c 'import sys; import json; json.loads(open(sys.argv[1]).read())' %s"
with_items: "{{ sensu_client_config_fragments.keys() }}"
notify: Restart sensu-client
notify: Restart sensu services

- include: "plugins.yml"

Expand Down

0 comments on commit 9f0aecb

Please sign in to comment.