본문으로 건너뛰기

[CEPH] ceph-ansible 을 이용한 ceph quincy 설치

설치간 발생한 이슈 정리

요약

  • ceph-ansible로 Ceph Quincy 설치 시 openstack.config_template 모듈을 찾지 못하는 오류는 ansible-galaxy install -r requirements.yml로 해결됩니다.
  • Python 가상환경에서 pip로 requirements.txt만 설치하면 playbook에 꼭 필요한 ansible-config_template이 빠져 이 오류가 발생합니다.

ceph-ansible 을 이용한 Ceph quincy 설치

오늘은 Ceph quincy 버전을 설치 테스트하면서 발생한 문제에 대해 메모하도록 하겠습니다.

설치

기본적인 설치는 이전에 작성한 octopus 버전 문서를 참고합니다.
https://tech.chhanz.xyz/ceph/2021/02/23/ceph-ansible/

이슈

아래와 같이 site-container.yml 을 이용해서 playbook 을 수행하려고 할 때 아래와 같이 에러가 발생합니다.

(deploy) root@deploy:~/ceph-ansible# ansible-playbook -i inventory site-container.yml -b
[DEPRECATION WARNING]: [defaults]callback_whitelist option, normalizing names to new standard, use callbacks_enabled instead. This feature will be
removed from ansible-core in version 2.15. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: "include" is deprecated, use include_tasks/import_tasks instead. This feature will be removed in version 2.16. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ERROR! couldn't resolve module/action 'openstack.config_template.config_template'. This often indicates a misspelling, missing collection, or incorrect mo
dule path.

The error appears to be in '/root/ceph-ansible/roles/ceph-config/tasks/main.yml': line 138, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: "generate .conf configuration file"
  ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

    with_items:
      - 

Should be written as:

    with_items:
      - ""
ERROR! couldn't resolve module/action 'openstack.config_template.config_template'. This often indicates a misspelling, missing collection, or incorrect mo
dule path.

주요 에러 포인트는 위와 같습니다.

위와 같이 에러가 발생하는 경우, requirements.yml 을 ansible-galaxy 명령어를 이용하여 설치를 수행해야합니다.

$ ansible-galaxy install -r requirements.yml

requirements.yml 내용은 아래와 같습니다.

---
# These are Ansible requirements needed to run ceph-ansible master
collections:
  - name: https://opendev.org/openstack/ansible-config_template
    version: 1.2.1
    type: git
  - name: ansible.utils
    version: '>=2.5.0'
  - name: community.general
  - name: ansible.posix

위 파일 내용을 확인한 것과 같이 ansible-playbook 에서 ansible-config_template 가 꼭 필요한 모듈이며, Python Virtual Environment 을 사용하면서 pip 을 이용한 requirements.txt 만으로는 부족한 부분입니다.
그리하여 위와 같은 이슈가 발생되며 requirements.yml 을 설치하면 문제가 해소됩니다.

참고 문서

자주 묻는 질문

ceph-ansible 실행 시 couldn't resolve module/action 'openstack.config_template.config_template' 오류가 나면 어떻게 하나요?

ansible-galaxy install -r requirements.yml로 ceph-ansible의 requirements.yml에 정의된 Ansible collection을 설치하면 해결됩니다.

requirements.txt를 설치했는데도 왜 이 오류가 발생하나요?

pip로 설치하는 requirements.txt만으로는 playbook에 꼭 필요한 ansible-config_template이 설치되지 않기 때문입니다. 이 모듈은 requirements.yml에 collection으로 정의되어 있습니다.

ceph-ansible의 requirements.yml에는 어떤 collection이 포함되어 있나요?

opendev.org의 ansible-config_template(1.2.1), ansible.utils(>=2.5.0), community.general, ansible.posix가 포함되어 있습니다.