# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
# This is overly complex, however get_url will always re-retrieve the file
# if it already exists, and this is to prevent that behavior.
- name: "Test if IPA kernel is present"
  stat: path={{ ipa_kernel }}
  register: test_ipa_kernel_present
- name: "Download IPA kernel"
  get_url: url={{ ipa_kernel_upstream_url }} dest={{ ipa_kernel }}
  when: test_ipa_kernel_present.stat.exists == false
- name: "Test if IPA image is present"
  stat: path={{ ipa_ramdisk }}
  register: test_ipa_image_present
- name: "Download IPA image"
  get_url: url={{ ipa_ramdisk_upstream_url }} dest={{ ipa_ramdisk }}
  when: test_ipa_image_present.stat.exists == false

# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
# This is overly complex, however get_url will always re-retrieve the file
# if it already exists, and this is to prevent that behavior.
- name: "Test if IPA kernel is present"
  stat: path={{ ipa_kernel }}
  register: test_ipa_kernel_present
- name: "Download IPA kernel"
  get_url: url={{ ipa_kernel_upstream_url }} dest={{ ipa_kernel }} timeout=300
  when: test_ipa_kernel_present.stat.exists == false
- name: "Test if IPA image is present"
  stat: path={{ ipa_ramdisk }}
  register: test_ipa_image_present
- name: "Download IPA image"
  get_url: url={{ ipa_ramdisk_upstream_url }} dest={{ ipa_ramdisk }} timeout=300
  when: test_ipa_image_present.stat.exists == false

Increase timeout for downloading IPA ramdisk and kernel
Increase timeout for downloading IPA ramdisk and kernel

Timeout option added in 1.8 for "get_url" module, default is 10
second. It's not suitable for slow internet connections and Bifrost
fails. This patch increases value to 300 second.

Change-Id: I4ac856c1f95e352947fcd399a4439ba5345fa11b
