Allow to configure xinetd services from pillar#1
Allow to configure xinetd services from pillar#1amontalban wants to merge 9 commits intosaltstack-formulas:masterfrom
Conversation
- Adds functionality to configure xinetd services using pillar data - Add configuration for tests with Kitchen CI and Travis CI
Allow to configure xinetd services from pillar
- Adds functionality to configure xinetd services using pillar data - Add configuration for tests with Kitchen CI and Travis CI
This commit does the following:
As stated in https://docs.saltstack.com/en/latest/topics/releases/2019.2.0.html Add the usage of `tojson` filter. This change is compatible with 2018.3.3 as per that docs. Update kitchen, travis, Gemfile
Update for compatibility with SaltStack 2019.2
|
@amontalban Thanks for this PR and for your patience while waiting for a response! I've had a very brief look at this and it looks like a positive development. Since you first started this PR, there have been a number of changes and we've been rolling out a consistent pattern across all formulas, including the Kitchen and Travis configurations. We're also using "pre-salted" images to make our CI runs more efficient. A further step is the use of My question to you: would you be willing to reshape this PR to fit what we're rolling out at the moment? I'm not asking you to do this yet -- I'm just starting the discussion, so that we can plan out the steps required, if you agree. Unless you have something very specific in your Kitchen/Travis configuration, it should be very simple to make the necessary modifications. For you to get an idea of what I'm talking about, please refer to the |
myii
left a comment
There was a problem hiding this comment.
Some feedback after an eyeball review, thanks.
|
|
||
| ``xinetd`` | ||
| ``xinetd.install`` | ||
| ---------- |
There was a problem hiding this comment.
| ---------- | |
| ------------------ |
|
|
||
|
|
||
| ``xinetd.config`` | ||
| ---------- |
There was a problem hiding this comment.
| ---------- | |
| ----------------- |
xinetd/config.sls
Outdated
| {%- from "xinetd/map.jinja" import xinetd with context -%} | ||
|
|
||
| {%- if xinetd.services is iterable %} | ||
| {%- for service, config in xinetd.services.iteritems() %} |
There was a problem hiding this comment.
iteritems is deprecated, please use items:
| {%- for service, config in xinetd.services.iteritems() %} | |
| {%- for service, config in xinetd.services.items() %} |
| - template: jinja | ||
| - context: | ||
| service: {{ service }} | ||
| config: {{ config|tojson }} |
There was a problem hiding this comment.
| config: {{ config|tojson }} | |
| config: {{ config|json }} |
Unfortunately, we can't use |tojson just yet since we need to support 2017.7 for the time being. For more information about this, please refer back to saltstack-formulas/consul-formula#40 (comment) and the linked content.
There was a problem hiding this comment.
There's also a second issue about using config here: saltstack-formulas/ufw-formula#7 (comment).
| xinetd_{{ service }}_config: | ||
| file.managed: | ||
| - name: /etc/xinetd.d/{{ service }} | ||
| - source: salt://xinetd/files/config_template |
There was a problem hiding this comment.
Not necessary for this PR but this is ripe for converting to TOFS (refer back to the template-formula for more info).
xinetd/files/config_template
Outdated
| {% endif -%} | ||
| service {{ service }} | ||
| { | ||
| {% for k, v in config.iteritems() -%} |
There was a problem hiding this comment.
iteritems is deprecated, please use items:
| {% for k, v in config.iteritems() -%} | |
| {% for k, v in config.items() -%} |
Signed-off-by: Felipe Zipitria <fzipitria@perceptyx.com>
Change to items for py3 compat
This PR does the following: