Set postgresql password from an encrypted data bag
This commit is contained in:
		
							parent
							
								
									d8a0ecec76
								
							
						
					
					
						commit
						6b9ce81212
					
				
							
								
								
									
										17
									
								
								data_bags/credentials/postgresql.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								data_bags/credentials/postgresql.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,17 @@ | |||||||
|  | { | ||||||
|  |   "id": "postgresql", | ||||||
|  |   "ejabberd_user_password": { | ||||||
|  |     "encrypted_data": "S/vdx+qZ4FWtbM29yDRoIgjvFORoArJVlanPm/el1nCM0se0pnxw\n", | ||||||
|  |     "iv": "ARRo7yYYb7fve7Fv\n", | ||||||
|  |     "auth_tag": "q7AGIahxB50jHjD+/9po0g==\n", | ||||||
|  |     "version": 3, | ||||||
|  |     "cipher": "aes-256-gcm" | ||||||
|  |   }, | ||||||
|  |   "server_password": { | ||||||
|  |     "encrypted_data": "guWsuw7EqHQGMawW9P77Q12P8tUslpXE3AwRbobJlaTClVU08kcz\n", | ||||||
|  |     "iv": "ELRNrSW+zKYfL/eb\n", | ||||||
|  |     "auth_tag": "zayCIjABap1NsOewJDzapA==\n", | ||||||
|  |     "version": 3, | ||||||
|  |     "cipher": "aes-256-gcm" | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -4,9 +4,21 @@ | |||||||
| # | # | ||||||
| # Copyright:: 2019, Kosmos, All Rights Reserved. | # Copyright:: 2019, Kosmos, All Rights Reserved. | ||||||
| 
 | 
 | ||||||
|  | node.override['build-essential']['compile_time'] = true | ||||||
|  | include_recipe 'build-essential::default' | ||||||
|  | 
 | ||||||
|  | package("libpq-dev") { action :nothing }.run_action(:install) | ||||||
|  | 
 | ||||||
|  | chef_gem 'pg' do | ||||||
|  |   compile_time true | ||||||
|  | end | ||||||
|  | 
 | ||||||
|  | postgresql_data_bag_item = data_bag_item('credentials', 'postgresql') | ||||||
|  | 
 | ||||||
| postgresql_server_install "main" do | postgresql_server_install "main" do | ||||||
|   version "10" |   version "10" | ||||||
|   setup_repo false |   setup_repo false | ||||||
|  |   password postgresql_data_bag_item['server_password'] | ||||||
|   action :install |   action :install | ||||||
| end | end | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user