]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
podman: support podman installation on rhel8
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 16 Jan 2019 09:27:23 +0000 (10:27 +0100)
committerSébastien Han <seb@redhat.com>
Tue, 5 Feb 2019 17:14:28 +0000 (18:14 +0100)
Add required changes to support podman on rhel8

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1667101
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
library/ceph_key.py
library/ceph_volume.py
library/test_ceph_volume.py
roles/ceph-config/tasks/create_ceph_initial_dirs.yml
roles/ceph-container-common/tasks/pre_requisites/prerequisites.yml
roles/ceph-facts/tasks/facts.yml
roles/ceph-mon/tasks/deploy_monitors.yml
roles/ceph-osd/tasks/start_osds.yml
roles/ceph-osd/templates/ceph-osd-run.sh.j2
site-container.yml.sample

index bc49ae2b412ebc7afe76fdf51cbd7d3433fce96d..8a4c96089a62f6f009862e6adcca17e88573b8f6 100644 (file)
@@ -651,6 +651,7 @@ def run_module():
             module, list_keys(cluster, user, user_key, container_image))
         if rc != 0:
             result["stdout"] = "failed to retrieve ceph keys".format(name)
+            result["sdterr"] = err
             result['rc'] = 0
             module.exit_json(**result)
 
index 53e58a90ff52b1867aac50e228c3ab0dc1ab2ea6..a1cb5f38ca9ec1bac1e65b19400bb40362390d69 100644 (file)
@@ -193,7 +193,7 @@ def container_exec(binary, container_image):
                     '-v', '/run/lock/lvm:/run/lock/lvm:z',
                     '-v', '/var/run/udev/:/var/run/udev/:z',
                     '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z',
-                    '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket',
+                    '-v', '/run/lvm/:/run/lvm/',
                     '-v', '/var/lib/ceph/:/var/lib/ceph/:z',
                     '-v', '/var/log/ceph/:/var/log/ceph/:z',
                     os.path.join('--entrypoint=' + binary),
index e262b75c216f62ab26f86a71dada9a9d6a3ae19c..4aba8e7326fd26fa730bb3f65136e1a92f2f4816 100644 (file)
@@ -46,7 +46,7 @@ class TestCephVolumeModule(object):
                                  '-v', '/run/lock/lvm:/run/lock/lvm:z',
                                  '-v', '/var/run/udev/:/var/run/udev/:z',
                                  '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z',  # noqa E501
-                                 '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket',  # noqa E501
+                                 '-v', '/run/lvm/:/run/lvm/',  # noqa E501
                                  '-v', '/var/lib/ceph/:/var/lib/ceph/:z',
                                  '-v', '/var/log/ceph/:/var/log/ceph/:z',
                                  '--entrypoint=ceph-volume',
@@ -62,7 +62,7 @@ class TestCephVolumeModule(object):
                                  '-v', '/run/lock/lvm:/run/lock/lvm:z',
                                  '-v', '/var/run/udev/:/var/run/udev/:z',
                                  '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z',  # noqa E501
-                                 '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket',  # noqa E501
+                                 '-v', '/run/lvm/:/run/lvm/',  # noqa E501
                                  '-v', '/var/lib/ceph/:/var/lib/ceph/:z',
                                  '-v', '/var/log/ceph/:/var/log/ceph/:z',
                                  '--entrypoint=ceph-volume',
@@ -130,7 +130,7 @@ class TestCephVolumeModule(object):
                                  '-v', '/run/lock/lvm:/run/lock/lvm:z',
                                  '-v', '/var/run/udev/:/var/run/udev/:z',
                                  '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z',  # noqa E501
-                                 '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket',  # noqa E501
+                                 '-v', '/run/lvm/:/run/lvm/',  # noqa E501
                                  '-v', '/var/lib/ceph/:/var/lib/ceph/:z',
                                  '-v', '/var/log/ceph/:/var/log/ceph/:z',
                                  '--entrypoint=ceph-volume',
