Defined Type: wildfly::config::user

Defined in:
manifests/config/user.pp

Overview

Generic Wildfly user management.

Parameters:

  • password (Any)
  • file_name (Any)


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'manifests/config/user.pp', line 3

define wildfly::config::user(
  $password,
  $file_name,
) {

  $user_info = split($title, ':')
  $username = $user_info[0]
  $realm = $user_info[1]

  $password_hash = inline_template('<%= require \'digest/md5\'; Digest::MD5.hexdigest("#{@username}:#{@realm}:#{@password}") %>')

  require wildfly::install

  file_line { "${username}:${realm}":
    path   => "${wildfly::dirname}/${wildfly::mode}/configuration/${file_name}",
    line   => "${username}=${password_hash}",
    match  => "^${username}=.*\$",
    notify => Service['wildfly'],
  }
}