From 9e6ac55eb38632bb77b9ea5285c1746e5cb4dbd8 Mon Sep 17 00:00:00 2001 From: Arsenii Pastushenko Date: Thu, 5 Oct 2017 11:20:51 +0300 Subject: [PATCH 1/3] Add manage_user parameter --- README.md | 5 +++++ manifests/init.pp | 1 + manifests/install.pp | 4 +--- manifests/params.pp | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2880eb1..96b9d98 100644 --- a/README.md +++ b/README.md @@ -377,6 +377,11 @@ Path of the configuration file to be used by the aptly service. Default: `/etc/aptly.conf` +##### `manage_user` +Whethere should this module manage aptly user or not + +Default: `true` + ##### `user` OS user which will run the service. diff --git a/manifests/init.pp b/manifests/init.pp index ec3a04c..87d7a55 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,6 +14,7 @@ $port = $aptly::params::port, $bind = $aptly::params::bind, $config_filepath = $aptly::params::config_filepath, + $manage_user = $aptly::params::manage_user, $user = $aptly::params::user, $uid = $aptly::params::uid, $group = $aptly::params::group, diff --git a/manifests/install.pp b/manifests/install.pp index 7de799c..48589f6 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -4,7 +4,7 @@ # class aptly::install { - if ! defined(User[$aptly::user]) { + if $manage_user { user { $aptly::user: ensure => present, uid => $aptly::uid, @@ -12,9 +12,7 @@ shell => '/bin/bash', require => Group[$aptly::group], } - } - if ! defined(Group[$aptly::group]) { group { $aptly::group: ensure => present, gid => $aptly::gid, diff --git a/manifests/params.pp b/manifests/params.pp index 2373e16..9deacbe 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -15,6 +15,7 @@ $port = '8080' $bind = '0.0.0.0' $config_filepath = '/etc/aptly.conf' + $manage_user = true, $user = 'aptly' $uid = 450 $group = 'aptly' From c235052bb8f0fe1a2cf9517d532be46d5d4455ba Mon Sep 17 00:00:00 2001 From: Arsenii Pastushenko Date: Thu, 5 Oct 2017 11:29:25 +0300 Subject: [PATCH 2/3] Remove incorrect comma --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 9deacbe..8717831 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -15,7 +15,7 @@ $port = '8080' $bind = '0.0.0.0' $config_filepath = '/etc/aptly.conf' - $manage_user = true, + $manage_user = true $user = 'aptly' $uid = 450 $group = 'aptly' From d1d8cf0116f7dbe09bb1e0ecbb37c58c977f1b96 Mon Sep 17 00:00:00 2001 From: Arsenii Pastushenko Date: Thu, 5 Oct 2017 11:40:08 +0300 Subject: [PATCH 3/3] Use top scope variable explicitly --- manifests/install.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/install.pp b/manifests/install.pp index 48589f6..d3d2c71 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -4,7 +4,7 @@ # class aptly::install { - if $manage_user { + if $aptly::manage_user { user { $aptly::user: ensure => present, uid => $aptly::uid,