Switch to ansible for deploying artifacts
We've long supported the ability to deploy rpms or tar.gz to a system during deployment. It currently is a shell script so let's convert it to an ansible module. Change-Id: Id30f89cf261b356f25a93e5df5550e9dfb08f808 Depends-On: https://review.opendev.org/#/c/748757/
This commit is contained in:
parent
78ca1fe143
commit
738857c7c3
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue