]> xn--ix-yja.es Git - alex.git/commitdiff
Install postgres
authoralex <alex@pdp7.net>
Sat, 4 Mar 2023 17:54:23 +0000 (18:54 +0100)
committeralex <alex@pdp7.net>
Sat, 4 Mar 2023 17:54:23 +0000 (18:54 +0100)
personal_infra/puppet/modules/postgres/manifests/init.pp [new file with mode: 0644]
personal_infra/puppet/site/pg.h1.int.pdp7.net.pp

diff --git a/personal_infra/puppet/modules/postgres/manifests/init.pp b/personal_infra/puppet/modules/postgres/manifests/init.pp
new file mode 100644 (file)
index 0000000..5213db6
--- /dev/null
@@ -0,0 +1,16 @@
+class postgres {
+  package {'pgdg-redhat-repo':
+    source => 'https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm',
+  }
+  ->
+  package {'postgresql15-server':}
+  ->
+  exec {'/usr/pgsql-15/bin/postgresql-15-setup initdb':
+    creates => '/var/lib/pgsql/15/data/PG_VERSION',
+  }
+  ->
+  service {'postgresql-15':
+    ensure => running,
+    enable => true,
+  }
+}
index 11c0eab6b9033882ddb19bf73dade043847f77ee..b964548b06c10babc61a88ec7336a3e31e305f9a 100644 (file)
@@ -1,2 +1,3 @@
 node 'pg.h1.int.pdp7.net' {
+  class {'postgres':}
 }