From 4f57e44f9ca420b6802a0bff791f8970422caf14 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Tue, 20 Nov 2018 22:29:53 +0100 Subject: [PATCH] defaults: declare container_binary MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Always declare container_binary and assign it a correct value. Signed-off-by: Sébastien Han --- group_vars/all.yml.sample | 2 ++ group_vars/rhcs.yml.sample | 2 ++ infrastructure-playbooks/rolling_update.yml | 4 ++++ roles/ceph-defaults/defaults/main.yml | 2 ++ roles/ceph-defaults/tasks/facts.yml | 5 +---- site-container.yml.sample | 4 ++-- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index bd57d872d..0e4f91c11 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -543,6 +543,8 @@ dummy: #ceph_docker_enable_centos_extra_repo: false #ceph_docker_on_openstack: false #containerized_deployment: False +#container_binary: + ############ # KV store # diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index 211803c0d..a3135090a 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -543,6 +543,8 @@ ceph_docker_registry: "registry.access.redhat.com/rhceph/" #ceph_docker_enable_centos_extra_repo: false #ceph_docker_on_openstack: false #containerized_deployment: False +#container_binary: + ############ # KV store # diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index 3d417c862..9469b9497 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -233,6 +233,10 @@ serial: 1 become: True tasks: + - import_role: + name: ceph-defaults + private: false + - name: non container - get current fsid command: "ceph --cluster {{ cluster }} fsid" register: cluster_uuid_non_container diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index 83cf9698f..68967a839 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -535,6 +535,8 @@ ceph_client_docker_registry: "{{ ceph_docker_registry }}" ceph_docker_enable_centos_extra_repo: false ceph_docker_on_openstack: false containerized_deployment: False +container_binary: + ############ # KV store # diff --git a/roles/ceph-defaults/tasks/facts.yml b/roles/ceph-defaults/tasks/facts.yml index d5912202d..c2e905f0c 100644 --- a/roles/ceph-defaults/tasks/facts.yml +++ b/roles/ceph-defaults/tasks/facts.yml @@ -16,13 +16,10 @@ - name: set_fact is_podman set_fact: is_podman: "{{ podman_binary.stat.exists }}" - when: - - is_atomic - - ansible_distribution == 'Fedora' - name: set_fact container_binary set_fact: - container_binary: "{{ 'podman' if is_atomic and is_podman else 'docker' }}" + container_binary: "{{ 'podman' if is_atomic and is_podman and ansible_distribution == 'Fedora' else 'docker' }}" when: containerized_deployment - name: set_fact monitor_name ansible_hostname diff --git a/site-container.yml.sample b/site-container.yml.sample index 0f4cf9d08..1b4f27d70 100644 --- a/site-container.yml.sample +++ b/site-container.yml.sample @@ -57,7 +57,7 @@ - name: set_fact container_binary set_fact: - container_binary: "{{ 'podman' if podman_binary.stat.exists else 'docker' }}" + container_binary: "{{ 'podman' if podman_binary.stat.exists and ansible_distribution == 'Fedora' else 'docker' }}" - import_role: name: ceph-defaults @@ -468,7 +468,7 @@ - name: get ceph status from the first monitor command: > - {{ 'podman' if podman_binary.stat.exists else 'docker' }} exec ceph-mon-{{ hostvars[groups['mons'][0]]['ansible_hostname'] }} ceph --cluster {{ cluster | default ('ceph') }} -s + {{ 'podman' if podman_binary.stat.exists and ansible_distribution == 'Fedora' else 'docker' }} exec ceph-mon-{{ hostvars[groups['mons'][0]]['ansible_hostname'] }} ceph --cluster {{ cluster | default ('ceph') }} -s register: ceph_status changed_when: false delegate_to: "{{ groups['mons'][0] }}" -- 2.39.5