319e37c8f5
Sometimes, especially with restricted internet access through proxies or firewalls, the LXC container creation fails when using the download template. The failure is due to the inability to access the gpg keyserver and therefore the inability to validate the downloaded image. This patch implements the usage of a primary and secondary keyserver, and uses a primary keyserver which is more likely to be accessible in restricted environments as it's accessed on port 80. Change-Id: Ic1ca3d9f3c7d720e9715b6dcc67a7888910e6d0d Closes-Bug: #1609479
50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
---
|
|
# Copyright 2014, Rackspace US, Inc.
|
|
#
|
|
# 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.
|
|
|
|
- name: Create base container
|
|
lxc_container:
|
|
name: "LXC_NAME"
|
|
template: "download"
|
|
state: stopped
|
|
backing_store: "dir"
|
|
template_options: "{{ lxc_cache_download_template_options }} --keyserver {{ lxc_image_cache_primary_keyserver }}"
|
|
register: cache_download_primary
|
|
retries: 3
|
|
delay: 10
|
|
until: cache_download_primary | success
|
|
ignore_errors: yes
|
|
tags:
|
|
- lxc-cache
|
|
- lxc-cache-download
|
|
|
|
- name: Create base container
|
|
lxc_container:
|
|
name: "LXC_NAME"
|
|
template: "download"
|
|
state: stopped
|
|
backing_store: "dir"
|
|
template_options: "{{ lxc_cache_download_template_options }} --keyserver {{ lxc_image_cache_secondary_keyserver }}"
|
|
when: cache_download_primary | failed
|
|
register: cache_download_secondary
|
|
retries: 3
|
|
delay: 10
|
|
until: cache_download_secondary | success
|
|
tags:
|
|
- lxc-cache
|
|
- lxc-cache-download
|
|
|
|
- include: lxc_cache_preparation.yml
|
|
- include: lxc_cache_create.yml
|