From dcb70e51811310a37210fa683479742d9c7b341f Mon Sep 17 00:00:00 2001 From: Arthur Lutz Date: Thu, 15 Feb 2018 17:43:13 +0100 Subject: [PATCH] [openssh/config_ini] initial version of config_ini which uses ini state closes #123 --- README.rst | 10 ++++++++++ openssh/config_ini.sls | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 openssh/config_ini.sls diff --git a/README.rst b/README.rst index 77895ca..559e6fb 100644 --- a/README.rst +++ b/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 `_ +state module, so it enables to override only one or +multiple values and keeping the defaults shipped by your +distribution. + + ``openssh.known_hosts`` ----------------------- diff --git a/openssh/config_ini.sls b/openssh/config_ini.sls new file mode 100644 index 0000000..80f9061 --- /dev/null +++ b/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 %}