diff --git a/manifests/init.pp b/manifests/init.pp index c59d16e..a3e87d1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 ( @@ -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' ) { @@ -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, } diff --git a/templates/ledgersql.service.erb b/templates/ledgerdb.service.db similarity index 71% rename from templates/ledgersql.service.erb rename to templates/ledgerdb.service.db index 3162f6d..9bec3ac 100644 --- a/templates/ledgersql.service.erb +++ b/templates/ledgerdb.service.db @@ -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 diff --git a/templates/ledgersql.timer.erb b/templates/ledgerdb.timer.erb similarity index 100% rename from templates/ledgersql.timer.erb rename to templates/ledgerdb.timer.erb