Merge "Switch to ansible for deploying artifacts"

This commit is contained in:
Zuul 2020-09-21 07:14:03 +00:00 committed by Gerrit Code Review
commit ba50a97f9f
2 changed files with 5 additions and 35 deletions

View File

@ -363,7 +363,7 @@ outputs:
validate_fqdn: {get_param: ValidateFqdn}
ping_test_ips: {get_param: PingTestIpsMap}
stack_action: {get_param: StackAction}
deploy_artifact_urls: {list_join: [' ', {get_param: DeployArtifactURLs}]}
deploy_artifact_urls: {get_param: DeployArtifactURLs}
hosts_entry: {get_param: HostsEntry}
primary_role_name: {{ primary_role_name }}
deploy_identifier: {get_param: DeployIdentifier}
@ -411,7 +411,6 @@ outputs:
deploy_steps_tasks_step_0: {get_file: deploy-steps-tasks-step-0.yaml}
common_deploy_steps_tasks_step_1: {get_file: deploy-steps-tasks-step-1.yaml}
container_puppet_script: {get_file: ./container-puppet.sh}
deploy-artifacts.sh : {get_file: ../puppet/deploy-artifacts.sh}
generate-config-tasks: {get_file: generate-config-tasks.yaml}
host-container-puppet-tasks: {get_file: host-container-puppet-tasks.yaml}
deploy_steps_playbook:
@ -607,10 +606,11 @@ outputs:
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
tasks:
{% raw %}
- name: ArtifactsConfig
script: deploy-artifacts.sh
environment:
- name: Deploy Artifacts
tripleo_deploy_artifacts:
artifact_urls: "{{ deploy_artifact_urls }}"
when:
- deploy_artifact_urls|default([])|length > 0
{% endraw %}
{%- for role in roles %}
- name: {{role.name}} Host prep block

View File

@ -1,30 +0,0 @@
#!/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 --globoff -o $TMP_DATA/file_data "$URL"
if file -b $TMP_DATA/file_data | grep RPM &>/dev/null; then
mv $TMP_DATA/file_data $TMP_DATA/file_data.rpm
yum install -y $TMP_DATA/file_data.rpm
rm $TMP_DATA/file_data.rpm
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: $URL"
exit 1
fi
if [ -f $TMP_DATA/file_data ]; then
rm $TMP_DATA/file_data
fi
done
else
echo "No artifact_urls was set. Skipping..."
fi