redis.yml 963 B

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