Sha256: 8f525d532367198604b494bc7bef8f0ad5df20d9f3cff74fe014ce01be6afb55

Contents?: true

Size: 1012 Bytes

Versions: 59

Compression:

Stored size: 1012 Bytes

Contents

module Mutations
  module AnsibleVariableOverrides
    class Update < ::Mutations::UpdateMutation
      graphql_name 'UpdateAnsibleVariableOverrideMutation'
      description 'Updates Ansible Variable Override'

      resource_class LookupValue

      argument :value, ::Types::RawJson, required: true
      argument :match, String, required: false
      argument :omit, Boolean, required: false
      argument :host_id, Int, required: true
      argument :ansible_variable_id, Int, required: true

      field :overriden_ansible_variable, ::Types::OverridenAnsibleVariable, :null => true

      def resolve(host_id:, ansible_variable_id:, **kwargs)
        result = super kwargs
        host = Host.find host_id
        vars = AnsibleVariable.where :id => ansible_variable_id
        resolver = ::ForemanAnsible::OverrideResolver.new(host, vars.pluck(:id))
        result.merge :overriden_ansible_variable => ::Presenters::OverridenAnsibleVariablePresenter.new(vars.first, resolver)
      end
    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
foreman_ansible-15.0.3 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-15.0.2 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-15.0.1 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-15.0.0 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-14.2.2 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-14.2.1 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-13.0.7 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-14.2.0 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-14.1.1 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-14.1.0 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-13.0.5 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-14.0.0 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-13.0.4 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-13.0.3 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-13.0.2 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-13.0.1 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-13.0.0 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-12.0.7 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-10.4.4 app/graphql/mutations/ansible_variable_overrides/update.rb
foreman_ansible-7.1.8 app/graphql/mutations/ansible_variable_overrides/update.rb