Use wget instead of ansible get_url module

The ansible get_url module uses curl, which is not
tolerant of flaky HTTP connections. The wget command
on the other hand has built-in retry with resume.

Change-Id: Ibac865cc951be998f64bf5b846151043c0b393aa
This commit is contained in:
John Trowbridge
2016-02-02 15:58:11 -05:00
parent 990f43f6f4
commit a1e6e4dca8
3 changed files with 20 additions and 36 deletions

View File

@@ -19,25 +19,7 @@ ready to rock is::
The defaults are meant to "just work", so it is as easy as
downloading and running the quickstart.sh script.
Or rather it will be once we have a good place to host the
images. The centosci artifacts server drops the http connection
regularly, so we need to use wget for the built in retry with
resume. From the machine that will be the virthost, create a
directory for the undercloud image and wget it. Note, the
image location should be world readable since a ``stack`` user
is used for most steps.::
mkdir -p /usr/share/quickstart_images/mitaka/
cd /usr/share/quickstart_images/mitaka/
wget https://ci.centos.org/artifacts/rdo/images/mitaka/delorean/stable/undercloud.qcow2.md5 \
https://ci.centos.org/artifacts/rdo/images/mitaka/delorean/stable/undercloud.qcow2
# Check that the md5sum's match (The playbook will also
# check, but better to know now whether the image download
# was ok.)
md5sum -c undercloud.qcow2.md5
Then use the quickstart.sh script to install this repo along
The quickstart.sh script will install this repo along
with ansible in a virtual environment and run the quickstart
playbook. Note, the quickstart playbook will delete the ``stack``
user on the virthost and recreate it.::
@@ -49,10 +31,9 @@ user on the virthost and recreate it.::
bash quickstart.sh -u $UNDERCLOUD_QCOW2_LOCATION $VIRTHOST
This script will output instructions at the end to access the
deployed undercloud. Note that to use a different release you will need to
download a different undercloud image in the first step above.
For example, for liberty:
https://ci.centos.org/artifacts/rdo/images/liberty/delorean/stable/undercloud.qcow2
deployed undercloud. If a release name is not given, ``mitaka``
is used.
Documentation
=============

View File

@@ -8,20 +8,14 @@
bridges: "{{ networks.bridges }}"
register: undercloud_mac_map
- name: get expected md5 of undercloud appliance
shell: curl {{ url }}.md5 | awk '{ print $1 }'
register: undercloud_md5
- name: Create script to get the undercloud appliance
template:
src: get-undercloud.sh.j2
dest: "{{ working_dir }}/get-undercloud.sh"
mode: 0744
- name: get undercloud appliance
register: get_undercloud_result
until: get_undercloud_result.msg.find('did not match') == -1
retries: 3
delay: 10
get_url:
url: '{{ url }}'
dest: '{{ working_dir }}'
timeout: 1200
checksum: 'md5:{{ undercloud_md5.stdout }}'
- name: Get the undercloud appliance
shell: "{{ working_dir }}/get-undercloud.sh"
- name: copy instackenv.json to appliance
shell: >

View File

@@ -0,0 +1,9 @@
set -ex
sudo yum install -y wget --quiet
# Use wget rather than get_url module for its
# retry with resume feature
pushd {{ working_dir }}
wget --quiet {{ url }}.md5 {{ url }}
md5sum -c undercloud.qcow2.md5
popd