main.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. ---
  2. - name: install apt packages
  3. apt:
  4. pkg: "{{ item }}"
  5. update_cache: yes
  6. state: installed
  7. with_items:
  8. - python
  9. - python-pip
  10. - python-dev
  11. - uwsgi
  12. - uwsgi-plugin-python
  13. - libffi-dev
  14. notify:
  15. - restart carbon-cache
  16. - name: install django
  17. pip:
  18. name: django
  19. version: 1.8.11
  20. state: present
  21. notify:
  22. - restart uwsgi
  23. - name: install requirements for graphite-web
  24. pip:
  25. name: "{{ item }}"
  26. state: present
  27. with_items:
  28. - python-memcached
  29. - txAMQP
  30. - simplejson
  31. - django-tagging
  32. - gunicorn
  33. - pytz
  34. - sphinx
  35. - sphinx_rtd_theme
  36. - cairocffi
  37. - whitenoise
  38. notify:
  39. - restart uwsgi
  40. - name: install zope.interface
  41. pip:
  42. name: zope.interface
  43. version: 3.6.0
  44. state: present
  45. notify:
  46. - restart carbon-cache
  47. - name: install whisper
  48. pip:
  49. name: whisper
  50. version: 0.9.15
  51. state: present
  52. extra_args: '--install-option="--prefix=/var/lib/graphite" --install-option="--install-lib=/var/lib/graphite/lib" '
  53. notify:
  54. - restart carbon-cache
  55. - name: install carbon
  56. pip:
  57. name: carbon
  58. version: 0.9.15
  59. state: present
  60. extra_args: '--install-option="--prefix=/var/lib/graphite" --install-option="--install-lib=/var/lib/graphite/lib" '
  61. notify:
  62. - restart carbon-cache
  63. - name: install graphite-web
  64. pip:
  65. name: graphite-web
  66. version: 0.9.15
  67. state: present
  68. extra_args: '--install-option="--prefix=/var/lib/graphite" --install-option="--install-lib=/var/lib/graphite/lib" '
  69. notify:
  70. - restart carbon-cache
  71. - name: create log directory
  72. file: path=/var/log/carbon state=directory mode=0755 owner=www-data
  73. - name: create log directory
  74. file: path=/var/log/graphite state=directory mode=0755 owner=www-data
  75. - name: create storage directory
  76. file: path=/var/lib/graphite/storage state=directory mode=0755 owner=www-data
  77. - name: create run directory
  78. file: path=/var/run/carbon-cache state=directory mode=0755
  79. - name: copy file carbon.conf
  80. copy: src=carbon.conf dest=/var/lib/graphite/conf/
  81. notify:
  82. - restart carbon-cache
  83. - name: copy file storage-schemas.conf
  84. copy: src=storage-schemas.conf dest=/var/lib/graphite/conf/
  85. notify:
  86. - restart carbon-cache
  87. - name: copy file graphite.ini
  88. copy: src=graphite.ini dest=/etc/uwsgi/apps-enabled/
  89. notify:
  90. - restart uwsgi
  91. - name: copy file graphite.wsgi
  92. copy: src=graphite.wsgi dest=/var/lib/graphite/conf/
  93. notify:
  94. - restart carbon-cache
  95. - name: copy file local_settings.py
  96. copy: src=local_settings.py dest=/var/lib/graphite/lib/graphite/
  97. notify:
  98. - restart carbon-cache
  99. - name: copy file carbon-cache.service
  100. copy: src=carbon-cache.service dest=/lib/systemd/system/
  101. notify:
  102. - reload systemd
  103. - restart carbon-cache
  104. - name: enable carbon-cache
  105. service: name=carbon-cache enabled=yes
  106. notify:
  107. - restart carbon-cache
  108. - name: enable uwsgi
  109. service: name=uwsgi enabled=yes
  110. notify:
  111. - restart uwsgi