Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% for site, site_data in salt['pillar.get']('activemq:zone_config', {}).items() -%}
- # create each instance of activemq
- {% if salt['pillar.get']('activemq:setup_instances') == 'true' %}
- {% if not salt['file.directory_exists' ]('/opt/activemq/apache-activemq-5.13.1/{{site}}') %}
- create-{{site}}-activemq:
- cmd.run:
- - names:
- - sudo chown -R activemq:activemq /opt/activemq
- - sudo -u activemq /opt/activemq/current/bin/activemq create /opt/activemq/current/{{ site }}
- - sudo chown -R activemq:activemq /opt/activemq
- /etc/init.d/{{ site }}:
- file.symlink:
- - target: /opt/activemq/current/{{site}}/bin/{{site}}
- - clean: True
- create-{{site}}-defaults:
- cmd.run:
- - names:
- - sudo update-rc.d {{ site }} defaults && sudo update-rc.d {{ site }} enable
- {% endif %}
- {% endif %}
- {{ site }}-restart:
- cmd.run:
- - name: service {{ site }} restart
- - prereq:
- - file: {{ site }}-config
- {{ site }}-config:
- file.managed:
- - name : /opt/activemq/current/{{site}}/conf/activemq.xml
- - source: salt://activemq/templates/activemq.xml.jinja
- - user: activemq
- - group: activemq
- - template: jinja
- - clean: True
- - mode: 640
- - context:
- SiteConfig: {{ site_data }}
- Site: {{ site }}
- {% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement