From: Sébastien Han Date: Tue, 20 Nov 2018 21:29:53 +0000 (+0100) Subject: defaults: declare container_binary X-Git-Tag: v4.0.0beta1~174 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4f57e44f9ca420b6802a0bff791f8970422caf14;p=ceph-ansible.git defaults: declare container_binary Always declare container_binary and assign it a correct value. Signed-off-by: Sébastien Han --- 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] }}"