Skip to content

Commit

Permalink
fix(config): remove requisite (in case of failure); add user/group
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Jun 5, 2021
1 parent 5bac4bb commit d5e7410
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions rabbitmq/config/cluster/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ include:
- {{ sls_config_user }}
{%- for name, cluster in salt["pillar.get"]("rabbitmq:cluster", {}).items() %}
{%- if 'erlang_cookie' in cluster and cluster.erlang_cookie is mapping %}
{%- if cluster.host and 'erlang_cookie' in cluster and cluster.erlang_cookie is mapping %}
rabbitmq-config-cluster-join-{{ name }}:
rabbitmq-config-cluster-{{ name }}-join-{{ cluster.host }}:
file.managed:
- name: {{ cluster.erlang_cookie.name }}
- contents: {{ cluster.erlang_cookie.value }}
- mode: 400
- user: {{ cluster.user }}
- group: root
- user: {{ rabbitmq.config.user }}
- group: {{ rabbitmq.config.user }}
- makedirs: True
- watch_in:
- service: rabbitmq-service-running-service-running
Expand All @@ -32,7 +32,7 @@ rabbitmq-config-cluster-join-{{ name }}:
- ram_node: {{ cluster.ram_node }}
- runas: {{ cluster.runas }}
- require:
- file: rabbitmq-config-cluster-join-{{ name }}
- file: rabbitmq-config-cluster-{{ name }}-join-{{ cluster.host }}
- sls: {{ sls_config_user }}
- service: rabbitmq-service-running-service-running
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/vhost/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ rabbitmq-config-vhost-present-{{ name }}:
rabbitmq_vhost.present:
- name: {{ name }}
- require:
- service: {{ rabbitmq.service.name }}
- service: rabbitmq-service-running-service-running
{% endfor %}
2 changes: 2 additions & 0 deletions rabbitmq/parameters/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ values:
RABBITMQ_BASE: /var/lib/rabbitmq
config:
name: /etc/rabbitmq/rabbitmq.conf
user: rabbitmq
group: rabbitmq
# see rabbitmq.conf.example from rabbitmq-server github docs
context: {}
service:
Expand Down
3 changes: 1 addition & 2 deletions rabbitmq/service/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ rabbitmq-service-clean-service-dead:
service.dead:
- name: {{ rabbitmq.service.name }}
- enable: False
- require_in:
- sls: {{ sls_package_clean }}
- sig: 'rabbit boot'

0 comments on commit d5e7410

Please sign in to comment.