generate systemd for postgres

This commit is contained in:
Artur Gurgul1 2025-08-07 14:23:42 +02:00
parent ed7fc9aa7f
commit 29a9b08573
4 changed files with 63 additions and 24 deletions

View file

@ -1,7 +1,9 @@
module Setup
require_relative '../templates'
# dat execute postgres
# example.rcp
module PostgreSQL
extend Templates
@ -9,26 +11,25 @@ module Setup
# attr_accessor :te
def self.init_db
def self.init_db(context)
system(" -D /opt/pgsql/16/data")
end
def self.make_config
pg_hba = render("pg_hba.conf")
# test = render("test", te: "This is a test string")
posgresql_conf = render("postgresql")
def self.install(context)
# puts context.bin_dir
#make_config
# pg_hba = render("pg_hba.conf")
#
# # test = render("test", te: "This is a test string")
# posgresql_conf = render("postgresql")
service = render(
"postgresql.service",
prefix: "/pkg/postgresql/REL_17_5/",
version: "16.5",
data_url: "/data/postgresql/16/"
postgres_bin: File.join(context.bin_dir, "/bin/postgres"),
version: context.version,
database_dir: context.data_dir
)
puts test
end
def self.install
make_config
puts service
end
end
end