/********************************************* * Copyright (c) 2014 AnsibleWorks, Inc. * * Groups.js * Form definition for Group model * * */ /** * @ngdoc function * @name forms.function:Source * @description This form is for group model */ export default angular.module('SourceFormDefinition', []) .value('SourceForm', { addTitle: 'Create Source', editTitle: 'Edit Source', showTitle: false, cancelButton: false, name: 'source', well: false, fields: { source: { label: 'Source', type: 'select', ngOptions: 'source.label for source in source_type_options track by source.value', ngChange: 'sourceChange()', addRequired: false, editRequired: false }, source_path: { label: 'Script Path', ngShow: "source && source.value == 'file'", type: 'text', awRequiredWhen: { variable: "sourcePathRequired", init: "false" } }, credential: { label: 'Cloud Credential', type: 'lookup', ngShow: "source && source.value !== 'manual' && source.value !== 'custom'", sourceModel: 'credential', sourceField: 'name', ngClick: 'lookUpCredential()', addRequired: false, editRequired: false }, source_regions: { label: 'Regions', type: 'text', ngShow: "source && (source.value == 'rax' || source.value == 'ec2' || source.value == 'gce' || source.value == 'azure')", addRequired: false, editRequired: false, awMultiselect: 'source_region_choices', dataTitle: 'Source Regions', dataPlacement: 'right', awPopOver: "

Click on the regions field to see a list of regions for your cloud provider. You can select multiple regions, " + "or choose All to include all regions. Tower will only be updated with Hosts associated with the selected regions." + "

", dataContainer: 'body' }, instance_filters: { label: 'Instance Filters', type: 'text', ngShow: "source && source.value == 'ec2'", addRequired: false, editRequired: false, dataTitle: 'Instance Filters', dataPlacement: 'right', awPopOver: "

Provide a comma-separated list of filter expressions. " + "Hosts are imported to Tower when ANY of the filters match.

" + "Limit to hosts having a tag:
\n" + "
tag-key=TowerManaged
\n" + "Limit to hosts using either key pair:
\n" + "
key-name=staging, key-name=production
\n" + "Limit to hosts where the Name tag begins with test:
\n" + "
tag:Name=test*
\n" + "

View the Describe Instances documentation " + "for a complete list of supported filters.

", dataContainer: 'body' }, group_by: { label: 'Only Group By', type: 'text', ngShow: "source && source.value == 'ec2'", addRequired: false, editRequired: false, awMultiselect: 'group_by_choices', dataTitle: 'Only Group By', dataPlacement: 'right', awPopOver: "

Select which groups to create automatically. " + "Tower will create group names similar to the following examples based on the options selected:

If blank, all groups above are created except Instance ID.

", dataContainer: 'body' }, source_script: { label : "Custom Inventory Script", labelClass: 'prepend-asterisk', type: 'lookup', ngShow: "source && source.value === 'custom'", sourceModel: 'source_script', sourceField: 'name', ngClick: 'lookUpSource_script()' , //'lookUpCustom_inventory()', addRequired: true, editRequired: true }, extra_vars: { label: 'Environment Variables', //"{{vars_label}}" , ngShow: "source && source.value=='custom' ", type: 'textarea', addRequired: false, editRequired: false, rows: 6, 'default': '---', parseTypeName: 'envParseType', dataTitle: "Environment Variables", dataPlacement: 'right', awPopOver: "

Provide key/value pairs using either YAML or JSON.

" + "JSON:
\n" + "
{
\"somevar\": \"somevalue\",
\"password\": \"magic\"
}
\n" + "YAML:
\n" + "
---
somevar: somevalue
password: magic
\n", dataContainer: 'body' }, source_vars: { label: 'Source Variables', //"{{vars_label}}" , ngShow: "source && (source.value == 'file' || source.value == 'ec2')", type: 'textarea', addRequired: false, editRequird: false, rows: 6, 'default': '---', parseTypeName: 'envParseType', dataTitle: "Source Variables", dataPlacement: 'right', awPopOver: "

Override variables found in ec2.ini and used by the inventory update script. For a detailed description of these variables " + "" + "view ec2.ini in the Ansible github repo.

" + "

Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.

" + "JSON:
\n" + "
{
\"somevar\": \"somevalue\",
\"password\": \"magic\"
}
\n" + "YAML:
\n" + "
---
somevar: somevalue
password: magic
\n" + '

View JSON examples at www.json.org

' + '

View YAML examples at docs.ansible.com

', dataContainer: 'body' }, inventory_variables: { label: 'Source Variables', //"{{vars_label}}" , ngShow: "source && (source.value == 'vmware')", type: 'textarea', addRequired: false, editRequird: false, rows: 6, 'default': '---', parseTypeName: 'envParseType', dataTitle: "Source Variables", dataPlacement: 'right', awPopOver: "

Override variables found in vmware.ini and used by the inventory update script. For a detailed description of these variables " + "" + "view vmware.ini in the Ansible github repo.

" + "

Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.

" + "JSON:
\n" + "
{
\"somevar\": \"somevalue\",
\"password\": \"magic\"
}
\n" + "YAML:
\n" + "
---
somevar: somevalue
password: magic
\n" + '

View JSON examples at www.json.org

' + '

View YAML examples at docs.ansible.com

', dataContainer: 'body' }, checkbox_group: { label: 'Update Options', type: 'checkbox_group', ngShow: "source && (source.value !== 'manual' && source.value !== null)", fields: [{ name: 'overwrite', label: 'Overwrite', type: 'checkbox', ngShow: "source.value !== 'manual' && source.value !== null", addRequired: false, editRequired: false, awPopOver: '

If checked, all child groups and hosts not found on the external source will be deleted from ' + 'the local inventory.

When not checked, local child hosts and groups not found on the external source will ' + 'remain untouched by the inventory update process.

', dataTitle: 'Overwrite', dataContainer: 'body', dataPlacement: 'right', labelClass: 'checkbox-options' }, { name: 'overwrite_vars', label: 'Overwrite Variables', type: 'checkbox', ngShow: "source.value !== 'manual' && source.value !== null", addRequired: false, editRequired: false, awPopOver: '

If checked, all variables for child groups and hosts will be removed and replaced by those ' + 'found on the external source.

When not checked, a merge will be performed, combining local variables with ' + 'those found on the external source.

', dataTitle: 'Overwrite Variables', dataContainer: 'body', dataPlacement: 'right', labelClass: 'checkbox-options' }, { name: 'update_on_launch', label: 'Update on Launch', type: 'checkbox', ngShow: "source.value !== 'manual' && source.value !== null", addRequired: false, editRequired: false, awPopOver: '

Each time a job runs using this inventory, refresh the inventory from the selected source before ' + 'executing job tasks.

', dataTitle: 'Update on Launch', dataContainer: 'body', dataPlacement: 'right', labelClass: 'checkbox-options' }] }, update_cache_timeout: { label: "Cache Timeout (seconds)", id: 'source-cache-timeout', type: 'number', integer: true, min: 0, ngShow: "source && source.value !== 'manual' && update_on_launch", spinner: true, "default": 0, addRequired: false, editRequired: false, awPopOver: '

Time in seconds to consider an inventory sync to be current. During job runs and callbacks the task system will ' + 'evaluate the timestamp of the latest sync. If it is older than Cache Timeout, it is not considered current, ' + 'and a new inventory sync will be performed.

', dataTitle: 'Cache Timeout', dataPlacement: 'right', dataContainer: "body" } }, buttons: { }, related: { } });