Merge "Add support for DeployArtifactURLs"

This commit is contained in:
Jenkins 2016-02-27 00:20:48 +00:00 committed by Gerrit Code Review
commit fe0b757bd4
7 changed files with 117 additions and 3 deletions

View File

@ -14,8 +14,19 @@ parameters:
type: json
description: Value which changes if the node configuration may need to be re-applied
resources:
CephStorageArtifactsConfig:
type: deploy-artifacts.yaml
CephStorageArtifactsDeploy:
type: OS::Heat::StructuredDeployments
properties:
servers: {get_param: servers}
config: {get_resource: CephStorageArtifactsConfig}
input_values:
update_identifier: {get_param: NodeConfigIdentifiers}
CephStoragePuppetConfig:
type: OS::Heat::SoftwareConfig
properties:
@ -29,6 +40,7 @@ resources:
CephStorageDeployment_Step1:
type: OS::Heat::StructuredDeployments
depends_on: CephStorageArtifactsDeploy
properties:
name: CephStorageDeployment_Step1
servers: {get_param: servers}

View File

@ -14,8 +14,20 @@ parameters:
resources:
VolumeArtifactsConfig:
type: deploy-artifacts.yaml
VolumeArtifactsDeploy:
type: OS::Heat::StructuredDeployments
properties:
servers: {get_param: servers}
config: {get_resource: VolumeArtifactsConfig}
input_values:
update_identifier: {get_param: NodeConfigIdentifiers}
VolumePuppetConfig:
type: OS::Heat::SoftwareConfig
depends_on: VolumeArtifactsDeploy
properties:
group: puppet
options:

View File

@ -17,6 +17,17 @@ parameters:
resources:
ComputeArtifactsConfig:
type: deploy-artifacts.yaml
ComputeArtifactsDeploy:
type: OS::Heat::StructuredDeployments
properties:
servers: {get_param: servers}
config: {get_resource: ComputeArtifactsConfig}
input_values:
update_identifier: {get_param: NodeConfigIdentifiers}
ComputePuppetConfig:
type: OS::Heat::SoftwareConfig
properties:
@ -30,6 +41,7 @@ resources:
ComputePuppetDeployment:
type: OS::Heat::StructuredDeployments
depends_on: ComputeArtifactsDeploy
properties:
name: ComputePuppetDeployment
servers: {get_param: servers}

View File

@ -17,6 +17,15 @@ parameters:
resources:
ControllerArtifactsConfig:
type: deploy-artifacts.yaml
ControllerArtifactsDeploy:
type: OS::Heat::StructuredDeployments
properties:
servers: {get_param: servers}
config: {get_resource: ControllerArtifactsConfig}
ControllerPrePuppet:
type: OS::TripleO::Tasks::ControllerPrePuppet
properties:
@ -33,7 +42,7 @@ resources:
# e.g all Deployment resources should have a *Deployment_StepN suffix
ControllerLoadBalancerDeployment_Step1:
type: OS::Heat::StructuredDeployments
depends_on: ControllerPrePuppet
depends_on: [ControllerPrePuppet, ControllerArtifactsDeploy]
properties:
name: ControllerLoadBalancerDeployment_Step1
servers: {get_param: servers}

View File

@ -0,0 +1,26 @@
#!/bin/bash
TMP_DATA=$(mktemp -d)
function cleanup {
rm -Rf "$TMP_DATA"
}
trap cleanup EXIT
if [ -n "$artifact_urls" ]; then
for URL in $(echo $artifact_urls | sed -e "s| |\n|g" | sort -u); do
curl -o $TMP_DATA/file_data "$artifact_urls"
if file -b $TMP_DATA/file_data | grep RPM &>/dev/null; then
yum install -y $TMP_DATA/file_data
elif file -b $TMP_DATA/file_data | grep 'gzip compressed data' &>/dev/null; then
pushd /
tar xvzf $TMP_DATA/file_data
popd
else
echo "ERROR: Unsupported file format."
exit 1
fi
rm $TMP_DATA/file_data
done
else
echo "No artifact_urls was set. Skipping..."
fi

View File

@ -0,0 +1,32 @@
heat_template_version: 2015-04-30
description: >
Software Config to install deployment artifacts (tarball's and/or
distribution packages) via HTTP URLs. The contents of the URL's can
be tarballs or distribution packages (RPMs). If a tarball URL is supplied
it is extracted onto the target node during deployment. If a package is
deployed it is installed from the supplied URL. Note, you need the
heat-config-script element built into your images, due to the script group
below.
parameters:
DeployArtifactURLs:
default: []
description: A list of HTTP URLs containing deployment artifacts.
Currently supports tarballs and RPM packages.
type: comma_delimited_list
resources:
DeployArtifacts:
type: OS::Heat::SoftwareConfig
properties:
group: script
inputs:
- name: artifact_urls
default: {list_join: [' ', {get_param: DeployArtifactURLs}]}
config: {get_file: ./deploy-artifacts.sh}
outputs:
OS::stack_id:
description: The ID of the DeployArtifacts resource.
value: {get_resource: DeployArtifacts}

View File

@ -12,9 +12,19 @@ parameters:
type: json
description: Value which changes if the node configuration may need to be re-applied
resources:
StorageArtifactsConfig:
type: deploy-artifacts.yaml
StorageArtifactsDeploy:
type: OS::Heat::StructuredDeployments
properties:
servers: {get_param: servers}
config: {get_resource: StorageArtifactsConfig}
input_values:
update_identifier: {get_param: NodeConfigIdentifiers}
StoragePuppetConfig:
type: OS::Heat::SoftwareConfig
properties:
@ -28,6 +38,7 @@ resources:
StorageDeployment_Step1:
type: OS::Heat::StructuredDeployments
depends_on: StorageArtifactsDeploy
properties:
name: StorageDeployment_Step1
servers: {get_param: servers}