lib/rubber/dns/aws.rb
# Convert from rubber option hash that represents a dns record to fog/aws model 
Convert from rubber option hash that represents a dns record to fog/aws model
Convert from rubber option hash that represents a dns record to fog / aws model
def opts_to_host(opts)
        host = {}
        host[:name], domain = denormalize_name(opts[:host], opts[:domain])
        host[:type] =  opts[:type]
        host[:ttl] = opts[:ttl] if opts[:ttl]
        if opts[:data]
          if host[:type] =~ /MX/i
            host[:value] = opts[:data].collect {|o| "#{o[:priority]} #{o[:value]}"}
          elsif opts[:data].first.is_a?(Hash)
            host[:alias_target] = opts[:data].first
            host.delete(:value)
            host.delete(:ttl)
          else
            host[:value] = opts[:data]
          end
        end
        host
      end
def opts_to_host ( opts ) host = { } host [ :name ] , domain = denormalize_name ( opts [ :host ] , opts [ :domain ] ) host [ :type ] = opts [ :type ] host [ :ttl ] = opts [ :ttl ] if opts [ :ttl ] if opts [ :data ] if host [ :type ] =~ / MX /i host [ :value ] = opts [ :data ] . collect { | o | "#{o[:priority]} #{o[:value]}" } elsif opts [ :data ] . first . is_a? ( Hash ) host [ :alias_target ] = opts [ :data ] . first host . delete ( :value ) host . delete ( :ttl ) else host [ :value ] = opts [ :data ] end end host end
Convert from rubber option hash that represents a dns record to fog/aws model
Convert from rubber option hash that represents a dns record to fog / aws model
# Route 53 requires the priority to be munged with the data value. # Route 53 allows creation of ALIAS records, which will always be # a Hash in the DNS config.  ALIAS records cannot have a TTL.
opts