postgresql_key -> postgres_key
authorPeter Palfrader <peter@palfrader.org>
Sat, 7 Sep 2019 15:23:56 +0000 (17:23 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sat, 7 Sep 2019 15:23:56 +0000 (17:23 +0200)
modules/debian_org/lib/facter/roleaccounts.rb
modules/postgres/manifests/backup_server/register_backup_clienthost.pp
modules/postgres/manifests/backup_source.pp
spec/octocatalog/facts/godard.debian.org.json
spec/octocatalog/facts/sibelius.debian.org.json

index f00623f..fc6a620 100644 (file)
@@ -1,7 +1,7 @@
 begin
     require 'etc'
 
-    %w{git}.each do |user|
+    %w{git postgres}.each do |user|
         Facter.add("#{user}_user_exists") do
             setcode do
                 result = false
@@ -33,17 +33,6 @@ begin
         end
     end
 
-    Facter.add("postgresql_key") do
-        setcode do
-            key = nil
-            keyfile = '/var/lib/postgresql/.ssh/id_rsa.pub'
-            if FileTest.exist?(keyfile)
-                key = File.open(keyfile).read.chomp
-            end
-            key
-        end
-    end
-
     Facter.add("staticsync_key") do
         setcode do
             key = nil
index e6c27d1..189d371 100644 (file)
@@ -1,6 +1,6 @@
 #
 define postgres::backup_server::register_backup_clienthost (
-  $sshpubkey = $::postgresql_key,
+  $sshpubkey = $::postgres_key,
   $ipaddrlist = join(getfromhash($site::nodeinfo, 'ldap', 'ipHostNumber'), ","),
   $hostname = $::hostname,
 ) {
index 04a324d..d67f675 100644 (file)
@@ -14,8 +14,8 @@ class postgres::backup_source {
                content => template('roles/postgresql_server/pg-backup-file.conf.erb'),
        }
 
-       if ! $::postgresql_key {
-               exec { 'create-postgresql-key':
+       if ! $::postgres_key {
+               exec { 'create-postgres-key':
                        command => '/bin/su - postgres -c \'mkdir -p -m 02700 .ssh && ssh-keygen -C "`whoami`@`hostname` (`date +%Y-%m-%d`)" -P "" -f .ssh/id_rsa -q\'',
                        onlyif  => '/usr/bin/getent passwd postgres > /dev/null && ! [ -e /var/lib/postgresql/.ssh/id_rsa ]'
                }
index 3d59924..5243599 100644 (file)
   "mptraid": false,
   "aacraid": false,
   "swraid": false,
-  "postgresql_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1eOzsdKsfcHFyn4fimLNeT8+KhtDqtRceH71j6k3yBUzsNzdQyjx+iSNONRLB7VYGuhRI8o1uZ4kLnpVZLDBGswBKg8Ndf89l36Fsw3BtCsgGITALWKPJ3mW3YToofbQtq9NWY9bkjA4KoUmIK4c/BJzdX6TvF8H1lWvsdphONe6p8Po3USvo5VQaQcxWzPcGlzKwsaX4djn+UVVPr+CsCZqXW9SOFxOEZEDCn4hIiJnVzh1/r0aOJfFWXrXRLmGX1CJwMUCUVZc4g39mPFfEzh0gWxPmMSP5Q0vsYK7RgQH+JKdmxYiqasfY06px87Wp5Xl2+UzToHUURSOnM+s3 postgres@godard (2017-09-01)",
+  "postgres_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1eOzsdKsfcHFyn4fimLNeT8+KhtDqtRceH71j6k3yBUzsNzdQyjx+iSNONRLB7VYGuhRI8o1uZ4kLnpVZLDBGswBKg8Ndf89l36Fsw3BtCsgGITALWKPJ3mW3YToofbQtq9NWY9bkjA4KoUmIK4c/BJzdX6TvF8H1lWvsdphONe6p8Po3USvo5VQaQcxWzPcGlzKwsaX4djn+UVVPr+CsCZqXW9SOFxOEZEDCn4hIiJnVzh1/r0aOJfFWXrXRLmGX1CJwMUCUVZc4g39mPFfEzh0gWxPmMSP5Q0vsYK7RgQH+JKdmxYiqasfY06px87Wp5Xl2+UzToHUURSOnM+s3 postgres@godard (2017-09-01)",
   "staticsync_user_exists": false,
   "weblogsync_user_exists": false,
   "buildd_user_exists": false,
index cd535eb..d5f5d33 100644 (file)
   "puppet_server": "puppet",
   "systemproductname": "Sun Fire X4200 Server",
   "hw_can_temp_sensors": false,
-  "postgresql_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDH4f+v9s9qvOX028ZEiaxxvpj+VOlQ0tT5rtsJ1Q5tp9tZM1KVnM3EIgEmaDE5x4aXgdmfEpAEAl5Uq5Eyv1vh8a7VIvvlaYz6UXqp8fgljAUTKsP1RwB31PxqZ2xXXS/UPY7Ubrcxz+L/Jl0hrWh7PTC1waMZDOXeqPKUdpLOQJi+RmprrbfxGkTtASwpfRl5fCLcNFKA97flN6Sfg01m8kqHVHmoBstQcQzVEWmUSf3USFmJ0bzrOUEL4qi9Mh/7+YTlCfcwWhDHMrtg6dzB0HbE7U1DjcG70ZCVdoPhqAMm+GU011VrC1mY8Tba54CK0oUcAVvoakLYhvpEHNLb postgres@sibelius (20101213)",
+  "postgres_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDH4f+v9s9qvOX028ZEiaxxvpj+VOlQ0tT5rtsJ1Q5tp9tZM1KVnM3EIgEmaDE5x4aXgdmfEpAEAl5Uq5Eyv1vh8a7VIvvlaYz6UXqp8fgljAUTKsP1RwB31PxqZ2xXXS/UPY7Ubrcxz+L/Jl0hrWh7PTC1waMZDOXeqPKUdpLOQJi+RmprrbfxGkTtASwpfRl5fCLcNFKA97flN6Sfg01m8kqHVHmoBstQcQzVEWmUSf3USFmJ0bzrOUEL4qi9Mh/7+YTlCfcwWhDHMrtg6dzB0HbE7U1DjcG70ZCVdoPhqAMm+GU011VrC1mY8Tba54CK0oUcAVvoakLYhvpEHNLb postgres@sibelius (20101213)",
   "staticsync_user_exists": false,
   "weblogsync_user_exists": false,
   "buildd_user_exists": false,