Puppet Class: wildfly::prepare

Defined in:
manifests/prepare.pp

Overview

Manages Wildfly requirements (user, group, dirs and packages)



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'manifests/prepare.pp', line 2

class wildfly::prepare {
  if $wildfly::manage_user {
    group { $wildfly::group :
      ensure => present,
      gid    => $wildfly::gid,
    }

    user { $wildfly::user :
      ensure     => present,
      uid        => $wildfly::uid,
      gid        => $wildfly::gid,
      groups     => $wildfly::group,
      shell      => '/bin/bash',
      home       => $wildfly::user_home,
      comment    => "${wildfly::user} user created by Puppet",
      managehome => true,
      require    => Group[$wildfly::group],
    }
  }

  unless $wildfly::package_name {
    file { $wildfly::dirname :
      ensure  => directory,
      owner   => $wildfly::user,
      group   => $wildfly::group,
      mode    => '0755',
      require => User[$wildfly::user],
    }
  }

  if $wildfly::package_ensure {
    $libaiopackage  = $facts['os']['family'] ? {
      'RedHat' => 'libaio',
      'Debian' => 'libaio1',
      default  => 'libaio',
    }

    ensure_packages({ $libaiopackage => { 'ensure' => $wildfly::package_ensure } })
  }
}