Conversation
|
@tigpas Thanks for this series of PRs. In order to evaluate these changes, I'm about to implement As soon as that's merged, please rebase your PRs on top and then we can see how your changes work out. |
* Automated using myii/ssf-formula#109
```bash
[202] Jinja statement should have spaces before and after: {% statement %}
icinga2/config.sls:6
{%- for key, value in config.items()%}
[206] Jinja variables should have spaces before and after: {{ var_name }}
icinga2/config.sls:8
{{key}} "{{ value }}"
[202] Jinja statement should have spaces before and after: {% statement %}
icinga2/config.sls:12
{%- for key, value in config.items()%}
[202] Jinja statement should have spaces before and after: {% statement %}
icinga2/config.sls:55
{%-endmacro%}
[206] Jinja variables should have spaces before and after: {{ var_name }}
icinga2/config.sls:107
{{ path}}:
[202] Jinja statement should have spaces before and after: {% statement %}
icinga2/config.sls:160
{%- endfor%}
[202] Jinja statement should have spaces before and after: {% statement %}
icinga2/config.sls:181
{%- endfor%}
[202] Jinja statement should have spaces before and after: {% statement %}
icinga2/config.sls:202
{%- endfor%}
[202] Jinja statement should have spaces before and after: {% statement %}
icinga2/config.sls:227
{%- endfor%}
[202] Jinja statement should have spaces before and after: {% statement %}
icinga2/config.sls:230
{%- endfor%}
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:3
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:9
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:21
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:24
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:27
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:31
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:33
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:35
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:38
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:41
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:44
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:49
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:51
[201] Trailing whitespace
icinga2/files/xmpp.conf.jinja:53
[201] Trailing whitespace
icinga2/map.jinja:6
defaults,
[202] Jinja statement should have spaces before and after: {% statement %}
icinga2/nrpe-server.sls:2
{% set nrpe = salt['pillar.get']('nrpe', salt['pillar.get']('icinga2:lookup::nrpe', {}))%}
[206] Jinja variables should have spaces before and after: {{ var_name }}
icinga2/pgsql-ido.sls:45
- name: "{{ icinga2.config_dir}}/features-available/ido-pgsql.conf"
```
```bash icinga2-formula$ yamllint -s . ./pillar.example 1:1 warning missing document start "---" (document-start) 6:8 warning missing starting space in comment (comments) 20:14 warning truthy value should be one of [false, true] (truthy) 21:18 warning truthy value should be one of [false, true] (truthy) 22:15 warning truthy value should be one of [false, true] (truthy) 23:19 warning truthy value should be one of [false, true] (truthy) 24:19 warning truthy value should be one of [false, true] (truthy) 25:19 warning truthy value should be one of [false, true] (truthy) 26:21 warning truthy value should be one of [false, true] (truthy) 36:18 warning truthy value should be one of [false, true] (truthy) 103:9 warning comment not indented like content (comments-indentation) 109:17 warning truthy value should be one of [false, true] (truthy) 123:15 error empty value in block mapping (empty-values) 124:7 warning comment not indented like content (comments-indentation) 126:14 error empty value in block mapping (empty-values) 127:7 warning comment not indented like content (comments-indentation) ./icinga2/osmap.yaml 1:1 warning missing document start "---" (document-start) ./icinga2/defaults.yaml 1:1 warning missing document start "---" (document-start) 14:27 warning truthy value should be one of [false, true] (truthy) 20:16 error empty value in block mapping (empty-values) 34:16 error empty value in block mapping (empty-values) 51:12 warning truthy value should be one of [false, true] (truthy) 52:16 warning truthy value should be one of [false, true] (truthy) 53:17 warning truthy value should be one of [false, true] (truthy) 54:13 warning truthy value should be one of [false, true] (truthy) 55:17 warning truthy value should be one of [false, true] (truthy) 56:17 warning truthy value should be one of [false, true] (truthy) 57:19 warning truthy value should be one of [false, true] (truthy) 58:17 warning truthy value should be one of [false, true] (truthy) 59:17 warning truthy value should be one of [false, true] (truthy) 60:19 warning truthy value should be one of [false, true] (truthy) 61:15 warning truthy value should be one of [false, true] (truthy) ./icinga2/osfamilymap.yaml 1:1 warning missing document start "---" (document-start) 5:27 warning truthy value should be one of [false, true] (truthy) 16:19 error empty value in block mapping (empty-values) 17:2 error syntax error: found character '%' that cannot start any token ```
icinga2/postgresql-server.sls
Outdated
| {% if salt['pillar.get']('icinga2:postgres:use_formula', False) %} | ||
| {% from "icinga2/map.jinja" import icinga2 with context %} | ||
|
|
||
| {% if icinga2.get('postgres:use_formula', False) %} |
There was a problem hiding this comment.
I've run this against the new testing setup and this change doesn't work (the pillar value is set to use the formula):
- https://travis-ci.org/myii/icinga2-formula/builds/623587122
- https://travis-ci.org/myii/icinga2-formula/jobs/623587127#L1268-L1277 -- this shows how this state gets rendered
The reason for this is due to the current structure of map.jinja, since only the lookup from the pillar is merged into the map:
icinga2-formula/icinga2/map.jinja
Line 13 in d0261f6
I.e. This if will never run, only the else.
If this PR is going to proceed, the correct resolution would be to merge in the rest of the pillar, as we do in many of our other formulas, such as the template-formula.
| @@ -1,4 +1,6 @@ | |||
| {% if salt['pillar.get']('icinga2:postgres:use_formula', False) %} | |||
| {% from "icinga2/map.jinja" import icinga2 with context %} | |||
There was a problem hiding this comment.
This line was absolutely needed. I also noticed this in the semantic-release PR: dece815.
…antic-release feat(semantic-release): implement for this formula
# [0.8.0](saltstack-formulas/icinga2-formula@v0.7.1...v0.8.0) (2019-12-11) ### Bug Fixes * **pgsql-ido.sls:** ensure state `debconf.set` is available ([310b2f5](saltstack-formulas@310b2f5)) * **postgresql-server.sls:** fix missing import ([dece815](saltstack-formulas@dece815)) * **repo:** prepare basic structure for all available platforms ([33f7694](saltstack-formulas@33f7694)) * **salt-lint:** fix all errors (or add to ignores) ([cae6252](saltstack-formulas@cae6252)) * **yamllint:** fix all errors (or add to ignores) ([860f72b](saltstack-formulas@860f72b)) ### Documentation * **readme:** modify according to standard structure ([fb0aca8](saltstack-formulas@fb0aca8)) * **readme:** move to `docs/` directory ([70105f0](saltstack-formulas@70105f0)) ### Features * **repositories.sls:** add inline `stretch-backports` repo ([5353313](saltstack-formulas@5353313)) * **semantic-release:** implement for this formula ([d632339](saltstack-formulas@d632339)) ### Tests * **inspec:** add tests for package, config & service ([da16c4e](saltstack-formulas@da16c4e)) * **pillar:** add for `default` suite based on `pillar.example` ([a1ee8a1](saltstack-formulas@a1ee8a1))
…to fix-postgresql
…docker test environment
|
Hi, thanks for the great testing environment and for #37 . Yes, I broke the if case in line 3. I reverted it. Now, It's working with as expected. But I don't understand why https://travis-ci.com/saltstack-formulas/icinga2-formula/jobs/267062799 failed. I can reproduce it locally with the master branche, too. |
|
@tigpas Thanks for updating this. I've run this with a modified test pillar to confirm it is all working OK: As for the I'm thinking that we can adjust the test suites slightly to test both with and without the |
|
🎉 This PR is included in version 0.9.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
In icinga2/postgresql-server.sls, there is icinga2.icinga_web2.postgresql_pkgs used, but the icinga2 variable isn't available. Due the include of map.jinja, it works. Than, we can use the "use_formula" variable from map, and not direct from pillar.