Split the sshd_config and banner components into sub-states

This commit is contained in:
Kenny Do 2014-01-03 18:32:05 -08:00
parent 0a2468d87a
commit 07771c0ebf
4 changed files with 31 additions and 17 deletions

View File

@ -1,7 +1,12 @@
openssh openssh
======= =======
Install and configure an openssh server.
openssh States
------- ------
``openssh``
Install openssh and set up the daemon, install a useful banner as well Installs the ``openssh`` package and service.
``openssh.config``
Installs the configuration file included in this formula (under "openssh/files").
``openssh.banner``
Installs a banner that users see when SSH-ing in.

10
openssh/banner.sls Normal file
View File

@ -0,0 +1,10 @@
{% from "openssh/map.jinja" import openssh with context %}
include:
- openssh
sshd_banner:
file.managed:
- name: {{ openssh.banner }}
- source: {{ openssh.banner_src }}
- template: jinja

12
openssh/config.sls Normal file
View File

@ -0,0 +1,12 @@
{% from "openssh/map.jinja" import openssh with context %}
include:
- openssh
sshd_config:
file.managed:
- name: {{ openssh.sshd_config }}
- source: {{ openssh.sshd_config_src }}
- watch_in:
- service: {{ openssh.service }}

View File

@ -8,17 +8,4 @@ openssh:
- name: {{ openssh.service }} - name: {{ openssh.service }}
- require: - require:
- pkg: {{ openssh.server }} - pkg: {{ openssh.server }}
- file: sshd_banner
- watch:
- file: sshd_config
sshd_config:
file.managed:
- name: {{ openssh.sshd_config }}
- source: {{ openssh.sshd_config_src }}
sshd_banner:
file.managed:
- name: {{ openssh.banner }}
- source: {{ openssh.banner_src }}
- template: jinja