supervisor.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---
  2. - name: install supervisor
  3. pip:
  4. name: supervisor
  5. - name: update setuptools
  6. pip:
  7. name: setuptools
  8. extra_args: -U
  9. - name: install php supervisor config
  10. template: src=supervisord.conf dest=/etc/supervisord.conf
  11. vars:
  12. supervisor_group: "{{ supervior_cassandra_vars }}"
  13. #include_vars: supervisor.yml
  14. when: inventory_hostname in groups['cassandra']
  15. - name: create supervisord log path
  16. file:
  17. path: /opt/supervisor_log
  18. state: directory
  19. mode: 0755
  20. - name: install supervisord service with EL6
  21. copy: src=supervisord.sh dest=/etc/init.d/supervisord.sh owner=root group=root mode=0755
  22. when: ansible_distribution == 'CentOS' and ansible_lsb.major_release|int < 7
  23. - name: supervisord service start with EL6
  24. shell: /etc/init.d/supervisord.sh restart
  25. when: ansible_distribution == 'CentOS' and ansible_lsb.major_release|int < 7
  26. - name: install supervisord service with EL7
  27. copy: src=supervisord.service dest=/usr/lib/systemd/system/supervisord.service owner=root group=root mode=0644
  28. when: ansible_distribution == 'CentOS' and ansible_lsb.major_release|int > 6
  29. - name: supervisord service start with EL7
  30. shell: systemctl enable supervisord;systemctl restart supervisord
  31. when: ansible_distribution == 'CentOS' and ansible_lsb.major_release|int > 6
  32. #- name: install supervisord service with Ubuntu14
  33. # copy: src=supervisord.sh dest=/etc/init.d/supervisord.sh owner=root group=root mode=0755
  34. # when: ansible_distribution == 'Ubuntu' and ansible_lsb.major_release|int > 13
  35. - name: supervisord service start with Ubuntu14
  36. shell: /usr/local/bin/supervisord -c /etc/supervisord.conf
  37. when: ansible_distribution == 'Ubuntu' and ansible_lsb.major_release|int > 13