0
0
mirror of https://github.com/saltstack-formulas/openssh-formula.git synced 2024-11-27 23:07:53 +01:00

Merge pull request #124 from arthurlogilab/123-add-ini-version-of-config

[openssh/config_ini] initial version of config_ini which uses ini state
This commit is contained in:
Niels Abspoel 2018-03-17 21:35:30 +01:00 committed by GitHub
commit b93448b5e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View File

@ -51,6 +51,16 @@ of the default ``sshd_config`` file on Debian Wheezy.
It is highly recommended ``PermitRootLogin`` is added to pillar
so root login will be disabled.
``openssh.config_ini``
----------------------
Version of managing ``sshd_config`` that uses the
`ini_managed.option_present <https://docs.saltstack.com/en/latest/ref/states/all/salt.states.ini_manage.html>`_
state module, so it enables to override only one or
multiple values and keeping the defaults shipped by your
distribution.
``openssh.known_hosts``
-----------------------

17
openssh/config_ini.sls Normal file
View File

@ -0,0 +1,17 @@
{% from "openssh/map.jinja" import openssh with context %}
include:
- openssh
{% if salt['pillar.get']('sshd_config', False) %}
sshd_config-with-ini:
ini.options_present:
- name: {{ openssh.sshd_config }}
- separator: ' '
- watch_in:
- service: {{ openssh.service }}
- sections:
{%- for k,v in salt['pillar.get']('sshd_config',{}).items() %}
{{ k }}: '{{ v }}'
{%- endfor %}
{% endif %}