2022-06-11 17:49:37 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -o pipefail
|
2022-06-12 09:08:48 +00:00
|
|
|
{{ import_gpg_cmd }} | tee -a {{ sync_log }}
|
|
|
|
{{ dnf_plugin_cmd }} | tee -a {{ sync_log }}
|
2022-07-07 06:41:28 +00:00
|
|
|
sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/*.repo
|
2022-07-16 18:44:05 +00:00
|
|
|
{{ metadata_cmd }} | tee -a {{ sync_log }}
|
2022-06-12 09:08:48 +00:00
|
|
|
{{ sync_cmd }} | tee -a {{ sync_log }}
|
|
|
|
|
2022-07-12 07:59:19 +00:00
|
|
|
# Yes this is a bit hacky. Can't think of a better way to do this.
|
|
|
|
ret_val=$?
|
|
|
|
if [ "$ret_val" -ne 0 ]; then
|
|
|
|
echo "SYNCING FAILED" | tee -a {{ sync_log }}
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$ret_val" -eq 0 ]; then
|
|
|
|
recs=$(grep '\[FAILED\]' {{ sync_log }})
|
|
|
|
if [[ -n "${recs}" ]]; then
|
|
|
|
echo "SOME PACKAGES DID NOT DOWNLOAD" | tee -a {{ sync_log }}
|
|
|
|
exit 1
|
|
|
|
else
|
2022-07-25 23:46:53 +00:00
|
|
|
{% if deploy_extra_files %}
|
|
|
|
pushd {{ download_path }}
|
|
|
|
curl -RO {{ gpg_key_url }}
|
|
|
|
popd
|
|
|
|
{% endif %}
|
2022-07-12 07:59:19 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2022-07-16 18:44:05 +00:00
|
|
|
# {{ check_cmd }} | tee -a {{ sync_log }}
|