tripleo-ansible/tripleo_ansible/roles/tripleo_container_manage/tasks/create.yml

36 lines
1.6 KiB
YAML

---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# 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 containers managed by Podman for {{ tripleo_container_manage_config }}"
tripleo_container_manage:
config_id: "{{ tripleo_container_manage_config_id }}"
config_dir: "{{ tripleo_container_manage_config }}"
config_patterns: "{{ tripleo_container_manage_config_patterns }}"
config_overrides: "{{ tripleo_container_manage_config_overrides }}"
concurrency: "{{ tripleo_container_manage_concurrency }}"
- name: "Manage container systemd services and cleanup old systemd healthchecks for {{ tripleo_container_manage_config }}"
become: true
container_systemd:
container_config: "{{ container_config }}"
debug: "{{ tripleo_container_manage_debug | bool }}"
systemd_healthchecks: "{{ (not tripleo_container_manage_healthcheck_disabled | bool) }}"
vars:
container_config: "{{ all_containers_hash | dict_to_list | haskey(attribute='restart', value=['always','unless-stopped'], any=True) | default([]) }}"
when:
- tripleo_container_manage_cli == 'podman'
- (container_config|length) > 0