@@ -162,7 +162,7 @@ class TestCephVolumeModule(object):
                                  '-v', '/run/lock/lvm:/run/lock/lvm:z',
                                  '-v', '/var/run/udev/:/var/run/udev/:z',
                                  '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z',  # noqa E501
-                                 '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket',  # noqa E501
+                                 '-v', '/run/lvm/:/run/lvm/',  # noqa E501
                                  '-v', '/var/lib/ceph/:/var/lib/ceph/:z',
                                  '-v', '/var/log/ceph/:/var/log/ceph/:z',
                                  '--entrypoint=ceph-volume',
@@ -185,7 +185,7 @@ class TestCephVolumeModule(object):
                                  '-v', '/run/lock/lvm:/run/lock/lvm:z',
                                  '-v', '/var/run/udev/:/var/run/udev/:z',
                                  '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z',  # noqa E501
-                                 '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket',  # noqa E501
+                                 '-v', '/run/lvm/:/run/lvm/',  # noqa E501
                                  '-v', '/var/lib/ceph/:/var/lib/ceph/:z',
                                  '-v', '/var/log/ceph/:/var/log/ceph/:z',
                                  '--entrypoint=ceph-volume',
@@ -233,7 +233,7 @@ class TestCephVolumeModule(object):
                                  '-v', '/run/lock/lvm:/run/lock/lvm:z',
                                  '-v', '/var/run/udev/:/var/run/udev/:z',
                                  '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z',  # noqa E501
-                                 '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket',  # noqa E501
+                                 '-v', '/run/lvm/:/run/lvm/',  # noqa E501
                                  '-v', '/var/lib/ceph/:/var/lib/ceph/:z',
                                  '-v', '/var/log/ceph/:/var/log/ceph/:z',
                                  '--entrypoint=ceph-volume',
@@ -282,7 +282,7 @@ class TestCephVolumeModule(object):
                                  '-v', '/run/lock/lvm:/run/lock/lvm:z',
                                  '-v', '/var/run/udev/:/var/run/udev/:z',
                                  '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z',  # noqa E501
-                                 '-v', '/run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket',  # noqa E501
+                                 '-v', '/run/lvm/:/run/lvm/',  # noqa E501
                                  '-v', '/var/lib/ceph/:/var/lib/ceph/:z',
                                  '-v', '/var/log/ceph/:/var/log/ceph/:z',
                                  '--entrypoint=ceph-volume',
index eba1fcfa28cf0afe0fd742bfb3879b5583158789..b7c9a084801bfb5f46e7d015b1cfee14d366f640 100644 (file)
@@ -16,6 +16,7 @@
       - /var/lib/ceph/bootstrap-rbd
       - /var/lib/ceph/bootstrap-rbd-mirror
       - /var/run/ceph
+      - /var/log/ceph
 
 - name: create ceph initial directories
   file:
index 9e1dac16ca842bbe56622ce1f9ae54c7b863b9d9..bfa04ef8886815786fcf82d381f28731cde866ea 100644 (file)
@@ -46,7 +46,7 @@
   tags:
     with_pkg
 
-- name: red hat based systems tasks
+- name: red hat based systems tasks
   block:
     - name: install python-docker-py on red hat / centos
       package:
       until: result is succeeded
       tags:
         with_pkg
+
+    - name: pause after docker install before starting (on openstack vms)
+      pause: seconds=5
+      when:
+        - ceph_docker_on_openstack
+      tags:
+        with_pkg
+
+    - name: start docker service
+      service:
+        name: docker
+        state: started
+        enabled: yes
+      tags:
+        with_pkg
+
   when:
     - ansible_os_family == 'RedHat'
+    - ansible_distribution_major_version == '7'
 
-- name: pause after docker install before starting (on openstack vms)
-  pause: seconds=5
+- name: red hat 8 based systems tasks
+  block:
+    - name: install podman
+      package:
+        name: 'podman'
+        state: present
+      register: result
+      until: result is succeeded
+      tags:
+        with_pkg
   when:
