Skip to content
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

Test config before restarting service #143

Open
OrangeDog opened this issue Jan 14, 2019 · 6 comments
Open

Test config before restarting service #143

OrangeDog opened this issue Jan 14, 2019 · 6 comments
Assignees

Comments

@OrangeDog
Copy link
Contributor

OrangeDog commented Jan 14, 2019

To avoid rendering a server inaccessible, should include something like this (for both .config and .config_ini)

/usr/sbin/sshd -t:
  cmd.run:
    - onchanges:
      - file: sshd_config
    - require_in:
      - service: openssh
@daks
Copy link
Member

daks commented Jan 14, 2019

Testing ssh config before restarting the service looks like a good idea to me. Do you think you can provide a pull request with the code?

@alxwr
Copy link
Member

alxwr commented Jan 15, 2019

@OrangeDog
Copy link
Contributor Author

@alxwr cool, just needs implementing for config_ini then.

@alxwr
Copy link
Member

alxwr commented Jan 15, 2019

@OrangeDog check_cmd uses a temporary file which contains the new config.
Based on your last comment I guess you agree with my view on salt.states.file.managed's check_cmd. Is that correct?

@OrangeDog @aboe76
In my view .config_ini is a special case which only changes the way in which sshd_config gets its values. It was implemented in #124.
I propose to extend .config with .config_ini by overwriting ID sshd_config. This way we get all the additional features (i.e. key mgmt) within .config plus INI format.

@aboe76
Copy link
Member

aboe76 commented Jan 15, 2019

@alxwr nice Idea, can you create a PR then we can test this.

@alxwr alxwr self-assigned this Jan 15, 2019
@alxwr
Copy link
Member

alxwr commented Jan 15, 2019

@aboe76 I assigned the issue to myself, but I can't promise any completion date. :-)
So if anyone wants to create a PR before, feel free to do so. (Just give me an update in this thread when you start. I'll do the same.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants