mirror of
https://github.com/ansible/awx.git
synced 2026-03-05 10:41:05 -03:30
Enable source variables for Azure inventory
This commit is contained in:
committed by
Bill Nottingham
parent
475a2bd9bb
commit
4b7f106e9f
@@ -1946,12 +1946,17 @@ class RunInventoryUpdate(BaseTask):
|
|||||||
cp.set(section, 'group_by_resource_group', 'yes')
|
cp.set(section, 'group_by_resource_group', 'yes')
|
||||||
cp.set(section, 'group_by_location', 'yes')
|
cp.set(section, 'group_by_location', 'yes')
|
||||||
cp.set(section, 'group_by_tag', 'yes')
|
cp.set(section, 'group_by_tag', 'yes')
|
||||||
|
|
||||||
if inventory_update.source_regions and 'all' not in inventory_update.source_regions:
|
if inventory_update.source_regions and 'all' not in inventory_update.source_regions:
|
||||||
cp.set(
|
cp.set(
|
||||||
section, 'locations',
|
section, 'locations',
|
||||||
','.join([x.strip() for x in inventory_update.source_regions.split(',')])
|
','.join([x.strip() for x in inventory_update.source_regions.split(',')])
|
||||||
)
|
)
|
||||||
|
|
||||||
|
azure_rm_opts = dict(inventory_update.source_vars_dict.items())
|
||||||
|
for k,v in azure_rm_opts.items():
|
||||||
|
cp.set(section, k, six.text_type(v))
|
||||||
|
|
||||||
# Return INI content.
|
# Return INI content.
|
||||||
if cp.sections():
|
if cp.sections():
|
||||||
f = cStringIO.StringIO()
|
f = cStringIO.StringIO()
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
|
|||||||
else{
|
else{
|
||||||
$scope.credentialBasePath = (source === 'ec2') ? GetBasePath('credentials') + '?kind=aws' : GetBasePath('credentials') + (source === '' ? '' : '?kind=' + (source));
|
$scope.credentialBasePath = (source === 'ec2') ? GetBasePath('credentials') + '?kind=aws' : GetBasePath('credentials') + (source === '' ? '' : '?kind=' + (source));
|
||||||
}
|
}
|
||||||
if (source === 'ec2' || source === 'custom' || source === 'vmware' || source === 'openstack' || source === 'scm' || source === 'cloudforms' || source === "satellite6") {
|
if (source === 'ec2' || source === 'custom' || source === 'vmware' || source === 'openstack' || source === 'scm' || source === 'cloudforms' || source === "satellite6" || source === "azure_rm") {
|
||||||
$scope.envParseType = 'yaml';
|
$scope.envParseType = 'yaml';
|
||||||
|
|
||||||
var varName;
|
var varName;
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
|
|||||||
if (source === 'ec2' || source === 'custom' ||
|
if (source === 'ec2' || source === 'custom' ||
|
||||||
source === 'vmware' || source === 'openstack' ||
|
source === 'vmware' || source === 'openstack' ||
|
||||||
source === 'scm' || source === 'cloudforms' ||
|
source === 'scm' || source === 'cloudforms' ||
|
||||||
source === 'satellite6') {
|
source === 'satellite6' || source === 'azure_rm') {
|
||||||
|
|
||||||
var varName;
|
var varName;
|
||||||
if (source === 'scm') {
|
if (source === 'scm') {
|
||||||
|
|||||||
@@ -303,6 +303,30 @@ return {
|
|||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
subForm: 'sourceSubForm'
|
subForm: 'sourceSubForm'
|
||||||
},
|
},
|
||||||
|
azure_rm_variables: {
|
||||||
|
id: 'azure_rm_variables',
|
||||||
|
label: i18n._('Source Variables'), //"{{vars_label}}" ,
|
||||||
|
ngShow: "source && source.value == 'azure_rm'",
|
||||||
|
type: 'textarea',
|
||||||
|
class: 'Form-textAreaLabel Form-formGroup--fullWidth',
|
||||||
|
rows: 6,
|
||||||
|
'default': '---',
|
||||||
|
parseTypeName: 'envParseType',
|
||||||
|
dataTitle: i18n._("Source Variables"),
|
||||||
|
dataPlacement: 'right',
|
||||||
|
awPopOver: "<p>" + i18n._("Override variables found in azure_rm.ini and used by the inventory update script. For a detailed description of these variables ") +
|
||||||
|
"<a href=\"https://github.com/ansible/ansible/blob/devel/contrib/inventory/azure_rm.ini\" target=\"_blank\">" +
|
||||||
|
i18n._("view azure_rm.ini in the Ansible github repo.") + "</a></p>" +
|
||||||
|
"<p>" + i18n._("Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.") + "</p>" +
|
||||||
|
i18n._("JSON:") + "<br />\n" +
|
||||||
|
"<blockquote>{<br /> \"somevar\": \"somevalue\",<br /> \"password\": \"magic\"<br /> }</blockquote>\n" +
|
||||||
|
i18n._("YAML:") + "<br />\n" +
|
||||||
|
"<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" +
|
||||||
|
"<p>" + i18n._("View JSON examples at ") + '<a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
|
||||||
|
"<p>" + i18n._("View YAML examples at ") + '<a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>',
|
||||||
|
dataContainer: 'body',
|
||||||
|
subForm: 'sourceSubForm'
|
||||||
|
},
|
||||||
verbosity: {
|
verbosity: {
|
||||||
label: i18n._('Verbosity'),
|
label: i18n._('Verbosity'),
|
||||||
type: 'select',
|
type: 'select',
|
||||||
|
|||||||
Reference in New Issue
Block a user