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

add binary_path #24

Open
wants to merge 1 commit 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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ to be in `tar.gz` format.

The sha1 format checksum of the `source` file.

##### `binary_path`

`String` defaults to: `bin/oauth2_proxy`

Path to binary execution filename in archive.

### Defines

#### `oauth2_proxy::instance`
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$manage_group = $::oauth2_proxy::params::manage_group,
$install_root = $::oauth2_proxy::params::install_root,
$source = $::oauth2_proxy::params::source,
$binary_path = $::oauth2_proxy::params::binary_path,
$checksum = $::oauth2_proxy::params::checksum,
$systemd_path = $::oauth2_proxy::params::systemd_path,
$shell = $::oauth2_proxy::params::shell,
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$tarball = "oauth2_proxy-${version}.linux-amd64.go1.6.tar.gz"
$source = "https://github.com/bitly/oauth2_proxy/releases/download/v${version}/${tarball}"
$checksum = '7a74b361f9edda0400d02602eacd70596d85b453'

$binary_path = 'bin/oauth2_proxy'
# in theory, this module should work on any linux distro that uses systemd
# but it has only been tested on el7
case $::osfamily {
Expand Down
4 changes: 2 additions & 2 deletions templates/oauth2_proxy.init.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ respawn limit 10 5
console log

script
exec start-stop-daemon --start --make-pidfile --pidfile /var/run/oauth2_proxy@<%= @title %>.pid --chuid <%= scope['::oauth2_proxy::user'] %>:<%= scope['::oauth2_proxy::group'] %> --chdir /opt/oauth2_proxy --startas /bin/bash -- -c "exec <%= scope['::oauth2_proxy::install_root'] %>/bin/oauth2_proxy -config="/etc/oauth2_proxy/<%= @title %>.conf" &>> /var/log/oauth2_proxy/<%= @title %>.log"
#exec <%= scope['::oauth2_proxy::install_root'] %>/bin/oauth2_proxy -config="/etc/oauth2_proxy/<%= @title %>.conf" &>> /var/log/oauth2_proxy/<%= @title %>.log
exec start-stop-daemon --start --make-pidfile --pidfile /var/run/oauth2_proxy@<%= @title %>.pid --chuid <%= scope['::oauth2_proxy::user'] %>:<%= scope['::oauth2_proxy::group'] %> --chdir /opt/oauth2_proxy --startas /bin/bash -- -c "exec <%= scope['::oauth2_proxy::install_root'] %>/<%= scope['::oauth2_proxy::binary_path'] %> -config="/etc/oauth2_proxy/<%= @title %>.conf" &>> /var/log/oauth2_proxy/<%= @title %>.log"
#exec <%= scope['::oauth2_proxy::install_root'] %>/<%= scope['::oauth2_proxy::binary_path'] %> -config="/etc/oauth2_proxy/<%= @title %>.conf" &>> /var/log/oauth2_proxy/<%= @title %>.log
end script

pre-start script
Expand Down
2 changes: 1 addition & 1 deletion templates/oauth2_proxy.initd.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="oauth2_proxy@<%= @title %>"
NAME="oauth2_proxy@<%= @title %>"
DAEMON="<%= scope['::oauth2_proxy::install_root'] %>/bin/oauth2_proxy"
DAEMON="<%= scope['::oauth2_proxy::install_root'] %>/<%= scope['::oauth2_proxy::binary_path'] %>"
PIDFILE=/var/run/$NAME.pid
LOGFILE=/var/log/oauth2_proxy/<%= @title %>.log
SCRIPTNAME=/etc/init.d/$NAME
Expand Down
4 changes: 2 additions & 2 deletions templates/[email protected]
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[Unit]
Description=OAuth2 Proxy
Description=OAuth2 Proxy %i

[Service]
User=<%= scope['::oauth2_proxy::user'] %>
Group=<%= scope['::oauth2_proxy::group'] %>
ExecStart=<%= scope['::oauth2_proxy::install_root'] %>/bin/oauth2_proxy --config=/etc/oauth2_proxy/%i.conf
ExecStart=<%= scope['::oauth2_proxy::install_root'] %>/<%= scope['::oauth2_proxy::binary_path'] %> --config=/etc/oauth2_proxy/%i.conf
Restart=always

[Install]
Expand Down