Skip to content

Commit

Permalink
Add manage_homedir parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Joris VAN ACOLEYEN committed Jan 6, 2025
1 parent 4e27bb4 commit 71b77d2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ The following parameters are available in the `jira` class:
* [`product`](#-jira--product)
* [`installdir`](#-jira--installdir)
* [`homedir`](#-jira--homedir)
* [`manage_homedir`](#-jira--manage_homedir)
* [`manage_user`](#-jira--manage_user)
* [`user`](#-jira--user)
* [`group`](#-jira--group)
Expand Down Expand Up @@ -205,6 +206,14 @@ The directory for JIRA's runtime data that persists between versions.

Default value: `'/home/jira'`

##### <a name="-jira--manage_homedir"></a>`manage_homedir`

Data type: `Boolean`

Whether to manage the homedir

Default value: `true`

##### <a name="-jira--manage_user"></a>`manage_user`

Data type: `Boolean`
Expand Down
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
# The directory in which JIRA software packages will be extracted
# @param homedir
# The directory for JIRA's runtime data that persists between versions.
# @param manage_homedir
# Whether to manage the homedir
# @param manage_user
# Whether to manage the service user
# @param user
Expand Down Expand Up @@ -288,6 +290,7 @@
String[1] $product = 'jira',
Stdlib::Absolutepath $installdir = '/opt/jira',
Stdlib::Absolutepath $homedir = '/home/jira',
Boolean $manage_homedir = true,
Boolean $manage_user = true,
String $user = 'jira',
String $group = 'jira',
Expand Down
12 changes: 7 additions & 5 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
}
}

file { $jira::homedir:
ensure => 'directory',
owner => $jira::user,
group => $jira::group,
mode => $jira::homedir_mode,
if $jira::manage_homedir {
file { $jira::homedir:
ensure => 'directory',
owner => $jira::user,
group => $jira::group,
mode => $jira::homedir_mode,
}
}

if ! defined(File[$jira::installdir]) {
Expand Down

0 comments on commit 71b77d2

Please sign in to comment.