From edc208b79bbce122f580b633c9b7fbfa88af873a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 8 Aug 2014 13:38:27 +0100 Subject: [PATCH] Add FreeBSD compatibility --- openssh/init.sls | 4 ++++ openssh/map.jinja | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/openssh/init.sls b/openssh/init.sls index 6d447fe..3cf9be6 100644 --- a/openssh/init.sls +++ b/openssh/init.sls @@ -1,10 +1,14 @@ {% from "openssh/map.jinja" import openssh with context %} openssh: + {% if openssh.server is defined %} pkg.installed: - name: {{ openssh.server }} + {% endif %} service.running: - enable: True - name: {{ openssh.service }} + {% if openssh.server is defined %} - require: - pkg: {{ openssh.server }} + {% endif %} diff --git a/openssh/map.jinja b/openssh/map.jinja index 0ba5b62..4a8c687 100644 --- a/openssh/map.jinja +++ b/openssh/map.jinja @@ -17,4 +17,11 @@ 'banner': '/etc/ssh/banner', 'banner_src': 'salt://openssh/files/banner', }, + 'FreeBSD': { + 'service': 'sshd', + 'sshd_config': '/etc/ssh/sshd_config', + 'sshd_config_src': 'salt://openssh/files/sshd_config', + 'banner': '/etc/ssh/banner', + 'banner_src': 'salt://openssh/files/banner', + } }, merge=salt['pillar.get']('openssh:lookup')) %}