Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ Ceph variables:
* `os_manila_mount_ceph_release_repo`: Optional. URL for Ceph release repo.
* `os_manila_mount_ceph_conf_path`: Optional. Path for Ceph configuration directory,
default `/etc/ceph`.
* `os_manila_mount_fuse`: Use a FUSE driver for the filesystem, if appropriate.
Default is `False`.


Example Playbook
Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ os_manila_mount_ceph_rpm_repos:
baseurl: "http://download.ceph.com/rpm-{{ os_manila_mount_ceph_version }}/el{{ ansible_distribution_major_version }}/SRPMS"
enabled: true
gpgcheck: true

# Default to kernel FS driver over FUSE-mounting
os_manila_mount_fuse: false
11 changes: 11 additions & 0 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
- name: Install Ceph packages (dnf)
dnf:
name: "ceph-common-{{ os_manila_mount_ceph_version }}"

- name: Install ceph-fuse (dnf)
dnf:
name: "ceph-fuse"
when: os_manila_mount_fuse | bool

when: ansible_distribution == 'Rocky'

- block:
Expand All @@ -47,4 +53,9 @@
name: "ceph-common"
update_cache: true

- name: Install ceph-fuse (apt)
ansible.builtin.apt:
name: "ceph-fuse"
when: os_manila_mount_fuse | bool

when: ansible_distribution == 'Ubuntu'
17 changes: 17 additions & 0 deletions tasks/mount.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@
loop: "{{ os_manila_mount_shares | zip(os_manila_mount_share_info) }}"
loop_control:
label: "{{ item[0].share_name }}"
when: not os_manila_mount_fuse | bool

- name: FUSE-mount the Ceph share
ansible.posix.mount:
path: "{{ item[0].mount_path }}"
src: "none"
fstype: fuse.ceph
opts: "ceph.id={{ item[1].share_user }},\
ceph.conf={{ os_manila_mount_ceph_conf_path }}/ceph.conf,\
ceph.keyring={{ os_manila_mount_ceph_conf_path }}/ceph.client.{{ item[1].share_user }}.keyring,\
ceph.client-mountpoint={{ item[1].export }}"
# NB share_user is looked up here in case of autodetection
state: "{{ item[0].mount_state | default(os_manila_mount_state) }}"
loop: "{{ os_manila_mount_shares | zip(os_manila_mount_share_info) }}"
loop_control:
label: "{{ item[0].share_name }}"
when: os_manila_mount_fuse | bool

- name: Ensure mounted directory has correct permissions
ansible.builtin.file:
Expand Down