redis.yml 967 B

12345678910111213141516171819202122232425262728293031
  1. ---
  2. # tasks/Ubuntu/redis.yml: Deploy redis
  3. # Specific to Ubuntu
  4. - include_vars: "{{ ansible_distribution }}.yml"
  5. - name: Ensure redis is installed
  6. apt:
  7. name: "{{ redis_pkg_name }}"
  8. state: "{{ redis_pkg_state }}"
  9. update_cache: true
  10. register: sensu_ubuntu_redis_install
  11. # BUG: On Ubuntu 14.04, when first installed, redis, will be started
  12. # however, the /var/run/redis/redis-server.pid file gets lost during the restart
  13. # causing the process to be orphaned from the init system.
  14. # We manually stop it right after install to account for this.
  15. - name: Stop redis manually
  16. shell: kill $(pgrep redis-server)
  17. when:
  18. - sensu_ubuntu_redis_install is changed
  19. - ansible_distribution_version == '14.04'
  20. - name: Ensure redis binds to accessible IP
  21. lineinfile:
  22. dest: /etc/redis/redis.conf
  23. regexp: '^bind'
  24. line: 'bind 0.0.0.0'
  25. notify: restart redis service
  26. - meta: flush_handlers