Add path/tag repository settings

This commit is contained in:
Volodymyr Stoiko 2016-08-03 12:13:56 +03:00
parent f562a53487
commit 0a4142b2f5
3 changed files with 74 additions and 12 deletions

View File

@ -1,4 +0,0 @@
#!/bin/bash
# It's a script which deploys your plugin
echo fuel-plugin-rally > /tmp/fuel-plugin-rally

View File

@ -20,17 +20,26 @@ $network_metadata = hiera_hash('network_metadata')
prepare_network_config($network_scheme)
$rally = hiera_hash('fuel-plugin-rally', undef)
if ($rally['repository_type'] == 'default') {
$repository_url = 'https://github.com/openstack/rally'
$repository_tag = $rally['repository_tag']
} else {
$repository_url = $rally['repository_custom']
$repository_tag = $rally['repository_custom_tag']
}
$management_ip = get_network_role_property('management', 'ipaddr')
$hiera_dir = '/etc/hiera/override'
$plugin_name = 'rally'
$plugin_yaml = "${plugin_name}.yaml"
$calculated_content = inline_template('
---
rally::rally_configuration: <%= @rally["rally_configuration"] %>
rally::listen_address: <%= @management_ip %>
rally::repository_url: <%= @repository_url %>
rally::repository_tag: <%= @repository_tag %>
')
###################

View File

@ -3,9 +3,66 @@ attributes:
label: "Rally benchmarking tool"
weight: 90
rally_configuration:
value: 'Some config'
label: 'Repository for example'
description: 'Configurable parameter'
weight: 5
type: "text"
# Repository
repository_type:
type: "radio"
weight: 40
value: "default"
label: "Choose repository source"
values:
- data: "default"
label: "Official openstack/rally repository"
description: "Released version of rally benchmarking tool"
- data: "custom"
label: "Custom repository"
description: "Specify repository url"
repository_tag:
type: "select"
weight: 50
value: "master"
label: "Select master or tag"
description: "Applicable for default repository only"
values:
- data: "master"
label: "master"
- data: "0.5.0"
label: "0.5.0"
- data: "0.4.0"
label: "0.4.0"
- data: "0.3.3"
label: "0.3.3"
- data: "0.3.2"
label: "0.3.2"
- data: "0.3.1"
label: "0.3.1"
- data: "0.3.0"
label: "0.3.0"
- data: "0.2.0"
label: "0.2.0"
restrictions:
- condition: "settings:fuel-plugin-rally.repository_type.value == 'custom'"
action: hide
repository_custom:
type: "text"
weight: 50
value: ""
label: "Repository path"
description: "Specify git repository path"
regex:
source: '^(ssh|git|http(s)|git).*$'
error: 'Use http(s)/ssh/git url format'
restrictions:
- condition: "settings:fuel-plugin-rally.repository_type.value == 'default'"
action: hide
repository_custom_tag:
type: "text"
weight: 60
value: "master"
label: "Repository tag"
description: "Leave master or specify custom tag"
restrictions:
- condition: "settings:fuel-plugin-rally.repository_type.value == 'default'"
action: hide