Create a simpleproxy user

Previously this depended on other things creating a logstash user which
would enable this service to run. There is no logstash user created on
these hosts any longer and it was bad to rely on that side effect of
colocation anyways. Fix this by creating a user just for this service.

Change-Id: I6b0779552d3c47f3bf27b1548599cfc6e9461dcb
This commit is contained in:
Clark Boylan 2016-05-27 10:40:05 -07:00
parent 7ec790d918
commit 7e8b03762f
2 changed files with 32 additions and 15 deletions

View File

@ -15,23 +15,40 @@
# == Class: simpleproxy
#
class simpleproxy {
package { 'mysql-proxy':
ensure => absent,
}
package { 'mysql-proxy':
ensure => absent,
}
file { '/etc/mysql-proxy':
ensure => absent,
recurse => true,
force => true,
}
file { '/etc/mysql-proxy':
ensure => absent,
recurse => true,
force => true,
}
file { '/etc/default/mysql-proxy':
ensure => absent,
}
file { '/etc/default/mysql-proxy':
ensure => absent,
}
package { 'simpleproxy':
ensure => latest,
}
package { 'simpleproxy':
ensure => latest,
}
group { 'simpleproxy':
ensure => present,
system => true,
}
user { 'simpleproxy':
ensure => present,
system => true,
comment => 'Simple Proxy User',
home => '/usr/share/doc/simpleproxy',
gid => 'simpleproxy',
shell => '/bin/bash',
membership => 'minimum',
require => [
Group['simpleproxy'],
Package['simpleproxy'],
],
}
}

View File

@ -18,7 +18,7 @@ NAME=simpleproxy-mysql
DAEMON=/usr/bin/simpleproxy
DAEMON_ARGS="-L<%= @db_port %> -R <%= @db_host %>:<%= @db_port %> -d"
SCRIPTNAME=/etc/init.d/$NAME
USER=logstash
USER=simpleproxy
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0