Add a recipe to set up a hosts entry for the PG primary
This commit is contained in:
		
							parent
							
								
									511400a7b8
								
							
						
					
					
						commit
						88e52607e3
					
				@ -22,3 +22,4 @@ chef_version '>= 12.14' if respond_to?(:chef_version)
 | 
			
		||||
depends "postgresql", ">= 7.0.0"
 | 
			
		||||
depends "build-essential"
 | 
			
		||||
depends "kosmos_encfs"
 | 
			
		||||
depends "hostsfile"
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										16
									
								
								site-cookbooks/kosmos-postgresql/recipes/hostsfile.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								site-cookbooks/kosmos-postgresql/recipes/hostsfile.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,16 @@
 | 
			
		||||
#
 | 
			
		||||
# Cookbook:: kosmos-postgresql
 | 
			
		||||
# Recipe:: hostsfile
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
primary_ip = postgresql_primary[:ipaddress]
 | 
			
		||||
rescue NoMethodError
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
unless primary_ip.nil?
 | 
			
		||||
  hostsfile_entry primary_ip do
 | 
			
		||||
    hostname  "pg.kosmos.local"
 | 
			
		||||
    unique    true
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user