Skip to content

Commit

Permalink
sit.cephfs: Make ceph repo creation a common task
Browse files Browse the repository at this point in the history
Performing the task of ceph repo creation from common.prep role makes it
possible to include it as part of preparing client machines.

Signed-off-by: Anoop C S <[email protected]>
  • Loading branch information
anoopcs9 committed May 28, 2024
1 parent 407ab1f commit 97b96b1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 27 deletions.
21 changes: 21 additions & 0 deletions playbooks/ansible/roles/sit.cephfs/tasks/common/centos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: Identify latest ceph:{{ config.data.branch }} build
uri:
url: "https://shaman.ceph.com/api/search?\
project=ceph&\
ref={{ config.data.branch }}&\
flavor=default&\
status=ready&\
distros=centos/{{ config.os[site.os].version }}/x86_64&\
sha1=latest"
return_content: true
register: ceph_shaman

- name: Create ceph repo
yum_repository:
name: "ceph-{{ config.data.branch }}-{{ ceph_shaman.json[0].sha1 }}"
baseurl: "{{ ceph_shaman.json[0].url }}/x86_64"
description: "Ceph {{ config.data.branch }} ({{ ceph_shaman.json[0].sha1 }})"
enabled: true
gpgcheck: false
state: present
8 changes: 8 additions & 0 deletions playbooks/ansible/roles/sit.cephfs/tasks/common/main.yml
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
---
- name: Process OS specific tasks
include_tasks: "{{ include_file }}"
vars:
prefix: "{{ role_path }}/tasks/common/"
with_first_found:
- files: "{{ [prefix] | product(config.os[site.os].includes) | map('join') | list }}"
loop_control:
loop_var: include_file
30 changes: 3 additions & 27 deletions playbooks/ansible/roles/sit.cephfs/tasks/server/centos.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
---
# Note: the repo and the ceph-common package are only required to be able to
# mount the ceph volume from the host. Cephadm will download all other
# required container images independently of the repository.

- name: Identify latest ceph:{{ config.data.branch }} build
uri:
url: "https://shaman.ceph.com/api/search?\
project=ceph&\
ref={{ config.data.branch }}&\
flavor=default&\
status=ready&\
distros=centos/{{ config.os[site.os].version }}/x86_64&\
sha1=latest"
return_content: true
register: ceph_shaman

- name: Create ceph repo
yum_repository:
name: "ceph-{{ config.data.branch }}-{{ ceph_shaman.json[0].sha1 }}"
baseurl: "{{ ceph_shaman.json[0].url }}/x86_64"
description: "Ceph {{ config.data.branch }} ({{ ceph_shaman.json[0].sha1 }})"
enabled: true
gpgcheck: false
state: present

# Note: this rule can not be merged with the above rule. This depends on
# packages enabled by repo files the previous rule installs.
# Note: ceph-common package is only required to be able to mount the ceph volume
# from the host. Cephadm will download all other required container images
# independently of the repository.
- name: Install required packages
yum:
name:
Expand Down

0 comments on commit 97b96b1

Please sign in to comment.