Module: Enscalator::Plugins::CoreOS
- Defined in:
- lib/enscalator/plugins/core_os.rb
Overview
CoreOS appliance
Constant Summary collapse
- CHANNELS =
CoreOS Release channels
[:alpha, :beta, :stable].freeze
Class Method Summary collapse
-
.get_channel_version(channel: :stable, tag: nil) ⇒ Hash
Get CoreOS mapping for specific version from specific channel (stable, beta or alpha).
-
.get_specific_version(tag: nil) ⇒ Hash
Get CoreOS mapping for specific version regardless of its release channel.
Instance Method Summary collapse
-
#core_os_init ⇒ Object
Initialize CoreOS related configurations.
Class Method Details
.get_channel_version(channel: :stable, tag: nil) ⇒ Hash
Get CoreOS mapping for specific version from specific channel (stable, beta or alpha)
16 17 18 19 20 |
# File 'lib/enscalator/plugins/core_os.rb', line 16 def get_channel_version(channel: :stable, tag: nil) fail ArgumentError, "channel can only be one of #{CHANNELS}" unless CHANNELS.include? channel base_url = "http://#{channel}.release.core-os.net/amd64-usr" fetch_mapping(base_url, tag) end |
.get_specific_version(tag: nil) ⇒ Hash
Get CoreOS mapping for specific version regardless of its release channel
27 28 29 30 31 32 33 34 |
# File 'lib/enscalator/plugins/core_os.rb', line 27 def get_specific_version(tag: nil) urls = CHANNELS.map { |c| "http://#{c}.release.core-os.net/amd64-usr" } mapping = nil urls.each do |u| mapping ||= fetch_mapping(u, tag) end mapping end |
Instance Method Details
#core_os_init ⇒ Object
Initialize CoreOS related configurations
83 84 85 |
# File 'lib/enscalator/plugins/core_os.rb', line 83 def core_os_init mapping 'AWSCoreOSAMI', CoreOS.get_channel_version(channel: :stable) end |