From 7fae8e04b4e82d3c93301a5da37e7c3c9c5f22a4 Mon Sep 17 00:00:00 2001 From: krjensen Date: Thu, 24 Jan 2019 09:38:39 +0100 Subject: [PATCH 1/9] Moved windows install to config.pp --- manifests/init.pp | 20 +++++----- manifests/install.pp | 2 +- manifests/params.pp | 15 ++++---- manifests/run_service.pp | 12 ++---- manifests/windows_service.pp | 49 ++++++++---------------- templates/set_service_parameters.ps1.erb | 28 +++++++------- 6 files changed, 51 insertions(+), 75 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index ff702c08..61150e4a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -128,6 +128,9 @@ # [*user*] # Name of the user that should own the consul configuration files. # +# [*user_password*] +# The password for the user created by the `user` atribute. Default to `` +# # [*version*] # Specify version of consul binary to download. # @@ -136,21 +139,14 @@ # # [*shell*] # The shell for the consul user. Defaults to something that prohibits login, like /usr/sbin/nologin -# # [*enable_beta_ui*] -# consul 1.1.0 introduced a new UI, which is currently (2018-05-12) in beta status. -# You can enable it by setting this variable to true. Defaults to false -# +# consul 1.1.0 introduced a new UI, which is currently (2018-05-12) in beta status. You can enable it by setting this variable to true. Defaults to false # [*allow_binding_to_root_ports*] # Boolean, enables CAP_NET_BIND_SERVICE if true. This is currently only implemented on systemd nodes -# -# [*log_file*] -# String, where should the log file be located -# # === Examples # # @example -# class { 'consul': +# class { '::consul': # config_hash => { # 'datacenter' => 'east-aws', # 'node_name' => $::fqdn, @@ -218,7 +214,11 @@ $group_real = undef $init_style_real = 'unmanaged' } - else { + elsif $::operatingsystem == 'windows' { + $user_real = $user + $group_real = $group + $init_style_real = 'windows' + } else { $user_real = $user $group_real = $group $init_style_real = $init_style diff --git a/manifests/install.pp b/manifests/install.pp index 507155e6..54010a7b 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -9,7 +9,7 @@ ensure => 'directory', owner => $consul::user_real, group => $consul::group_real, - mode => '0755', + mode => $consul::data_dir_mode, } } diff --git a/manifests/params.pp b/manifests/params.pp index b49b9c86..9fad64a0 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -5,7 +5,7 @@ # class consul::params { $acls = {} - $archive_path = '' #lint:ignore:empty_string_assignment + $archive_path = '' $bin_dir = '/usr/local/bin' $checks = {} $config_defaults = {} @@ -15,7 +15,7 @@ $download_extension = 'zip' $download_url_base = 'https://releases.hashicorp.com/consul/' $extra_groups = [] - $extra_options = '' #lint:ignore:empty_string_assignment + $extra_options = '' $group = 'consul' $log_file = '/var/log/consul' $install_method = 'url' @@ -32,7 +32,6 @@ $service_enable = true $service_ensure = 'running' $services = {} - $service_config_hash = {} $user = 'consul' $version = '1.2.3' $watches = {} @@ -57,13 +56,15 @@ case $facts['os']['name'] { 'windows': { - $binary_group = 'Administrators' - $binary_mode = '0755' + $data_dir_mode = '0775' + $binary_group = undef + $binary_mode = '0775' $binary_name = 'consul.exe' - $binary_owner = 'Administrator' + $binary_owner = 'NT AUTHORITY\NETWORK SERVICE' } default: { # 0 instead of root because OS X uses "wheel". + $data_dir_mode = '0755' $binary_group = 0 $binary_mode = '0555' $binary_name = 'consul' @@ -95,7 +96,7 @@ } } - if $facts['os']['family'] == 'windows' { + if $facts['operatingsystem'] == 'windows' { $init_style = 'unmanaged' } else { $init_style = $facts['service_provider'] ? { diff --git a/manifests/run_service.pp b/manifests/run_service.pp index 4ba3b73a..fc94e944 100644 --- a/manifests/run_service.pp +++ b/manifests/run_service.pp @@ -16,12 +16,6 @@ } if $consul::manage_service == true and $consul::install_method != 'docker' { - if $::operatingsystem == 'windows' { - class { 'consul::windows_service': - before => Service['consul'], - } - } - service { 'consul': ensure => $consul::service_ensure, name => $service_name, @@ -46,16 +40,16 @@ docker::run { 'consul': image => "${consul::docker_image}:${consul::version}", net => 'host', - volumes => [ "${consul::config_dir}:/consul/config", "${consul::data_dir}:/consul/data" ], + volumes => [ "${::consul::config_dir}:/consul/config", "${::consul::data_dir}:/consul/data" ], env => $env, - command => $docker_command, + command => $docker_command } } case $consul::install_method { 'docker': { $wan_command = "docker exec consul consul join -wan ${consul::join_wan}" - $wan_unless = "docker exec consul consul members -wan -detailed | grep -vP \"dc=${consul::config_hash_real['datacenter']}\" | grep -P 'alive'" #lint:ignore:140chars + $wan_unless = "docker exec consul consul members -wan -detailed | grep -vP \"dc=${consul::config_hash_real['datacenter']}\" | grep -P 'alive'" } default: { $wan_command = "consul join -wan ${consul::join_wan}" diff --git a/manifests/windows_service.pp b/manifests/windows_service.pp index a52f8566..0ed0baa0 100644 --- a/manifests/windows_service.pp +++ b/manifests/windows_service.pp @@ -12,42 +12,23 @@ # [*nssm_download_url_base*] # nssm version to download # -class consul::windows_service { +class consul::windows_service ( + $sys32 = 'c:\\windows\\system32', + $service_name = 'Consul' + ) +{ + $executable_file = "${consul::bin_dir}\\${consul::binary_name}" + $service_config = "start= auto binPath= \"${executable_file} agent -config-dir=${$consul::config_dir}\" obj= \"${consul::binary_owner}\"" - $app_dir = regsubst($consul::bin_dir, '\/', '\\', 'G') - $app_exec = "${app_dir}\\consul.exe" - $agent_args = regsubst($consul::config_dir, '\/', '\\', 'G') - $app_args = "agent -config-dir='${agent_args}' ${consul::extra_options}" - $app_log_path = "${app_dir}\\logs" - $app_log_file = 'consul.log' - $app_log = "${app_log_path}//${app_log_file}" - - include 'archive' - - file { $app_log_path: - ensure => 'directory', - owner => 'Administrator', - group => 'Administrators', - mode => '0755', - } - -> exec { 'consul_service_install': - cwd => $consul::bin_dir, - command => "&'${consul::nssm_exec}' install Consul ${app_exec}", - unless => 'if((get-service -name consul -ErrorAction SilentlyContinue).count -ne 1){exit 1}', - logoutput => true, - provider => 'powershell', - notify => Exec['consul_service_set_parameters'], + exec { 'create_consul_service': + command => "sc.exe create ${service_name} ${service_config}", + path => $sys32, + unless => "sc.exe query ${service_name}", } - file { "${consul::bin_dir}/set_service_parameters.ps1": - ensure => 'present', - content => template('consul/set_service_parameters.ps1.erb'), - notify => Exec['consul_service_set_parameters'], - } - -> exec { 'consul_service_set_parameters': - cwd => $consul::bin_dir, - command => "& '${consul::bin_dir}/set_service_parameters.ps1'", + exec { 'update_consul_service': + command => "sc.exe config ${service_name} ${service_config}", + path => $sys32, refreshonly => true, - logoutput => true, - provider => 'powershell', } } + diff --git a/templates/set_service_parameters.ps1.erb b/templates/set_service_parameters.ps1.erb index 257ec7ed..214318f2 100644 --- a/templates/set_service_parameters.ps1.erb +++ b/templates/set_service_parameters.ps1.erb @@ -1,14 +1,14 @@ -& '<%= scope['consul::nssm_exec'] %>' set Consul AppParameters "<%= @app_args %>" -& '<%= scope['consul::nssm_exec'] %>' set Consul AppDirectory "<%= @app_dir %>" -& '<%= scope['consul::nssm_exec'] %>' set Consul AppStopMethodConsole 15000 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppStopMethodSkip 2 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppStopMethodSkip 4 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppStderr "<%= @app_log %>" -& '<%= scope['consul::nssm_exec'] %>' set Consul AppStdout "<%= @app_log %>" -& '<%= scope['consul::nssm_exec'] %>' set Consul AppRotateFiles 1 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppRotateOnline 0 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppRotateBytes 1024000 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppRestartDelay 0 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppExit Default Exit -& '<%= scope['consul::nssm_exec'] %>' set Consul Start SERVICE_AUTO_START -exit 0 +& '<%= scope['consul::nssm_exec'] %>' set Consul AppParameters "<%= @app_args %>" +& '<%= scope['consul::nssm_exec'] %>' set Consul AppDirectory "<%= @app_dir %>" +& '<%= scope['consul::nssm_exec'] %>' set Consul AppStopMethodConsole 15000 +& '<%= scope['consul::nssm_exec'] %>' set Consul AppStopMethodSkip 2 +& '<%= scope['consul::nssm_exec'] %>' set Consul AppStopMethodSkip 4 +& '<%= scope['consul::nssm_exec'] %>' set Consul AppStderr "<%= @app_log %>" +& '<%= scope['consul::nssm_exec'] %>' set Consul AppStdout "<%= @app_log %>" +& '<%= scope['consul::nssm_exec'] %>' set Consul AppRotateFiles 1 +& '<%= scope['consul::nssm_exec'] %>' set Consul AppRotateOnline 0 +& '<%= scope['consul::nssm_exec'] %>' set Consul AppRotateBytes 1024000 +& '<%= scope['consul::nssm_exec'] %>' set Consul AppRestartDelay 0 +& '<%= scope['consul::nssm_exec'] %>' set Consul AppExit Default Exit +& '<%= scope['consul::nssm_exec'] %>' set Consul Start SERVICE_AUTO_START +exit 0 From 9fe77d54add1a8c1984a3152163620a03e47af45 Mon Sep 17 00:00:00 2001 From: krjensen Date: Thu, 24 Jan 2019 09:40:13 +0100 Subject: [PATCH 2/9] Updated class doc --- manifests/init.pp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 61150e4a..6174aa5c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -9,6 +9,17 @@ # # [*arch*] # Architecture of consul binary to download. +# == Class: consul +# +# Installs, configures and manages consul +# +# === Parameters +# +# [*acls*] +# Hash of consul_acl resources to create. +# +# [*arch*] +# Architecture of consul binary to download. # # [*archive_path*] # Path used when installing consul via the url. @@ -128,9 +139,6 @@ # [*user*] # Name of the user that should own the consul configuration files. # -# [*user_password*] -# The password for the user created by the `user` atribute. Default to `` -# # [*version*] # Specify version of consul binary to download. # @@ -139,14 +147,21 @@ # # [*shell*] # The shell for the consul user. Defaults to something that prohibits login, like /usr/sbin/nologin +# # [*enable_beta_ui*] -# consul 1.1.0 introduced a new UI, which is currently (2018-05-12) in beta status. You can enable it by setting this variable to true. Defaults to false +# consul 1.1.0 introduced a new UI, which is currently (2018-05-12) in beta status. +# You can enable it by setting this variable to true. Defaults to false +# # [*allow_binding_to_root_ports*] # Boolean, enables CAP_NET_BIND_SERVICE if true. This is currently only implemented on systemd nodes +# +# [*log_file*] +# String, where should the log file be located +# # === Examples # # @example -# class { '::consul': +# class { 'consul': # config_hash => { # 'datacenter' => 'east-aws', # 'node_name' => $::fqdn, From 602985fcf2b125192dcb69e774c9e9f2813ee754 Mon Sep 17 00:00:00 2001 From: krjensen Date: Thu, 24 Jan 2019 09:46:57 +0100 Subject: [PATCH 3/9] Update from master --- manifests/init.pp | 15 --------------- manifests/params.pp | 7 ++++--- manifests/run_service.pp | 6 +++--- manifests/windows_service.pp | 11 ++++------- templates/set_service_parameters.ps1.erb | 14 -------------- 5 files changed, 11 insertions(+), 42 deletions(-) delete mode 100644 templates/set_service_parameters.ps1.erb diff --git a/manifests/init.pp b/manifests/init.pp index 6174aa5c..908c2587 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -9,17 +9,6 @@ # # [*arch*] # Architecture of consul binary to download. -# == Class: consul -# -# Installs, configures and manages consul -# -# === Parameters -# -# [*acls*] -# Hash of consul_acl resources to create. -# -# [*arch*] -# Architecture of consul binary to download. # # [*archive_path*] # Path used when installing consul via the url. @@ -98,9 +87,6 @@ # [*manage_user*] # Whether to create/manage the user that should own consul's configuration files. # -# [*nssm_exec*] -# Location of nssm windows binary for service management -# # [*os*] # OS component in the name of the archive file containing the consul binary. # @@ -198,7 +184,6 @@ Boolean $manage_group = $consul::params::manage_group, Boolean $manage_service = $consul::params::manage_service, Boolean $manage_user = $consul::params::manage_user, - Optional[String] $nssm_exec = undef, $os = $consul::params::os, $package_ensure = $consul::params::package_ensure, $package_name = $consul::params::package_name, diff --git a/manifests/params.pp b/manifests/params.pp index 9fad64a0..73862f86 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -5,7 +5,7 @@ # class consul::params { $acls = {} - $archive_path = '' + $archive_path = '' #lint:ignore:empty_string_assignment $bin_dir = '/usr/local/bin' $checks = {} $config_defaults = {} @@ -15,7 +15,7 @@ $download_extension = 'zip' $download_url_base = 'https://releases.hashicorp.com/consul/' $extra_groups = [] - $extra_options = '' + $extra_options = '' #lint:ignore:empty_string_assignment $group = 'consul' $log_file = '/var/log/consul' $install_method = 'url' @@ -32,6 +32,7 @@ $service_enable = true $service_ensure = 'running' $services = {} + $service_config_hash = {} $user = 'consul' $version = '1.2.3' $watches = {} @@ -96,7 +97,7 @@ } } - if $facts['operatingsystem'] == 'windows' { + if $facts['os']['family'] == 'windows' { $init_style = 'unmanaged' } else { $init_style = $facts['service_provider'] ? { diff --git a/manifests/run_service.pp b/manifests/run_service.pp index fc94e944..9d6f5f0c 100644 --- a/manifests/run_service.pp +++ b/manifests/run_service.pp @@ -40,16 +40,16 @@ docker::run { 'consul': image => "${consul::docker_image}:${consul::version}", net => 'host', - volumes => [ "${::consul::config_dir}:/consul/config", "${::consul::data_dir}:/consul/data" ], + volumes => [ "${consul::config_dir}:/consul/config", "${consul::data_dir}:/consul/data" ], env => $env, - command => $docker_command + command => $docker_command, } } case $consul::install_method { 'docker': { $wan_command = "docker exec consul consul join -wan ${consul::join_wan}" - $wan_unless = "docker exec consul consul members -wan -detailed | grep -vP \"dc=${consul::config_hash_real['datacenter']}\" | grep -P 'alive'" + $wan_unless = "docker exec consul consul members -wan -detailed | grep -vP \"dc=${consul::config_hash_real['datacenter']}\" | grep -P 'alive'" #lint:ignore:140chars } default: { $wan_command = "consul join -wan ${consul::join_wan}" diff --git a/manifests/windows_service.pp b/manifests/windows_service.pp index 0ed0baa0..c3da826a 100644 --- a/manifests/windows_service.pp +++ b/manifests/windows_service.pp @@ -3,14 +3,11 @@ # Installs consul windows server # == Parameters # -# [*nssm_version*] -# nssm version to download +# [*sys32*] +# path to system32 folder # -# [*nssm_download_url*] -# nssm version to download -# -# [*nssm_download_url_base*] -# nssm version to download +# [*service_name*] +# Name of the service # class consul::windows_service ( $sys32 = 'c:\\windows\\system32', diff --git a/templates/set_service_parameters.ps1.erb b/templates/set_service_parameters.ps1.erb deleted file mode 100644 index 214318f2..00000000 --- a/templates/set_service_parameters.ps1.erb +++ /dev/null @@ -1,14 +0,0 @@ -& '<%= scope['consul::nssm_exec'] %>' set Consul AppParameters "<%= @app_args %>" -& '<%= scope['consul::nssm_exec'] %>' set Consul AppDirectory "<%= @app_dir %>" -& '<%= scope['consul::nssm_exec'] %>' set Consul AppStopMethodConsole 15000 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppStopMethodSkip 2 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppStopMethodSkip 4 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppStderr "<%= @app_log %>" -& '<%= scope['consul::nssm_exec'] %>' set Consul AppStdout "<%= @app_log %>" -& '<%= scope['consul::nssm_exec'] %>' set Consul AppRotateFiles 1 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppRotateOnline 0 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppRotateBytes 1024000 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppRestartDelay 0 -& '<%= scope['consul::nssm_exec'] %>' set Consul AppExit Default Exit -& '<%= scope['consul::nssm_exec'] %>' set Consul Start SERVICE_AUTO_START -exit 0 From d3b0efbb66ca421fa4c4ed359ebcd97978b9cdd2 Mon Sep 17 00:00:00 2001 From: krjensen Date: Thu, 24 Jan 2019 09:49:39 +0100 Subject: [PATCH 4/9] Moved init_style windows --- manifests/init.pp | 6 +----- manifests/params.pp | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 908c2587..5dbdb106 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -214,11 +214,7 @@ $group_real = undef $init_style_real = 'unmanaged' } - elsif $::operatingsystem == 'windows' { - $user_real = $user - $group_real = $group - $init_style_real = 'windows' - } else { + else { $user_real = $user $group_real = $group $init_style_real = $init_style diff --git a/manifests/params.pp b/manifests/params.pp index 73862f86..1356e76f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -98,7 +98,7 @@ } if $facts['os']['family'] == 'windows' { - $init_style = 'unmanaged' + $init_style = 'windows' } else { $init_style = $facts['service_provider'] ? { undef => 'systemd', From 173ccf6bd632788db12406b599b74ea8fb4e6f76 Mon Sep 17 00:00:00 2001 From: krjensen Date: Thu, 24 Jan 2019 09:54:00 +0100 Subject: [PATCH 5/9] Moved windows_service to run_service --- manifests/params.pp | 2 +- manifests/run_service.pp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 1356e76f..73862f86 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -98,7 +98,7 @@ } if $facts['os']['family'] == 'windows' { - $init_style = 'windows' + $init_style = 'unmanaged' } else { $init_style = $facts['service_provider'] ? { undef => 'systemd', diff --git a/manifests/run_service.pp b/manifests/run_service.pp index 9d6f5f0c..c7ada6f2 100644 --- a/manifests/run_service.pp +++ b/manifests/run_service.pp @@ -16,6 +16,11 @@ } if $consul::manage_service == true and $consul::install_method != 'docker' { + if $::operatingsystem == 'windows' { + class { 'consul::windows_service': + before => Service['consul'], + } + } service { 'consul': ensure => $consul::service_ensure, name => $service_name, From 5f8c12f2ee7ff24d8271869e6eb8b045c69a9ce5 Mon Sep 17 00:00:00 2001 From: krjensen Date: Thu, 24 Jan 2019 09:55:51 +0100 Subject: [PATCH 6/9] Making ready for merge --- manifests/params.pp | 4 ++-- manifests/run_service.pp | 1 + manifests/windows_service.pp | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 73862f86..bc8fcec6 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -5,7 +5,7 @@ # class consul::params { $acls = {} - $archive_path = '' #lint:ignore:empty_string_assignment + $archive_path = '' #lint:ignore:empty_string_assignment $bin_dir = '/usr/local/bin' $checks = {} $config_defaults = {} @@ -15,7 +15,7 @@ $download_extension = 'zip' $download_url_base = 'https://releases.hashicorp.com/consul/' $extra_groups = [] - $extra_options = '' #lint:ignore:empty_string_assignment + $extra_options = '' #lint:ignore:empty_string_assignment $group = 'consul' $log_file = '/var/log/consul' $install_method = 'url' diff --git a/manifests/run_service.pp b/manifests/run_service.pp index c7ada6f2..4ba3b73a 100644 --- a/manifests/run_service.pp +++ b/manifests/run_service.pp @@ -21,6 +21,7 @@ before => Service['consul'], } } + service { 'consul': ensure => $consul::service_ensure, name => $service_name, diff --git a/manifests/windows_service.pp b/manifests/windows_service.pp index c3da826a..d71ecceb 100644 --- a/manifests/windows_service.pp +++ b/manifests/windows_service.pp @@ -28,4 +28,3 @@ refreshonly => true, } } - From 94c95b705f4e2f33287b17a8033daa3dc23dcbe5 Mon Sep 17 00:00:00 2001 From: krjensen Date: Thu, 24 Jan 2019 10:08:30 +0100 Subject: [PATCH 7/9] Set some default for windows --- manifests/params.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifests/params.pp b/manifests/params.pp index bc8fcec6..e0cc98c7 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -62,6 +62,10 @@ $binary_mode = '0775' $binary_name = 'consul.exe' $binary_owner = 'NT AUTHORITY\NETWORK SERVICE' + $manage_user = false + $manage_group = false + $user = 'NT AUTHORITY\NETWORK SERVICE' + $group = 'Administrators' } default: { # 0 instead of root because OS X uses "wheel". From 482bf651e8aa68e85d7799484cc259e21d78b74d Mon Sep 17 00:00:00 2001 From: krjensen Date: Thu, 24 Jan 2019 10:18:34 +0100 Subject: [PATCH 8/9] Set widnows default paths --- manifests/params.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index e0cc98c7..1774bca2 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -6,7 +6,6 @@ class consul::params { $acls = {} $archive_path = '' #lint:ignore:empty_string_assignment - $bin_dir = '/usr/local/bin' $checks = {} $config_defaults = {} $config_hash = {} @@ -49,10 +48,15 @@ $config_dir = $facts['os']['family'] ? { 'FreeBSD' => '/usr/local/etc/consul.d', - 'windows' => 'c:/Consul/config', + 'windows' => 'C:\\ProgramData\\consul\\config', default => '/etc/consul' } + $bin_dir = $facts['os']['family'] ? { + 'windows' => 'C:\\ProgramData\\consul', + default => '/usr/local/bin' + } + $os = downcase($facts['kernel']) case $facts['os']['name'] { From d08516ca9bcfcde25f5bf2b5a6c5895aa0d51e45 Mon Sep 17 00:00:00 2001 From: krjensen Date: Thu, 24 Jan 2019 10:40:45 +0100 Subject: [PATCH 9/9] Updated params --- manifests/params.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 1774bca2..390a2d36 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -15,13 +15,10 @@ $download_url_base = 'https://releases.hashicorp.com/consul/' $extra_groups = [] $extra_options = '' #lint:ignore:empty_string_assignment - $group = 'consul' $log_file = '/var/log/consul' $install_method = 'url' $join_wan = false - $manage_group = true $manage_service = true - $manage_user = true $package_ensure = 'latest' $package_name = 'consul' $pretty_config = false @@ -32,7 +29,6 @@ $service_ensure = 'running' $services = {} $service_config_hash = {} - $user = 'consul' $version = '1.2.3' $watches = {} @@ -78,6 +74,10 @@ $binary_mode = '0555' $binary_name = 'consul' $binary_owner = 'root' + $manage_user = true + $manage_group = true + $user = 'consul' + $group = 'consul' } }