Add support for DeployArtifactURLs
Adds a new nested stack deployment which allows operators to opt-in to deploy tarball's and RPM packages by setting DeployArtifactURLs as a parameter_default in a Heat environment. The intent is to use this setting to allow t-h-t to transparently deploy things like tarballs of puppet modules via a Swift Temp URL. Change-Id: I1bad4a4a79cf297f5b6e439e0657269738b5f326 Implements: blueprint puppet-modules-deployment-via-swift
This commit is contained in:
parent
8411e5a5bc
commit
55054f02d7
@ -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}
|
||||
|
@ -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:
|
||||
|
@ -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}
|
||||
|
@ -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}
|
||||
|
26
puppet/deploy-artifacts.sh
Normal file
26
puppet/deploy-artifacts.sh
Normal 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
|
32
puppet/deploy-artifacts.yaml
Normal file
32
puppet/deploy-artifacts.yaml
Normal 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}
|
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user