Skip to content

Commit

Permalink
rename to ledgerdb
Browse files Browse the repository at this point in the history
  • Loading branch information
akerl committed Nov 29, 2024
1 parent 59be5f0 commit ff8bdca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# @param ledger_repo is the git repo for ledger data
# @param ledger_ssh_key is the ssh key to use to update the repo
# @param ledger_file is the main ledger file to load, relative to the repo root
# @param version sets the ledgersql tag to use
# @param version sets the ledgerdb tag to use
# @param postgres_ip sets the address of the postgres Docker container
# @param user sets the user to run ledgersql as
# @param user sets the user to run ledgerdb as
# @param bootdelay sets how long to wait before first run
# @param frequency sets how often to run updates
class ledgerdb (
Expand All @@ -20,7 +20,7 @@
String $ledger_file = 'core.ldg',
String $version = 'v0.0.10',
String $postgres_ip = '172.17.0.3',
String $user = 'ledgersql',
String $user = 'ledgerdb',
String $bootdelay = '300',
String $frequency = '300'
) {
Expand Down Expand Up @@ -105,26 +105,26 @@
default => 'error',
}

$binfile = '/usr/local/bin/ledgersql'
$filename = "ledgersql_${downcase($facts['kernel'])}_${arch}"
$url = "https://github.com/akerl/ledgersql/releases/download/${version}/${filename}"
$binfile = '/usr/local/bin/ledgerdb'
$filename = "ledgerdb_${downcase($facts['kernel'])}_${arch}"
$url = "https://github.com/akerl/ledgerdb/releases/download/${version}/${filename}"

exec { 'download ledgersql':
exec { 'download ledgerdb':
command => "/usr/bin/curl -sLo '${binfile}' '${url}' && chmod a+x '${binfile}'",
unless => "/usr/bin/test -f ${binfile} && ${binfile} version | grep '${version}'",
}

file { '/etc/systemd/system/ledgersql.service':
file { '/etc/systemd/system/ledgerdb.service':
ensure => file,
content => template('ledgerdb/ledgersql.service.erb'),
content => template('ledgerdb/ledgerdb.service.erb'),
}

file { '/etc/systemd/system/ledgersql.timer':
file { '/etc/systemd/system/ledgerdb.timer':
ensure => file,
content => template('ledgerdb/ledgersql.timer.erb'),
content => template('ledgerdb/ledgerdb.timer.erb'),
}

~> service { 'ledgersql.timer':
~> service { 'ledgerdb.timer':
ensure => running,
enable => true,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ StartLimitIntervalSec=271
[Service]
Type=simple
User=<%= @user %>
ExecStart=/usr/local/bin/ledgersql sync <%= @datadir %>/config.yaml
ExecStart=/usr/local/bin/ledgerdb sync <%= @datadir %>/config.yaml
Restart=on-failure
RestartSec=90
File renamed without changes.

0 comments on commit ff8bdca

Please sign in to comment.