-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to configure xinetd services from pillar #1
base: master
Are you sure you want to change the base?
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some feedback after an eyeball review, thanks.
@@ -15,9 +15,13 @@ Available states | |||
.. contents:: | |||
:local: | |||
|
|||
``xinetd`` | |||
``xinetd.install`` | |||
---------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
---------- | |
------------------ |
---------- | ||
|
||
Installs the xinetd package and starts the daemon. | ||
|
||
|
||
``xinetd.config`` | ||
---------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
---------- | |
----------------- |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iteritems
is deprecated, please use items
:
{% for k, v in config.iteritems() -%} | |
{% for k, v in config.items() -%} |
Signed-off-by: Felipe Zipitria <[email protected]>
Change to items for py3 compat
This PR does the following: