<% is_imported = f.object.new_record? ? false : f.object.imported %>

<%= is_imported ? _("Ansible Variable Details (Imported)") : _("Ansible Variable Details")%>

<%= text_f f, :key, :disabled => f.object.persisted?, :size => "col-md-8" %> <%= textarea_f f, :description, :rows => :auto, :size => "col-md-8", :class => "no-stretch" %> <%= ansible_role_select f, f.object.persisted? %>

<%= _("Default Behavior") %>

<%= _("Override the default value of the Ansible variable.") %>
<%= checkbox_f(f, :override, :onchange => 'toggleOverrideValue(this)', :size => "col-md-8", :label_help => _('Mark the variable to be managed by Foreman. When the Ansible role of this variable is assigned to a host, the default value will be added to Ansible inventory as a host variable. Specify matchers to set a different value for such variable.') ) %> <% version = Foreman::Version.new %> <% if version.major.to_i >= 1 && version.minor.to_i >= 22 %> <%= param_type_selector(f, false, :onchange => 'keyTypeChange(this)', :disabled => !f.object.override) %> <% else %> <%= param_type_selector(f, :onchange => 'keyTypeChange(this)', :disabled => !f.object.override) %> <% end %> <%= textarea_f f, :default_value, :value => f.object.default_value_before_type_cast, :size => "col-md-8", :disabled => (!f.object.override || f.object.omit), :input_group_btn => fullscreen_input, :rows => 1, :label_help => _("Value to use when there is no match."), :class => "no-stretch #{'masked-input' if f.object.hidden_value?}" %>
<%= checkbox_f(f, :hidden_value, :label => _('Hidden Value'), :class => 'hidden_value_textarea_switch', :onchange => 'toggle_lookupkey_hidden(this)', :checked => f.object.hidden_value?, :label_help => _("Hide all values for this parameter."), :size => "col-md-1", :label_size => "col-md-2", :table_field => true, :disabled => !f.object.override) %>
<%= collapsing_header _("Optional Input Validator"), "#optional_input_validators_#{f.object.id}", "collapsed" %>
<%= _('Before including these variables on your playbooks, Foreman will validate that your variables comply with the validation.') %>
<%= checkbox_f(f, :required, :size => "col-md-8", :disabled => !f.object.override, :label_help => _("If checked, will raise an error if there is no default value and no matcher provide a value.") ) %> <%= validator_type_selector f %> <%= text_f f, :validator_rule, :size => "col-md-8", :disabled => f.object.validator_type.blank?, :class => "no-stretch" %>

style=<%= "display:none;" if !f.object.override %>>

<%= _("Prioritize Attribute Order") %>

<%= _("Set the order in which values are resolved.") %>
<%= textarea_f f, :path, :rows => :auto, :label => _("Order"), :id => 'order', :size => "col-md-8", :onchange => 'fill_in_matchers()', :value => f.object.path, :class => "no-stretch", :label_help => _("The order in which matchers keys are processed, first match wins.
You may use multiple attributes as a matcher key, for example, an order of host group, environment would expect a matcher such as hostgroup = \"web servers\", environment = production").html_safe %> <%= checkbox_f(f, :merge_overrides, :onchange => 'mergeOverridesChanged(this)', :table_field => true, :disabled => !f.object.supports_merge?, :size => "col-md-1", :label_size => "col-md-2", :label_help => _("Continue to look for matches after first find (only array/hash type)? Note: merging overrides ignores all matchers that are omitted.")) %> <%= checkbox_f(f, :merge_default, :disabled => !f.object.merge_overrides, :size => "col-md-1", :table_field => true, :label_size => "col-md-2", :label_help => _("Include default value when merging all matching values.")) %> <%= checkbox_f(f, :avoid_duplicates, :disabled => (!f.object.supports_uniq? || !f.object.merge_overrides), :size => "col-md-1", :label_size => "col-md-2", :table_field => true, :label_help => _("Avoid duplicate values when merging them (only array type)?")) %>

<%= _("Specify Matchers") %> <%= documentation_button('4.2.6SmartMatchers') %>

<%= render 'lookup_keys/values', :f => f, :is_param => false %>