瀏覽代碼

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

[openssh/config_ini] initial version of config_ini which uses ini state
master
Niels Abspoel 6 年之前
父節點
當前提交
b93448b5e6
沒有連結到貢獻者的電子郵件帳戶。
共有 2 個檔案被更改,包括 27 行新增0 行删除
  1. +10
    -0
      README.rst
  2. +17
    -0
      openssh/config_ini.sls

+ 10
- 0
README.rst 查看文件

@@ -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
- 0
openssh/config_ini.sls 查看文件

@@ -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 %}

Loading…
取消
儲存