Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. {% for site, site_data in salt['pillar.get']('activemq:zone_config', {}).items() -%}
  2. # create each instance of activemq
  3. {% if salt['pillar.get']('activemq:setup_instances') == 'true' %}
  4.  
  5. {% if not salt['file.directory_exists' ]('/opt/activemq/apache-activemq-5.13.1/{{site}}') %}
  6. create-{{site}}-activemq:
  7. cmd.run:
  8. - names:
  9. - sudo chown -R activemq:activemq /opt/activemq
  10. - sudo -u activemq /opt/activemq/current/bin/activemq create /opt/activemq/current/{{ site }}
  11. - sudo chown -R activemq:activemq /opt/activemq
  12.  
  13. /etc/init.d/{{ site }}:
  14. file.symlink:
  15. - target: /opt/activemq/current/{{site}}/bin/{{site}}
  16. - clean: True
  17.  
  18. create-{{site}}-defaults:
  19. cmd.run:
  20. - names:
  21. - sudo update-rc.d {{ site }} defaults && sudo update-rc.d {{ site }} enable
  22. {% endif %}
  23.  
  24. {% endif %}
  25.  
  26. {{ site }}-restart:
  27. cmd.run:
  28. - name: service {{ site }} restart
  29. - prereq:
  30. - file: {{ site }}-config
  31.  
  32. {{ site }}-config:
  33. file.managed:
  34. - name : /opt/activemq/current/{{site}}/conf/activemq.xml
  35. - source: salt://activemq/templates/activemq.xml.jinja
  36. - user: activemq
  37. - group: activemq
  38. - template: jinja
  39. - clean: True
  40. - mode: 640
  41. - context:
  42. SiteConfig: {{ site_data }}
  43. Site: {{ site }}
  44. {% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement