]> 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>
Fri, 8 Oct 2021 14:56:47 +0000 (16:56 +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>
infrastructure-playbooks/cephadm-adopt.yml
tests/functional/all_daemons/container/group_vars/all
tox.ini

index 95be474655320605367bf3881b2ae40c01ebc4fb..ac31a6b52d03baf0c268635dda94e8e7ca4c6fb7 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 ceph_cmd
       set_fact:
         ceph_cmd: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph:/var/lib/ceph:z -v /var/run/ceph:/var/run/ceph:z --entrypoint=ceph ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else 'ceph' }} --cluster {{ cluster }}"
index 09954352fc39b1421b0b4e7c63a4a22bc326dfcf..72406faa019838a431fb2d915f7a3745deecbd77 100644 (file)
@@ -42,4 +42,4 @@ ceph_docker_image_tag: latest-master
 node_exporter_container_image: "quay.ceph.io/prometheus/node-exporter:v0.17.0"
 prometheus_container_image: "quay.ceph.io/prometheus/prometheus:v2.7.2"
 alertmanager_container_image: "quay.ceph.io/prometheus/alertmanager:v0.16.2"
-grafana_container_image: "quay.ceph.io/app-sre/grafana:6.7.4"
\ No newline at end of file
+grafana_container_image: "quay.ceph.io/app-sre/grafana:6.7.4"
diff --git a/tox.ini b/tox.ini
index a0f34ca9254248f6f21102fc6a1f4be7ec70a6d9..364d87f92a93ef33f99bcea15f97369ca7abbae1 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -275,11 +275,13 @@ commands=
   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} \
+      ceph_repository=dev \
   "
   # 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} \
+      ceph_repository=dev \
   "
 
 [testenv]