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

Allow consumers to sepecify working directory. #255

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
# @param user User to own `JBOSS_HOME`. If `manage_user` is `true`, this user will be managed.
# @param user_home User home directory. Defaults to '/home/wildfly'
# @param version Sets the Wildfly version managed in order to handle small differences among versions.
# @param working_dir Sets the working directory for the service.
class wildfly(
Pattern[/^(\d{1,}\.\d{1,}(\.\d{1,})?$)/] $version = '9.0.2',
Variant[Pattern[/^file:\/\//], Pattern[/^puppet:\/\//], Stdlib::Httpsurl, Stdlib::Httpurl] $install_source = "http://download.jboss.org/wildfly/${version}.Final/wildfly-${version}.Final.tar.gz",
Expand Down Expand Up @@ -111,6 +112,7 @@
Optional[String] $java_opts = undef,
Optional[String] $jboss_opts = undef,
Optional[String] $overlay_class = undef,
Optional[Stdlib::Unixpath] $working_dir = undef,
) {

contain wildfly::prepare
Expand Down
3 changes: 3 additions & 0 deletions templates/wildfly.systemd.service.epp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ LimitNOFILE=102642
ExecStart=<%= $wildfly::dirname %>/bin/launch.sh ${WILDFLY_MODE} ${WILDFLY_CONFIG}
Restart=always
RestartSec=20
<%- if $wildfly::working_dir {-%>
WorkingDirectory=<%= $wildfly::working_dir %>
<%- } -%>

[Install]
WantedBy=multi-user.target
3 changes: 3 additions & 0 deletions templates/wildfly.sysvinit.service.epp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ After=syslog.target network.target
Type=forking
ExecStart=/etc/init.d/<%= $wildfly::service::service_name %> start
ExecStop=/etc/init.d/<%= $wildfly::service::service_name %> stop
<%- if $wildfly::working_dir {-%>
WorkingDirectory=<%= $wildfly::working_dir %>
<%- } -%>

[Install]
WantedBy=multi-user.target