mirror of https://github.com/ceph/ceph-ansible.git
facts: isolate container_binary facts
in order to be able to call container_binary without having to run the whole ceph-facts role. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>pull/4805/head
parent
d23383a820
commit
fe5ffe589e
|
@ -378,10 +378,11 @@
|
|||
become: true
|
||||
|
||||
tasks:
|
||||
- name: set ceph_docker_registry value if not set
|
||||
set_fact:
|
||||
ceph_docker_registry: "docker.io"
|
||||
when: ceph_docker_registry is not defined
|
||||
- import_role:
|
||||
name: ceph-defaults
|
||||
- import_role:
|
||||
name: ceph-facts
|
||||
tasks_from: container_binary
|
||||
|
||||
- name: disable node_exporter service
|
||||
service:
|
||||
|
@ -415,10 +416,11 @@
|
|||
- alertmanager
|
||||
|
||||
tasks:
|
||||
- name: set ceph_docker_registry value if not set
|
||||
set_fact:
|
||||
ceph_docker_registry: "docker.io"
|
||||
when: ceph_docker_registry is not defined
|
||||
- import_role:
|
||||
name: ceph-defaults
|
||||
- import_role:
|
||||
name: ceph-facts
|
||||
tasks_from: container_binary
|
||||
|
||||
- name: stop services
|
||||
service:
|
||||
|
@ -517,8 +519,6 @@
|
|||
tasks:
|
||||
- import_role:
|
||||
name: ceph-defaults
|
||||
- import_role:
|
||||
name: ceph-facts
|
||||
|
||||
- name: check if it is Atomic host
|
||||
stat: path=/run/ostree-booted
|
||||
|
@ -528,6 +528,10 @@
|
|||
set_fact:
|
||||
is_atomic: "{{ stat_ostree.stat.exists }}"
|
||||
|
||||
- import_role:
|
||||
name: ceph-facts
|
||||
tasks_from: container_binary
|
||||
|
||||
- name: remove ceph container image
|
||||
command: "{{ container_binary }} rmi {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
||||
tags:
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
- name: check if podman binary is present
|
||||
stat:
|
||||
path: /usr/bin/podman
|
||||
register: podman_binary
|
||||
|
||||
- name: set_fact container_binary
|
||||
set_fact:
|
||||
container_binary: "{{ 'podman' if (podman_binary.stat.exists and ansible_distribution == 'Fedora') or (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '8') else 'docker' }}"
|
|
@ -8,19 +8,13 @@
|
|||
set_fact:
|
||||
is_atomic: "{{ stat_ostree.stat.exists }}"
|
||||
|
||||
- name: check if podman binary is present
|
||||
stat:
|
||||
path: /usr/bin/podman
|
||||
register: podman_binary
|
||||
- name: import_tasks container_binary.yml
|
||||
import_tasks: container_binary.yml
|
||||
|
||||
- name: set_fact is_podman
|
||||
set_fact:
|
||||
is_podman: "{{ podman_binary.stat.exists }}"
|
||||
|
||||
- name: set_fact container_binary
|
||||
set_fact:
|
||||
container_binary: "{{ 'podman' if (podman_binary.stat.exists and ansible_distribution == 'Fedora') or (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '8') else 'docker' }}"
|
||||
|
||||
# In case ansible_python_interpreter is set by the user,
|
||||
# ansible will not discover python and discovered_interpreter_python
|
||||
# will not be set
|
||||
|
|
Loading…
Reference in New Issue