From 7fa1b4a2e2bd48cc549bfa1f2c147f4995140a0f Mon Sep 17 00:00:00 2001 From: Les Aker Date: Thu, 28 Nov 2024 14:10:37 -0500 Subject: [PATCH] use template for config file --- manifests/init.pp | 4 ++-- templates/config.yaml.erb | 2 +- files/ledgersql.service => templates/ledgersql.service.erb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename files/ledgersql.service => templates/ledgersql.service.erb (71%) diff --git a/manifests/init.pp b/manifests/init.pp index 277a4c8..e7f4b9a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -113,8 +113,8 @@ } file { '/etc/systemd/system/ledgersql.service': - ensure => file, - source => 'puppet:///modules/ledgerdb/ledgersql.service', + ensure => file, + content => template('ledgerdb/ledgersql.service.erb'), } file { '/etc/systemd/system/ledgersql.timer': diff --git a/templates/config.yaml.erb b/templates/config.yaml.erb index 602834e..d5a7361 100644 --- a/templates/config.yaml.erb +++ b/templates/config.yaml.erb @@ -1,3 +1,3 @@ -data_dir: <%= @data_dir %> +data_dir: <%= @datadir %> database_password: <%= @database_password %> database_host: <%= @postgres_ip %> diff --git a/files/ledgersql.service b/templates/ledgersql.service.erb similarity index 71% rename from files/ledgersql.service rename to templates/ledgersql.service.erb index fbacc04..2a0566e 100644 --- a/files/ledgersql.service +++ b/templates/ledgersql.service.erb @@ -6,6 +6,6 @@ StartLimitIntervalSec=271 [Service] Type=simple User=slackmastodon -ExecStart=/usr/local/bin/ledgersql +ExecStart=/usr/local/bin/ledgersql sync <%= @datadir %>/config.yaml Restart=on-failure RestartSec=90