Sha256: 61c0711e1d0ad27378f587d1bbe1bfeb222e74346410c7dab4bb844731dfca25

Contents?: true

Size: 1.03 KB

Versions: 12

Compression:

Stored size: 1.03 KB

Contents

#
# Cookbook Name:: automate
# Recipe:: _helper
#
# Author:: Salim Afiune (<afiune@chef.io>)
#
# Copyright 2015, Chef Software, Inc.
#
# All rights reserved - Do Not Redistribute
#

module Delivery

  module Helper
    # Delivery API helper
    #
    # This little helper will let us just type:
    #  e.g.
    #       delivery_api.get(...)
    #       delivery_api.put(...)
    #       delivery_api.post(...)
    #       delivery_api.delete(...)
    #
    def delivery_api
      @api ||= begin
        Delivery::API.new(delivery_fqdn, 'admin', delivery_admin_password, delivery_enterprise)
      end
    end

    # Get delivery enterprise

    def delivery_fqdn
      "#{node['demo']['domain_prefix']}automate.#{node['demo']['domain']}"
    end

    def delivery_organization
      node['demo']['org']
    end

    def delivery_enterprise
      node['demo']['enterprise']
    end

    def delivery_admin_password
      node['demo']['users']['admin']['password']
    end

    def return_key(key)
      key =~ /\// ? File.read(key) : key
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
wombat-cli-0.7.3 generator_files/cookbooks/automate/libraries/_helper.rb
wombat-cli-0.7.2 generator_files/cookbooks/automate/libraries/_helper.rb
wombat-cli-0.6.2 generator_files/cookbooks/automate/libraries/_helper.rb
wombat-cli-0.4.1 generator_files/cookbooks/automate/libraries/_helper.rb
wombat-cli-0.4.0 generator_files/cookbooks/automate/libraries/_helper.rb
wombat-cli-0.3.4 generator_files/cookbooks/automate/libraries/_helper.rb
wombat-cli-0.3.3 generator_files/cookbooks/automate/libraries/_helper.rb
wombat-cli-0.3.2 generator_files/cookbooks/automate/libraries/_helper.rb
wombat-cli-0.3.1 generator_files/cookbooks/automate/libraries/_helper.rb
wombat-cli-0.3.0 generator_files/cookbooks/automate/libraries/_helper.rb
wombat-cli-0.2.1 cookbooks/automate/libraries/_helper.rb
wombat-cli-0.2.0 cookbooks/automate/libraries/_helper.rb