Skip to content

Commit

Permalink
fix(jinja2): use final merged values instead of pillars
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Jul 27, 2021
1 parent 9c95eb2 commit b1f5495
Show file tree
Hide file tree
Showing 55 changed files with 80 additions and 74 deletions.
2 changes: 1 addition & 1 deletion rabbitmq/config/bindings/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'bindings' in node and node.bindings is mapping %}
{%- for binding, q in node.bindings.items() %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/bindings/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include:
- {{ sls_service_running }}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'bindings' in node and node.bindings is mapping %}
{%- for binding, ex in node.bindings.items() %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/clusters/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'clustered' in node and node.clustered and 'join_node' in node %}
rabbitmq-config-clusters-{{ name }}-leave-{{ node.join_node }}:
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/clusters/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include:
- {{ sls_config_users }}
- {{ sls_config_files }}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'clustered' in node and node.clustered and 'join_node' in node %}
{%- if 'erlang_cookie' in node and node.erlang_cookie %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/exchanges/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'exchanges' in node and node.exchanges is mapping %}
{%- for exchange, q in node.exchanges.items() %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/exchanges/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include:
- {{ sls_service_running }}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'exchanges' in node and node.exchanges is mapping %}
{%- for exchange, ex in node.exchanges.items() %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/files/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include:
- {{ sls_package_clean }}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
rabbitmq-config-files-absent-{{ name }}:
file.absent:
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/files/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
include:
- {{ sls_service_running }}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'config' in node and node.config is mapping %}
rabbitmq-config-files-managed-{{ name }}:
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/params/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include:
- {{ sls_service_running }}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'params' in node and node.params is mapping %}
{%- for param, items in node.params.items() %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/plugins/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'plugins' in node and node.plugins is iterable and node.plugins is not string %}
{%- for plugin in node.plugins %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/plugins/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include:
- {{ sls_service_running }}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'plugins' in node and node.plugins is iterable and node.plugins is not string %}
{%- for plugin in node.plugins %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/policies/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'policies' in node and node.policies is mapping %}
{%- for policy, items in node.policies.items() %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/policies/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include:
- {{ sls_service_running }}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'policies' in node and node.policies is mapping %}
{%- for policy, items in node.policies.items() %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/queues/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'queues' in node and node.queues is mapping %}
{%- for queue, q in node.queues.items() %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/queues/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include:
- {{ sls_service_running }}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'queues' in node and node.queues is mapping %}
{%- for queue, q in node.queues.items() %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/upstreams/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'upstreams' in node and node.upstreams is mapping %}
{%- for upstream, items in node.upstreams.items() %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/upstreams/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include:
- {{ sls_service_running }}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'upstreams' in node and node.upstreams is mapping %}
{%- for upstream, items in node.upstreams.items() %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/users/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rabbitmq-config-users-environ-locale:
- update_minion: True
{%- endif %}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'users' in node and node.users is mapping %}
{%- for user, items in node.users.items() %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/users/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include:
- {{ sls_service_running }}
- {{ sls_vhosts_install }}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'users' in node and node.users is mapping %}
{%- for user, u in node.users.items() %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/vhosts/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'vhosts' in node and node.vhosts is iterable and node.vhosts is not string %}
{%- for vhost in node.vhosts %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/config/vhosts/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include:
- {{ sls_service_running }}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'vhosts' in node and node.vhosts is iterable and node.vhosts is not string %}
{%- for vhost in node.vhosts %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/service/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %}
{%- for name, node in salt["pillar.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'service' in node and node.service %}
{%- set svcname = 'rabbitmq-server' %}
{%- if name != 'rabbit' %}
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/service/running.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include:
- {{ sls_config_files }}
- {{ sls_config_users }}
{%- for name, node in salt["config.get"]("rabbitmq:nodes", {}).items() %}
{%- for name, node in rabbitmq.nodes.items() %}
{%- if 'service' in node and node.service %}
{%- set svcname = 'rabbitmq-server' %}
{%- if name != 'rabbit' %}
Expand Down
1 change: 0 additions & 1 deletion test/integration/default/files/_mapdata/centos-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ values:
vhost: default_vhost
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
upstream:
my-new-upstream1:
Expand Down
1 change: 0 additions & 1 deletion test/integration/default/files/_mapdata/centos-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ values:
vhost: default_vhost
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
upstream:
my-new-upstream1:
Expand Down
1 change: 0 additions & 1 deletion test/integration/default/files/_mapdata/debian-10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ values:
vhost: default_vhost
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
upstream:
my-new-upstream1:
Expand Down
1 change: 0 additions & 1 deletion test/integration/default/files/_mapdata/debian-11.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ values:
vhost: default_vhost
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
upstream:
my-new-upstream1:
Expand Down
1 change: 0 additions & 1 deletion test/integration/default/files/_mapdata/debian-9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ values:
vhost: default_vhost
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
upstream:
my-new-upstream1:
Expand Down
1 change: 0 additions & 1 deletion test/integration/default/files/_mapdata/fedora-32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ values:
vhost: default_vhost
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
upstream:
my-new-upstream1:
Expand Down
1 change: 0 additions & 1 deletion test/integration/default/files/_mapdata/fedora-33.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ values:
vhost: default_vhost
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
upstream:
my-new-upstream1:
Expand Down
1 change: 0 additions & 1 deletion test/integration/default/files/_mapdata/fedora-34.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ values:
vhost: default_vhost
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
upstream:
my-new-upstream1:
Expand Down
1 change: 0 additions & 1 deletion test/integration/default/files/_mapdata/opensuse-15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ values:
vhost: default_vhost
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
upstream:
my-new-upstream1:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ values:
vhost: default_vhost
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
upstream:
my-new-upstream1:
Expand Down
1 change: 0 additions & 1 deletion test/integration/default/files/_mapdata/ubuntu-16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ values:
vhost: default_vhost
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
upstream:
my-new-upstream1:
Expand Down
1 change: 0 additions & 1 deletion test/integration/default/files/_mapdata/ubuntu-18.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ values:
vhost: default_vhost
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
upstream:
my-new-upstream1:
Expand Down
1 change: 0 additions & 1 deletion test/integration/default/files/_mapdata/ubuntu-20.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ values:
vhost: default_vhost
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
upstream:
my-new-upstream1:
Expand Down
5 changes: 3 additions & 2 deletions test/integration/nopillars/files/_mapdata/amazonlinux-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ values:
rabbit:
clustered: false
config: {}
erlang_cookie: ''
distport: 25672
erlang_cookie: shared-secret
nodeport: 5672
plugins:
- rabbitmq_management
- rabbitmq_federation
Expand All @@ -39,7 +41,6 @@ values:
- definition: '{"ha-mode": "all"}'
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
users: {}
vhosts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ values:
rabbit:
clustered: false
config: {}
erlang_cookie: ''
distport: 25672
erlang_cookie: shared-secret
nodeport: 5672
plugins:
- rabbitmq_management
- rabbitmq_federation
Expand All @@ -39,7 +41,6 @@ values:
- definition: '{"ha-mode": "all"}'
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
users: {}
vhosts:
Expand Down
5 changes: 3 additions & 2 deletions test/integration/nopillars/files/_mapdata/centos-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ values:
rabbit:
clustered: false
config: {}
erlang_cookie: ''
distport: 25672
erlang_cookie: shared-secret
nodeport: 5672
plugins:
- rabbitmq_management
- rabbitmq_federation
Expand All @@ -39,7 +41,6 @@ values:
- definition: '{"ha-mode": "all"}'
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
users: {}
vhosts:
Expand Down
5 changes: 3 additions & 2 deletions test/integration/nopillars/files/_mapdata/centos-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ values:
rabbit:
clustered: false
config: {}
erlang_cookie: ''
distport: 25672
erlang_cookie: shared-secret
nodeport: 5672
plugins:
- rabbitmq_management
- rabbitmq_federation
Expand All @@ -39,7 +41,6 @@ values:
- definition: '{"ha-mode": "all"}'
queues: {}
remove_guest_user: true
runas: rabbitmq
service: true
users: {}
vhosts:
Expand Down
Loading

0 comments on commit b1f5495

Please sign in to comment.