diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7490f41..17ec95b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,13 +5,13 @@ on: workflow_dispatch jobs: release: runs-on: ubuntu-latest - if: github.repository == 'puppetlabs/vmpooler-provider-aws' + if: github.repository == 'puppetlabs/vmpooler-provider-ec2' steps: - uses: actions/checkout@v2 - name: Get Version id: gv run: | - echo "::set-output name=ver::$(grep VERSION lib/vmpooler-provider-aws/version.rb |rev |cut -d "'" -f2 |rev)" + echo "::set-output name=ver::$(grep VERSION lib/vmpooler-provider-ec2/version.rb |rev |cut -d "'" -f2 |rev)" - name: Tag Release uses: ncipollo/release-action@v1 with: diff --git a/.gitignore b/.gitignore index 95e94de..c93a15b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ results.xml /vmpooler.yaml .idea *.json +.secrets/ diff --git a/README.md b/README.md index 786f8eb..de7332b 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ aws authorization is handled via two required ENV vars When you add the pool config `provision: true` to a pool, the new VMs will also get initialized with extra steps to setup the sshd config via NET:SSH These steps expect two environment vars 1. ROOT_KEYS_SCRIPT: (optional) the URI location of a script (eg https in github) that will be run to setup keys. If not set, this will be skipped -2. KEY_FILE_LOCATION: (required) the location on local disk where the ssh key resides for VMPooler to connect via SSH to the AWS node +2. KEY_FILE_LOCATION: (required) the location on local disk where the ssh key resides for VMPooler to connect via SSH to the EC2 node ### DNS AWS will setup a private ip and private dns hostname for the VM once running. Optionally we can setup a human readable DNS entry to resolve the VMPooler provider `spicy-proton` fqdn diff --git a/lib/vmpooler-provider-aws/version.rb b/lib/vmpooler-provider-ec2/version.rb similarity index 67% rename from lib/vmpooler-provider-aws/version.rb rename to lib/vmpooler-provider-ec2/version.rb index a8e2ab1..54be4c7 100644 --- a/lib/vmpooler-provider-aws/version.rb +++ b/lib/vmpooler-provider-ec2/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -module VmpoolerProviderAws +module VmpoolerProviderEc2 VERSION = '0.0.1' end diff --git a/lib/vmpooler/providers/aws.rb b/lib/vmpooler/providers/ec2.rb similarity index 99% rename from lib/vmpooler/providers/aws.rb rename to lib/vmpooler/providers/ec2.rb index 3a180bb..e72c877 100644 --- a/lib/vmpooler/providers/aws.rb +++ b/lib/vmpooler/providers/ec2.rb @@ -10,7 +10,7 @@ module Vmpooler class PoolManager class Provider # This class represent a GCE provider to CRUD resources in a gce cloud. - class Aws < Vmpooler::PoolManager::Provider::Base + class Ec2 < Vmpooler::PoolManager::Provider::Base # The connection_pool method is normally used only for testing attr_reader :connection_pool @@ -51,7 +51,7 @@ module Vmpooler # name of the provider class def name - 'aws' + 'ec2' end def connection diff --git a/spec/unit/providers/aws_spec.rb b/spec/unit/providers/ec2_spec.rb similarity index 97% rename from spec/unit/providers/aws_spec.rb rename to spec/unit/providers/ec2_spec.rb index a5d0bed..f1d4850 100644 --- a/spec/unit/providers/aws_spec.rb +++ b/spec/unit/providers/ec2_spec.rb @@ -1,13 +1,13 @@ require 'spec_helper' require 'mock_redis' require 'ec2_helper' -require 'vmpooler/providers/aws' +require 'vmpooler/providers/ec2' RSpec::Matchers.define :relocation_spec_with_host do |value| match { |actual| actual[:spec].host == value } end -describe 'Vmpooler::PoolManager::Provider::Aws' do +describe 'Vmpooler::PoolManager::Provider::Ec2' do let(:logger) { MockLogger.new } let(:metrics) { Vmpooler::Metrics::DummyStatsd.new } let(:poolname) { 'debian-9' } @@ -20,7 +20,7 @@ describe 'Vmpooler::PoolManager::Provider::Aws' do max_tries: 3 retry_factor: 10 :providers: - :aws: + :ec2: connection_pool_timeout: 1 zone: '#{zone}' region: '#{region}' @@ -32,7 +32,7 @@ describe 'Vmpooler::PoolManager::Provider::Aws' do size: 5 timeout: 10 ready_ttl: 1440 - provider: 'aws' + provider: 'ec2' EOT ) } @@ -49,7 +49,7 @@ EOT ) { MockRedis.new } end - subject { Vmpooler::PoolManager::Provider::Aws.new(config, logger, metrics, redis_connection_pool, 'aws', provider_options) } + subject { Vmpooler::PoolManager::Provider::Ec2.new(config, logger, metrics, redis_connection_pool, 'ec2', provider_options) } describe '#manual tests live' do context 'in itsysops' do diff --git a/spec/vmpooler-provider-aws/vmpooler_provider_aws_spec.rb b/spec/vmpooler-provider-ec2/vmpooler_provider_ec2_spec.rb similarity index 51% rename from spec/vmpooler-provider-aws/vmpooler_provider_aws_spec.rb rename to spec/vmpooler-provider-ec2/vmpooler_provider_ec2_spec.rb index 9ccdba9..6c5e789 100644 --- a/spec/vmpooler-provider-aws/vmpooler_provider_aws_spec.rb +++ b/spec/vmpooler-provider-ec2/vmpooler_provider_ec2_spec.rb @@ -1,9 +1,9 @@ require 'rspec' -describe 'VmpoolerProviderAws' do +describe 'VmpoolerProviderEc2' do context 'when creating class ' do it 'sets a version' do - expect(VmpoolerProviderAws::VERSION).not_to be_nil + expect(VmpoolerProviderEc2::VERSION).not_to be_nil end end end \ No newline at end of file diff --git a/vmpooler-provider-aws.gemspec b/vmpooler-provider-ec2.gemspec similarity index 85% rename from vmpooler-provider-aws.gemspec rename to vmpooler-provider-ec2.gemspec index 0b9e1e5..a569143 100644 --- a/vmpooler-provider-aws.gemspec +++ b/vmpooler-provider-ec2.gemspec @@ -1,15 +1,15 @@ lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'vmpooler-provider-aws/version' +require 'vmpooler-provider-ec2/version' Gem::Specification.new do |s| - s.name = 'vmpooler-provider-aws' - s.version = VmpoolerProviderAws::VERSION + s.name = 'vmpooler-provider-ec2' + s.version = VmpoolerProviderEc2::VERSION s.authors = ['Puppet'] s.email = ['support@puppet.com'] - s.summary = 'AWS provider for VMPooler' - s.homepage = 'https://github.com/puppetlabs/vmpooler-provider-aws' + s.summary = 'EC2 provider for VMPooler' + s.homepage = 'https://github.com/puppetlabs/vmpooler-provider-ec2' s.license = 'Apache-2.0' s.required_ruby_version = Gem::Requirement.new('>= 2.3.0') diff --git a/vmpooler.yaml.example b/vmpooler.yaml.example index 3560c59..28b92a3 100644 --- a/vmpooler.yaml.example +++ b/vmpooler.yaml.example @@ -138,7 +138,7 @@ # # Provider specific pool settings # -# AWS provider +# EC2 provider # - zone # The zone to create the VMs in # (optional: default is global provider zone value)