]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
cephadm-adopt: configure repository for cephadm installation
authorSeena Fallah <seenafallah@gmail.com>
Thu, 5 Aug 2021 15:48:38 +0000 (20:18 +0430)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 18 Oct 2021 16:38:47 +0000 (18:38 +0200)
Configure repository for cephadm installation and use package install in both
containerized and non containerized deployment

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit 339212a7c602ba17538f091c4134ca73c1cd626b)

infrastructure-playbooks/cephadm-adopt.yml
tox.ini

index 269cf34253f1af39d99351ce297736fed725267c..f5cf3ec586f170a0ba5d029e402c768c5674a9ba 100644 (file)
           inventory_hostname in groups.get(iscsi_gw_group_name, []) or
           inventory_hostname in groups.get(nfs_group_name, [])
 
+    - name: configure repository for installing cephadm
+      when: containerized_deployment | bool
+      vars:
+        ceph_origin: repository
+        ceph_repository: community
+      block:
+        - name: validate repository variables
+          import_role:
+            name: ceph-validate
+            tasks_from: check_repository.yml
+
+        - name: configure repository
+          import_role:
+            name: ceph-common
+            tasks_from: "configure_repository.yml"
+
     - name: install cephadm requirements
       package:
         name: ['python3', 'lvm2']
         name: cephadm
       register: result
       until: result is succeeded
-      when: not containerized_deployment | bool
 
     - name: install cephadm mgr module
       package:
         - not containerized_deployment | bool
         - mgr_group_name in group_names
 
-    - name: get cephadm from the container image
-      when: containerized_deployment | bool
-      block:
-        - name: create a cephadm container
-          command: "{{ container_binary }} create --name cephadm {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
-          changed_when: false
-
-        - name: cp the cephadm cli file
-          command: "{{ container_binary }} cp cephadm:/usr/sbin/cephadm /usr/sbin/cephadm"
-          args:
-            creates: /usr/sbin/cephadm
-
-        - name: remove the cephadm container
-          command: "{{ container_binary }} rm cephadm"
-          changed_when: false
-
-    - name: set_fact container_exec_cmd
+    - name: set_fact ceph_cmd
       set_fact:
         container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }}"
       when: containerized_deployment | bool
diff --git a/tox.ini b/tox.ini
index 13d33af34fb80f5c3d8e326ad620985a53065066..ff93d4acb1671a34ad8a2c6b1e2d23f6c5cfa212 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -309,6 +309,11 @@ commands=
       ireallymeanit=yes \
       delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \
   "
+  # idempotency test
+  ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/cephadm-adopt.yml --extra-vars "\
+      ireallymeanit=yes \
+      delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \
+  "
 
 [testenv]
 whitelist_externals =