Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manage user support #53

Merged
merged 2 commits into from
Apr 9, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
# Default is `true`.
# @param service_java_opts
# Sets additional options to Java virtual machine environment variable.
# @param manage_user
# Defines if the module should manage the Linux user for Keycloak installation
# @param user
# Keycloak user name.
# Default is `keycloak`.
Expand Down Expand Up @@ -148,6 +150,7 @@
Boolean $service_hasrestart = $keycloak::params::service_hasrestart,
Optional[Variant[String, Array]]
$service_java_opts = undef,
Boolean $manage_user = true,
String $user = 'keycloak',
String $group = 'keycloak',
Optional[Integer] $user_uid = undef,
Expand Down Expand Up @@ -185,7 +188,7 @@
Boolean $manage_sssd_config = true,
Array $sssd_ifp_user_attributes = [],
Boolean $restart_sssd = true,
Optional[Stdlib::Absolutepath] $service_environment_file = undef
Optional[Stdlib::Absolutepath] $service_environment_file = undef,
) inherits keycloak::params {

$download_url = pick($package_url, "https://downloads.jboss.org/keycloak/${version}/keycloak-${version}.tar.gz")
Expand Down
39 changes: 19 additions & 20 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
class keycloak::install {
assert_private()

user { 'keycloak':
ensure => 'present',
name => $keycloak::user,
forcelocal => true,
shell => $keycloak::user_shell,
gid => $keycloak::group,
uid => $keycloak::user_uid,
home => '/var/lib/keycloak',
managehome => true,
if $keycloak::manage_user {
user { 'keycloak':
ensure => 'present',
name => $keycloak::user,
forcelocal => true,
shell => $keycloak::user_shell,
gid => $keycloak::group,
uid => $keycloak::user_uid,
home => '/var/lib/keycloak',
managehome => true,
}
group { 'keycloak':
ensure => 'present',
name => $keycloak::group,
forcelocal => true,
gid => $keycloak::group_gid,
}
}

group { 'keycloak':
ensure => 'present',
name => $keycloak::group,
forcelocal => true,
gid => $keycloak::group_gid,
}

file { "${keycloak::install_dir}/keycloak-${keycloak::version}":
ensure => 'directory',
owner => $keycloak::user,
Expand All @@ -35,8 +35,7 @@
source => $keycloak::download_url,
creates => "${keycloak::install_dir}/keycloak-${keycloak::version}/bin",
cleanup => true,
user => 'keycloak',
group => 'keycloak',
user => $keycloak::user,
group => $keycloak::user,
treydock marked this conversation as resolved.
Show resolved Hide resolved
}

}