From a136a62f1268595d2ffb26bbc6bc41a9f6151a33 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 20 Apr 2020 14:25:49 +0200 Subject: [PATCH 1/2] =?UTF-8?q?ubuntu=2020=20i=20m=C3=A9s=20defaults?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 10 ++++++++++ manifests/init.pp | 5 +++++ metadata.json | 4 ++-- templates/sudoers.erb | 21 ++++++++++++++++++++- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13b3cb8..5d1265e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # CHANGELOG +## 0.1.33 + +* added support for **Ubuntu 20.04** +* added mode options to configure global default options + - lecture / lecture_file + - badpass_message + - passwd_timeout + - passwd_tries + - insults + ## 0.1.32 * modified **sudoers::sudo**: diff --git a/manifests/init.pp b/manifests/init.pp index 9ddcba5..26c3fec 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -8,6 +8,11 @@ $sudoersd_recurse = true, $sudoersd_purge = true, $sudo_timeout = '15', + $lecture = 'once', + $lecture_file = undef, + $badpass_message = undef, + $passwd_tries = undef, + $insults = false, ) inherits sudoers::params { if($manage_package) diff --git a/metadata.json b/metadata.json index ec037c5..411e8a4 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "eyp-sudoers", - "version": "0.1.32", + "version": "0.1.33", "author": "eyp", "summary": "manages sudoers", "license": "Apache-2.0", @@ -33,7 +33,7 @@ }, { "operatingsystem": "Ubuntu", - "operatingsystemrelease": [ "14.04", "16.04", "18.04" ] + "operatingsystemrelease": [ "14.04", "16.04", "18.04", "20.04" ] }, { "operatingsystem": "SLES", diff --git a/templates/sudoers.erb b/templates/sudoers.erb index 274fbe7..0963a5b 100644 --- a/templates/sudoers.erb +++ b/templates/sudoers.erb @@ -1,5 +1,5 @@ # -# puppet managed file - DO NOT EDIT +# puppet managed file # <% if @requiretty -%> @@ -47,6 +47,25 @@ Defaults env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin +Defaults lecture="<%= @lecture %>" +<% if defined?(@lecture_file) -%> +Defaults lecture_file="<%= @lecture_file %>" +<% end -%> + +<% if defined?(@badpass_message) -%> +Defaults badpass_message="<%= @badpass_message %>" +<% end -%> +<% if defined?(@passwd_tries) -%> +Defaults passwd_tries=<%= @passwd_tries %> +<% end -%> +<% if defined?(@passwd_timeout) -%> +Defaults passwd_timeout=<%= @passwd_timeout %> +<% end -%> + +<% if @insults -%> +Defaults insults +<% end -%> + root ALL=(ALL) ALL #no soc un comentari From 3291aa3d4f652a5dd88fb3883c00cff2a7b5ce7a Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 20 Apr 2020 14:26:23 +0200 Subject: [PATCH 2/2] 20 --- manifests/params.pp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manifests/params.pp b/manifests/params.pp index 422e701..911b7f7 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -25,6 +25,9 @@ /^1[468].*$/: { } + /^20.*$/: + { + } default: { fail("Unsupported Ubuntu version! - ${::operatingsystemrelease}") } } }