| 
									
										
										
										
											2018-04-04 22:44:39 +03:00
										 |  |  | require_relative "provider" | 
					
						
							|  |  |  | require_relative "static/static_connector" | 
					
						
							|  |  |  | require_relative "static/static_provider_account" | 
					
						
							|  |  |  | require_relative "static/category_provider_static" | 
					
						
							| 
									
										
										
										
											2014-06-18 15:11:47 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | module Provider | 
					
						
							| 
									
										
										
										
											2018-04-04 22:44:39 +03:00
										 |  |  |   class Static < AbstractProvider | 
					
						
							| 
									
										
										
										
											2014-06-18 15:11:47 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 22:44:39 +03:00
										 |  |  |     PROVIDER = "static" | 
					
						
							| 
									
										
										
										
											2014-06-18 15:11:47 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def name | 
					
						
							|  |  |  |       PROVIDER | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 22:44:39 +03:00
										 |  |  |     def create_connector config, account | 
					
						
							|  |  |  |       options = { | 
					
						
							|  |  |  |         #static_ssh_key: account.ssh_key, | 
					
						
							| 
									
										
										
										
											2014-06-18 15:11:47 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 22:44:39 +03:00
										 |  |  | #        static_proxy: config[:static_proxy], | 
					
						
							|  |  |  | #        static_no_proxy: config[:static_no_proxy], | 
					
						
							|  |  |  |         static_integration_run_list: config[:static_integration_run_list] | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |       add_connector(account.account_name, StaticConnector.new(options)) | 
					
						
							| 
									
										
										
										
											2014-06-18 15:11:47 +04:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 22:44:39 +03:00
										 |  |  |     def create_account hash | 
					
						
							|  |  |  |       Devops::Model::StaticProviderAccount.new(hash) | 
					
						
							| 
									
										
										
										
											2014-06-18 15:11:47 +04:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 22:44:39 +03:00
										 |  |  |     def create_category_provider hash | 
					
						
							|  |  |  |       Devops::Model::CategoryProviderStatic.new(hash) | 
					
						
							| 
									
										
										
										
											2014-06-18 15:11:47 +04:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 22:44:39 +03:00
										 |  |  |     def account name | 
					
						
							|  |  |  |       Devops::Model::StaticProviderAccount.find(name) | 
					
						
							| 
									
										
										
										
											2014-06-18 15:11:47 +04:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 22:44:39 +03:00
										 |  |  |     def accounts | 
					
						
							|  |  |  |       Devops::Model::StaticProviderAccount.all | 
					
						
							| 
									
										
										
										
											2014-06-18 15:11:47 +04:00
										 |  |  |     end | 
					
						
							| 
									
										
										
										
											2018-04-04 22:44:39 +03:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2014-06-18 15:11:47 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 22:44:39 +03:00
										 |  |  |   register Static | 
					
						
							| 
									
										
										
										
											2014-06-18 15:11:47 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | end |