Compare commits
	
		
			1 commit
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 2518cb6864 | 
					 2 changed files with 67 additions and 0 deletions
				
			
		
							
								
								
									
										14
									
								
								bundles/icingadb/items.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								bundles/icingadb/items.py
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,14 @@ | ||||||
|  | import yaml, json | ||||||
|  | from bundlewrap.metadata import MetadataJSONEncoder | ||||||
|  | 
 | ||||||
|  | files = { | ||||||
|  |     '/etc/icingadb/config.yml': { | ||||||
|  |         'content': yaml.dump( | ||||||
|  |             json.loads( | ||||||
|  |                 json.dumps(node.metadata.get('icingadb'), sort_keys=True, cls=MetadataJSONEncoder) | ||||||
|  |             ), | ||||||
|  |         ), | ||||||
|  |         'mode': '0640', | ||||||
|  |         'owner': 'icingadb', | ||||||
|  |     }, | ||||||
|  | } | ||||||
							
								
								
									
										53
									
								
								bundles/icingadb/metadata.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								bundles/icingadb/metadata.py
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,53 @@ | ||||||
|  | defaults = { | ||||||
|  |     'apt': { | ||||||
|  |         'packages': { | ||||||
|  |             'icingadb': {}, | ||||||
|  |             'icingadb-redis': {}, | ||||||
|  |             'icingadb-web': {}, | ||||||
|  |         }, | ||||||
|  |         'sources': { | ||||||
|  |             'deb https://packages.icinga.com/debian icinga-{release} main', | ||||||
|  |             'deb https://packages.icinga.com/debian icinga-{release}-snapshots main', | ||||||
|  |         }, | ||||||
|  |     }, | ||||||
|  |     'postgresql': { | ||||||
|  |         'databases': { | ||||||
|  |             'icingadb': { | ||||||
|  |                 'owner': 'icingadb', | ||||||
|  |             }, | ||||||
|  |         }, | ||||||
|  |         'roles': { | ||||||
|  |             'icingadb': { | ||||||
|  |                 'password': repo.vault.password_for(f'psql icingadb on {node.name}'), | ||||||
|  |             }, | ||||||
|  |         }, | ||||||
|  |     }, | ||||||
|  |     'redis': { | ||||||
|  |         'icingadb': { | ||||||
|  |             'port': '6381', | ||||||
|  |         }, | ||||||
|  |     }, | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | @metadata_reactor.provides( | ||||||
|  |     'icingadb', | ||||||
|  | ) | ||||||
|  | def config(metadata): | ||||||
|  |     return { | ||||||
|  |         'icingadb': { | ||||||
|  |             'database': { | ||||||
|  |                 'type': 'postgresql', | ||||||
|  |                 'host': 'localhost', | ||||||
|  |                 'port': 3306, | ||||||
|  |                 'database': 'icingadb', | ||||||
|  |                 'user': 'icingadb', | ||||||
|  |                 'password': metadata.get('postgresql/roles/icingadb/password'), | ||||||
|  |             }, | ||||||
|  |             'redis': { | ||||||
|  |                 'address': 'localhost:6380', | ||||||
|  |             }, | ||||||
|  |             'logging': { | ||||||
|  |                 'level': 'info', | ||||||
|  |             }, | ||||||
|  |         }, | ||||||
|  |     } | ||||||
		Loading…
	
		Reference in a new issue