openstack-ansible-lxc_hosts/tasks/lxc_cache_preparation_systemd_new.yml
Logan V 8cf5a6ad56 Revert "Temporary fix of failing aria2 on centos"
The fix is no longer needed since a fixed aria2 package has been promoted in epel.

See https://bugzilla.redhat.com/show_bug.cgi?id=1704413

This is a revert of the following changes:
I7770c5417feacfc43a3ad8801125603a55ba9ea8
I26d3c9338247ffc789bf4a5291e65e954151cc51
I4ec91f541e6d2d4cca4d899f4c7d519b169e2f50

Change-Id: Ia181556e77dcc85bea726e47fc8ca1f097cc3bbb
2019-05-19 12:50:23 -05:00

59 lines
1.7 KiB
YAML

---
# Copyright 2015, 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.
# NOTE(cloudnull): When modern SystemD is running everywhere this can be
# collapsed back into the base preparation task file.
- name: Remove old image cache
command: "machinectl remove {{ lxc_container_base_name }}"
register: cache_refresh
changed_when: cache_refresh.rc == 0
failed_when: cache_refresh.rc not in [0, 1]
when:
- lxc_image_cache_refresh | bool
- name: Ensure image has been pre-staged
async_status:
jid: "{{ prestage_image.ansible_job_id }}"
register: job_result
until: job_result.finished
retries: 60
- name: Ensure systemd-importd is enabled
systemd:
name: "systemd-importd"
state: "started"
enabled: "yes"
daemon_reload: "yes"
notify:
- Restart importd
- name: Retrieve base image
command: >-
machinectl
--verify=no
{{ lxc_image_cache_pull_mode }}
/tmp/{{ cache_basename }}
{{ lxc_container_base_name }}
register: pull_image
until: pull_image is success
retries: 3
delay: 1
changed_when: pull_image.rc == 0
failed_when:
- pull_image.rc != 0
- "'failed' in pull_image.stderr | lower"
notify:
- Remove rootfs archive