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 <seenafallah@gmail.com>
(cherry picked from commit 339212a7c6)
pull/6955/head
Seena Fallah 2021-08-05 20:18:38 +04:30 committed by Guillaume Abrioux
parent 075b1a94d5
commit 5e5f45d633
2 changed files with 22 additions and 18 deletions

View File

@ -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

View File

@ -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 =