From 467c5e56fc1ec68d5f5366c8b544629962555b9f Mon Sep 17 00:00:00 2001 From: Andres Montalban Date: Thu, 27 Jul 2017 19:06:27 -0300 Subject: [PATCH 1/2] Remove extra whitespace --- openssh/files/banner | 6 +++--- openssh/files/fire_banner | 16 ++++++++-------- openssh/map.jinja | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/openssh/files/banner b/openssh/files/banner index 9ed979d..47efa73 100644 --- a/openssh/files/banner +++ b/openssh/files/banner @@ -2,11 +2,11 @@ Welcome to {{ grains['id'] }}! Managed By - _____ ____ _____ __ __ + _____ ____ _____ __ __ / ___/____ _/ / /_/ ___// /_____ ______/ /__ \__ \/ __ `/ / __/\__ \/ __/ __ `/ ___/ //_/ - ___/ / /_/ / / /_ ___/ / /_/ /_/ / /__/ ,< -/____/\__,_/_/\__//____/\__/\__,_/\___/_/|_| + ___/ / /_/ / / /_ ___/ / /_/ /_/ / /__/ ,< +/____/\__,_/_/\__//____/\__/\__,_/\___/_/|_| Make sure changes get pushed into the state repo! diff --git a/openssh/files/fire_banner b/openssh/files/fire_banner index c50f5f7..4acac33 100644 --- a/openssh/files/fire_banner +++ b/openssh/files/fire_banner @@ -1,13 +1,13 @@ Welcome to {{ grains['id'] }}! Managed By - ( ( - )\ ) ( ) )\ ) ) ) -(()/( ) )\ ( /((()/( ( /( ) ( /( - /(_))( /( ((_))\())/(_)))\())( /( ( )\()) -(_)) )(_)) _ (_))/(_)) (_))/ )(_)) )\ ((_)\ -/ __|((_)_ | || |_ / __|| |_ ((_)_ ((_)| |(_) -\__ \/ _` || || _|\__ \| _|/ _` |/ _| | / / -|___/\__,_||_| \__||___/ \__|\__,_|\__| |_\_\ + ( ( + )\ ) ( ) )\ ) ) ) +(()/( ) )\ ( /((()/( ( /( ) ( /( + /(_))( /( ((_))\())/(_)))\())( /( ( )\()) +(_)) )(_)) _ (_))/(_)) (_))/ )(_)) )\ ((_)\ +/ __|((_)_ | || |_ / __|| |_ ((_)_ ((_)| |(_) +\__ \/ _` || || _|\__ \| _|/ _` |/ _| | / / +|___/\__,_||_| \__||___/ \__|\__,_|\__| |_\_\ Make sure changes get pushed into the state repo! diff --git a/openssh/map.jinja b/openssh/map.jinja index efe8daf..8d81307 100644 --- a/openssh/map.jinja +++ b/openssh/map.jinja @@ -1,7 +1,7 @@ {## Start with defaults from defaults.yaml ##} {% import_yaml "openssh/defaults.yaml" as default_settings %} -{## +{## Setup variable using grains['os_family'] based logic, only add key:values here that differ from whats in defaults.yaml ##} From 500c915c338aa2e24d0f7c1f771963657dd982a3 Mon Sep 17 00:00:00 2001 From: Andres Montalban Date: Thu, 27 Jul 2017 19:55:34 -0300 Subject: [PATCH 2/2] Allow to config banner in pillar --- openssh/banner.sls | 5 +++++ pillar.example | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/openssh/banner.sls b/openssh/banner.sls index f301a09..362729c 100644 --- a/openssh/banner.sls +++ b/openssh/banner.sls @@ -6,5 +6,10 @@ include: sshd_banner: file.managed: - name: {{ openssh.banner }} + {% if openssh.banner_string is defined %} + - contents: | + {{ openssh.banner_string }} + {% else %} - source: {{ openssh.banner_src }} - template: jinja + {% endif %} diff --git a/pillar.example b/pillar.example index 4aa3b2e..6c40341 100644 --- a/pillar.example +++ b/pillar.example @@ -177,6 +177,10 @@ ssh_config: openssh: + # Instead of adding a custom banner file you can set it in pillar + banner_string: | + Welcome to {{ grains['id'] }}! + # Controls if SSHD should be enabled/started sshd_enable: true auth: