module AnsibleEYCInventory

Constants

EYRC_PATH
VERSION

Public Class Methods

api() click to toggle source
# File lib/ansible_eyc_inventory.rb, line 39
def api
  @api ||= EY::CloudClient.new(token: api_token)
end
print_json(env_name, account_name) click to toggle source

Private Class Methods

api_token() click to toggle source
# File lib/ansible_eyc_inventory.rb, line 45
def api_token
  raise Error, "Could not find #{EYRC_PATH}. Run `ey login` and try again." unless EYRC_PATH.expand_path.exist?

  YAML.load_file(EYRC_PATH.expand_path)['api_token'].tap {|token|
    raise Error, "Could not find your API token from #{EYRC_PATH}. Run `ey login` and try again." unless token
  }
end