mirror of
https://github.com/puppetlabs/vmpooler-provider-ec2.git
synced 2026-01-26 02:28:40 -05:00
Change the way we load secrets so that we do not have to pass them as ENV vars.
they will be pulled from the provider config, similarily to the other providers
This commit is contained in:
parent
65c797137e
commit
0bff2df079
4 changed files with 42 additions and 14 deletions
|
|
@ -11,7 +11,7 @@ module Vmpooler
|
|||
ROOT_KEYS_SYNC_CMD = "curl -k -o - -L #{ROOT_KEYS_SCRIPT} | %s"
|
||||
|
||||
def self.setup_node_by_ssh(host, platform)
|
||||
@key_file = ENV['KEY_FILE_LOCATION'] || '/app/abs/.ssh/abs-aws-ec2.rsa'
|
||||
@key_file = ENV['AWS_KEY_FILE_LOCATION']
|
||||
conn = check_ssh_accepting_connections(host, platform)
|
||||
configure_host(host, platform, conn)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ module Vmpooler
|
|||
def initialize(config, logger, metrics, redis_connection_pool, name, options)
|
||||
super(config, logger, metrics, redis_connection_pool, name, options)
|
||||
|
||||
@aws_access_key = ENV['ABS_AWS_ACCESS_KEY']
|
||||
@aws_secret_key = ENV['ABS_AWS_SECRET_KEY']
|
||||
@aws_access_key = ENV['ABS_AWS_ACCESS_KEY'] || provider_config['ABS_AWS_ACCESS_KEY']
|
||||
@aws_secret_key = ENV['ABS_AWS_SECRET_KEY'] || provider_config['ABS_AWS_SECRET_KEY']
|
||||
|
||||
task_limit = global_config[:config].nil? || global_config[:config]['task_limit'].nil? ? 10 : global_config[:config]['task_limit'].to_i
|
||||
# The default connection pool size is:
|
||||
|
|
@ -123,10 +123,16 @@ module Vmpooler
|
|||
pool = pool_config(pool_name)
|
||||
raise("Pool #{pool_name} does not exist for the provider #{name}") if pool.nil?
|
||||
|
||||
filters = [{
|
||||
name: 'tag:pool',
|
||||
values: [pool_name]
|
||||
}]
|
||||
filters = [
|
||||
{
|
||||
name: 'tag:pool',
|
||||
values: [pool_name]
|
||||
},
|
||||
{
|
||||
name: 'instance-state-name',
|
||||
values: %w[pending running shutting-down stopping stopped]
|
||||
}
|
||||
]
|
||||
instance_list = connection.instances(filters: filters)
|
||||
|
||||
return vms if instance_list.first.nil?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue