mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	puppet: Use systemctl instead of pg_ctlcluster on CentOS.
This commit is contained in:
		@@ -7,6 +7,10 @@ $postgres_conf = $::osfamily ? {
 | 
				
			|||||||
  'debian' => "/etc/postgresql/${zulip::base::postgres_version}/main/postgresql.conf",
 | 
					  'debian' => "/etc/postgresql/${zulip::base::postgres_version}/main/postgresql.conf",
 | 
				
			||||||
  'redhat' => "/var/lib/pgsql/${zulip::base::postgres_version}/data/postgresql.conf",
 | 
					  'redhat' => "/var/lib/pgsql/${zulip::base::postgres_version}/data/postgresql.conf",
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					$postgres_restart = $::osfamily ? {
 | 
				
			||||||
 | 
					  'debian' => "pg_ctlcluster ${zulip::base::postgres_version} main restart",
 | 
				
			||||||
 | 
					  'redhat' => "systemctl restart postgresql-${zulip::base::postgres_version}",
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
if $zulip::base::release_name == 'trusty' {
 | 
					if $zulip::base::release_name == 'trusty' {
 | 
				
			||||||
  # tools for database setup
 | 
					  # tools for database setup
 | 
				
			||||||
  $postgres_appdb_tuned_packages = ['pgtune']
 | 
					  $postgres_appdb_tuned_packages = ['pgtune']
 | 
				
			||||||
@@ -85,7 +89,7 @@ vm.dirty_background_ratio = 5
 | 
				
			|||||||
    content => template("zulip/postgresql/${zulip::base::postgres_version}/postgresql.conf.template.erb"),
 | 
					    content => template("zulip/postgresql/${zulip::base::postgres_version}/postgresql.conf.template.erb"),
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  exec { "pg_ctlcluster ${zulip::base::postgres_version} main restart":
 | 
					  exec { $postgres_restart:
 | 
				
			||||||
    require     => Package[$zulip::postgres_appdb_base::postgresql],
 | 
					    require     => Package[$zulip::postgres_appdb_base::postgresql],
 | 
				
			||||||
    refreshonly => true,
 | 
					    refreshonly => true,
 | 
				
			||||||
    subscribe   => [ File[$postgres_conf] ]
 | 
					    subscribe   => [ File[$postgres_conf] ]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,6 +15,7 @@ mkfs.xfs /dev/md0
 | 
				
			|||||||
echo "/dev/md0   /srv  xfs    nofail,noatime,barrier 1 1" >> /etc/fstab
 | 
					echo "/dev/md0   /srv  xfs    nofail,noatime,barrier 1 1" >> /etc/fstab
 | 
				
			||||||
mount /srv
 | 
					mount /srv
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# TODO use systemctl instead of pg_ctlcluster on CentOS
 | 
				
			||||||
pg_ctlcluster 9.5 main stop
 | 
					pg_ctlcluster 9.5 main stop
 | 
				
			||||||
mv /var/lib/postgresql /srv
 | 
					mv /var/lib/postgresql /srv
 | 
				
			||||||
ln -s /srv/postgresql/ /var/lib
 | 
					ln -s /srv/postgresql/ /var/lib
 | 
				
			||||||
@@ -23,6 +24,7 @@ mv /tmp /srv
 | 
				
			|||||||
mkdir /tmp
 | 
					mkdir /tmp
 | 
				
			||||||
mount --bind /srv/tmp /tmp
 | 
					mount --bind /srv/tmp /tmp
 | 
				
			||||||
echo "/srv/tmp   /tmp  bind   nofail,defaults,bind 0 0" >> /etc/fstab
 | 
					echo "/srv/tmp   /tmp  bind   nofail,defaults,bind 0 0" >> /etc/fstab
 | 
				
			||||||
 | 
					# TODO use systemctl instead of pg_ctlcluster on CentOS
 | 
				
			||||||
pg_ctlcluster 9.5 main start
 | 
					pg_ctlcluster 9.5 main start
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Disable /mnt line for /dev/xvdb
 | 
					# Disable /mnt line for /dev/xvdb
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user