From: Seena Fallah Date: Thu, 5 Aug 2021 15:48:38 +0000 (+0430) Subject: cephadm-adopt: configure repository for cephadm installation X-Git-Tag: v5.0.11~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5e5f45d63322cac7abf4c27d3014badc38816075;p=ceph-ansible.git cephadm-adopt: configure repository for cephadm installation Configure repository for cephadm installation and use package install in both containerized and non containerized deployment Signed-off-by: Seena Fallah (cherry picked from commit 339212a7c602ba17538f091c4134ca73c1cd626b) --- diff --git a/infrastructure-playbooks/cephadm-adopt.yml b/infrastructure-playbooks/cephadm-adopt.yml index 269cf3425..f5cf3ec58 100644 --- a/infrastructure-playbooks/cephadm-adopt.yml +++ b/infrastructure-playbooks/cephadm-adopt.yml @@ -130,6 +130,22 @@ 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'] @@ -141,7 +157,6 @@ name: cephadm register: result until: result is succeeded - when: not containerized_deployment | bool - name: install cephadm mgr module package: @@ -152,23 +167,7 @@ - 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 13d33af34..ff93d4acb 100644 --- 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 =