Ansible/roles/sensu.sensu/tasks/Ubuntu/redis.yml
James Tombleson b7facd7394 Role Adjustments
Added Sensu
Moved default role downloads to ./roles
Added unattended-upgrades
2019-04-29 07:08:11 -07:00

34 lines
985 B
YAML

---
# tasks/Ubuntu/redis.yml: Deploy redis
# Specific to Ubuntu
- name: Include ansible_distribution vars
include_vars:
file: "{{ ansible_distribution }}.yml"
- name: Ensure redis is installed
apt:
name: "{{ sensu_redis_pkg_name }}"
state: "{{ sensu_redis_pkg_state }}"
update_cache: true
register: sensu_ubuntu_redis_install
# BUG: On Ubuntu 14.04, when first installed, redis, will be started
# however, the /var/run/redis/redis-server.pid file gets lost during the restart
# causing the process to be orphaned from the init system.
# We manually stop it right after install to account for this.
- name: Stop redis manually
shell: kill $(pgrep redis-server)
when:
- sensu_ubuntu_redis_install is changed
- ansible_distribution_version == '14.04'
- name: Ensure redis binds to accessible IP
lineinfile:
dest: /etc/redis/redis.conf
regexp: '^bind'
line: 'bind 0.0.0.0'
notify: restart redis service
- meta: flush_handlers