-    - ceph_docker_on_openstack
-  tags:
-    with_pkg
-
-- name: start docker service
-  service:
-    name: docker
-    state: started
-    enabled: yes
-  tags:
-    with_pkg
+    - ansible_os_family == 'RedHat'
+    - ansible_distribution_major_version == '8'
\ No newline at end of file
index 60a16db816f4956e5cd72c2caff19ffba2d226b6..cb223cc38c412439bfcc66035e62f359459c2c83 100644 (file)
@@ -19,7 +19,7 @@
 
 - name: set_fact container_binary
   set_fact:
-    container_binary: "{{ 'podman' if is_podman and ansible_distribution == 'Fedora' else 'docker' }}"
+    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' }}"
   when: containerized_deployment
 
 # Set ceph_release to ceph_stable by default
index 4b7aa77e363c29aa095a90ef432a196bcd55c698..6ebafa46009ee7a6f8721118386c63046323e1ff 100644 (file)
@@ -83,7 +83,7 @@
 - name: import admin keyring into mon keyring
   command: >
     {{ ceph_authtool_cmd }}
-     /var/lib/ceph/tmp/{{ cluster }}.mon.keyring --import-keyring /etc/ceph/{{ cluster }}.client.admin.keyring
+     /var/lib/ceph/tmp/{{ cluster }}.mon..keyring --import-keyring /etc/ceph/{{ cluster }}.client.admin.keyring
   when:
     - not create_custom_admin_secret.get('skipped')
     - cephx
@@ -97,8 +97,8 @@
   command: >
     {{ ceph_mon_cmd }}
     --cluster {{ cluster }}
-    --setuser ceph
-    --setgroup ceph
+    --setuser 167
+    --setgroup 167
     --mkfs
     -i {{ monitor_name }}
     --fsid {{ fsid }}
index ce2184f791ce6b736e049e5aefb8d4e6ec630b14..49999f27cc8455c8c4addbd20ab204c6ae5b91de 100644 (file)
@@ -41,7 +41,7 @@
 
 - name: set_fact docker_exec_start_osd
   set_fact:
-    docker_exec_start_osd: "{{ '{{ container_binary }} run --rm --privileged=true -v /var/run/udev/:/var/run/udev/:z -v /run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket -v /etc/ceph:/etc/ceph:z -v /dev:/dev --entrypoint=ceph-volume ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else 'ceph-volume' }}"
+    docker_exec_start_osd: "{{ '{{ container_binary }} run --rm --privileged=true -v /var/run/udev/:/var/run/udev/:z -v /run/lvm/:/run/lvm/ -v /etc/ceph:/etc/ceph:z -v /dev:/dev --entrypoint=ceph-volume ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else 'ceph-volume' }}"
 
 - name: collect osd ids
   shell: >
index 968dc49006621532f4dd9ccbe5b4cf6348f43b03..ac2c5759de868301e5a6532818c6e3ead2547d83 100644 (file)
@@ -105,7 +105,7 @@ fi
   -e TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }} \
   {% endif -%}
   {% if osd_scenario == 'lvm' -%}
-  -v /run/lvm/lvmetad.socket:/run/lvm/lvmetad.socket \
+  -v /run/lvm/:/run/lvm/ \
   -e CEPH_DAEMON=OSD_CEPH_VOLUME_ACTIVATE \
   -e OSD_ID="$1" \
   --name=ceph-osd-"$1" \
index 117c82b36f3934977c664adcfda63fcda7d46255..86f13f12735eeb7dc74aaff5f2ff35bb34626002 100644 (file)
@@ -60,7 +60,7 @@
 
     - name: set_fact container_binary
       set_fact:
-        container_binary: "{{ 'podman' if podman_binary.stat.exists and ansible_distribution == 'Fedora' else 'docker' }}"
+        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' }}"
 
     - import_role:
         name: ceph-defaults
   tasks:
     - import_role:
         name: ceph-defaults
+
     - 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' }}"
+
     - name: get ceph status from the first monitor
       command: >
-        {{ 'podman' if podman_binary.stat.exists and ansible_distribution == 'Fedora' else 'docker' }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s
+        {{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s
       register: ceph_status
       changed_when: false
       delegate_to: "{{ groups[mon_group_name][0] }}"