Skip to content

Commit

Permalink
fix(salt-ssh): jinja include is unusable in file.managed templates
Browse files Browse the repository at this point in the history
Caching the jinja include with a `file.cached` workaround the issue as
explained on the tracker:

  saltstack/salt#21370 (comment)
  • Loading branch information
baby-gnu committed Dec 21, 2022
1 parent 56d55fb commit cdcd4be
Show file tree
Hide file tree
Showing 47 changed files with 148 additions and 0 deletions.
3 changes: 3 additions & 0 deletions collectd/apache.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/apache.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/bind.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/bind.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/csv.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/csv.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/curl_json.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/curl_json.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/curl_xml.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/curl_xml.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/dbi.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/dbi.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/df.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/df.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/disk.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/disk.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/elasticsearch.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
include:
- collectd
- collectd.python
- collectd.workaround-salt-ssh
collectd-elasticsearch-module:
pip.installed:
Expand All @@ -20,5 +21,7 @@ collectd-elasticsearch-module:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/ethstat.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/ethstat.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/exec.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/exec.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/extra-plugins.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{%- for plugin, plugin_settings in collectd_settings.plugins.extra.items() %}
{{ collectd_settings.plugindirconfig }}/{{ plugin }}.conf:
Expand All @@ -14,6 +15,8 @@ include:
- defaults:
plugin: {{ plugin }}
plugin_settings: {{ plugin_settings }}
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
{% endfor %}
5 changes: 5 additions & 0 deletions collectd/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd.service
- collectd.workaround-salt-ssh
collectd:
pkg.installed:
Expand All @@ -28,6 +29,8 @@ collectd:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
Expand All @@ -38,5 +41,7 @@ collectd:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/interface.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/interface.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/java.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
collectd-java:
file.rename:
Expand All @@ -24,5 +25,7 @@ collectd-java:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/librato.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/librato.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/logfile.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/logfile.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/md.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/md.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/memcached.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/memcached.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/mysql.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/mysql.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 600
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/network.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/network.conf:
file.managed:
Expand All @@ -10,6 +11,8 @@ include:
- group: {{ collectd_settings.group }}
- mode: '0600'
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
Expand Down
3 changes: 3 additions & 0 deletions collectd/nginx.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/nginx.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/ntpd.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
include:
- collectd
- collectd.python
- collectd.workaround-salt-ssh
collectd-ntp-module:
pip.installed:
Expand All @@ -19,5 +20,7 @@ collectd-ntp-module:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
3 changes: 3 additions & 0 deletions collectd/openldap.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include:
- collectd
- collectd.workaround-salt-ssh
{{ collectd_settings.plugindirconfig }}/openldap.conf:
file.managed:
Expand All @@ -10,5 +11,7 @@ include:
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- require:
- sls: collectd.workaround-salt-ssh
- watch_in:
- service: collectd-service
Loading

0 comments on commit cdcd4be

Please sign in to comment.