# playbook to mount cephfs filesystem  

**URL:** <https://forum.ansible.com/t/playbook-to-mount-cephfs-filesystem/45554>\
**Category:** Get Help\
**Tags:** playbook\
**Created:** [March 18, 2026, 2:03pm UTC](https://forum.ansible.com/t/playbook-to-mount-cephfs-filesystem/45554 "2026-03-18T14:03:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lezard\_kein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/lezard_kein/32/10484_2.png) [@lezard\_kein](https://forum.ansible.com/u/lezard_kein)\
**Post date:** [March 18, 2026, 2:03pm UTC](https://forum.ansible.com/t/playbook-to-mount-cephfs-filesystem/45554/1 "2026-03-18T14:03:30Z")

</div>

Hi,

I have a strange behaviour .. probably I make some mistake.  
I try to had share directories to my fstab directly with ansible through a playbook …  
I have a working configuration on my cluster nodes

- /etc/ceph/ceph.client.server\_cluster.keyring
- /etc/ceph/ceph.client.server\_sics.keyring
- my fstab on working nodes
- 

```
server_cluster@.fs_home=/home /home ceph _netdev,noatime,recover_session=clean 0 0

```

server\_sics@.fs\_i2bc=/pool\_i2bc/default/EQUIPES /stockage/EQUIPES ceph \_netdev,noatime,recover\_session=clean 0 0  
server\_sics@.fs\_i2bc=/pool\_i2bc/default/USERS /stockage/USERS ceph \_netdev,noatime,recover\_session=clean 0 0  
server\_sics@.fs\_i2bc=/pool\_i2bc/default/plateformes /stockage/plateformes ceph \_netdev,noatime,recover\_session=clean 0 0

Directly included in fstab this configuration is functionnal.  
Then I try to make it “ansibled” … 🙂

* * *

```
- name: Install ceph
  ansible.builtin.apt:
    name: ceph-common
    state: latest
  become: true
- name: Download ceph config
  ansible.builtin.copy:
    src: '{{playbook_dir}}/roles/fstab/files/ceph/ceph.conf'
    dest: /etc/ceph/ceph.conf
    owner: root
    group: root
    mode: '0644'
  become: true
- name: Download ceph user key
  ansible.builtin.copy:
    src: '{{playbook_dir}}/roles/fstab/files/ceph/ceph.client.server_sics.keyring'
    dest: /etc/ceph/ceph.client.server_sics.keyring
    owner: root
    group: root
    mode: '0644'
  become: true
- name: Download ceph user key
  ansible.builtin.copy:
    src: '{{playbook_dir}}/roles/fstab/files/ceph/ceph.client.server_cluster.keyring'
    dest: /etc/ceph/ceph.client.server_cluster.keyring
    owner: root
    group: root
    mode: '0644'
  become: true

- name: update fstab
  ansible.posix.mount:
    fstype: ceph
    path: /home
    state: mounted
    src: "server_cluster@.fs_home=/home"
    opts: "_netdev,noatime,recover_session=clean"
  become: true

```

- name: Create mount directory for EQUIPES  
ansible.builtin.file:  
path: /stockage/EQUIPES  
state: directory  
owner: root  
group: root  
mode: ‘0755’  
- name: Create mount directory for USERS  
ansible.builtin.file:  
path: /stockage/USERS  
state: directory  
owner: root  
group: root  
mode: ‘0755’

```
- name: Create mount directory for plateformes
  ansible.builtin.file:
path: /stockage/plateformes
    state: directory
    owner: root
    group: root
mode: '0755'

```

- name: update fstab  
ansible.posix.mount:  
fstype: ceph  
path: /stockage/EQUIPES  
state: mounted  
src: “server\_sics:=/pool\_i2bc/default/EQUIPES/”  
opts: “\_netdev,noatime,recover\_session=clean”  
become: true

```
- name: update fstab
  ansible.posix.mount:
    fstype: ceph
path: /stockage/USERS
state: mounted
    src: "server_sics@.fs_i2bc=/pool_i2bc/default/USERS"
    opts: "_netdev,noatime,recover_session=clean"
  become: true

```

But in this case nothing works until I make an ln -s on server\_cluster keyring  
ceph.client.admin.keyring → /etc/ceph/ceph.client.server\_cluster.keyring and so only home directory is correctly mounted …

And on all my cluster nodes I never wrote such link … and the cephfs mount works perfectly …

I don’t understand the problem ☹

Best Regards  
( sorry for my poor english 🙂 )

---

<div class="post-metadata">

**Author:** ![lezard\_kein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/lezard_kein/32/10484_2.png) [@lezard\_kein](https://forum.ansible.com/u/lezard_kein)\
**Post date:** [March 19, 2026, 9:15am UTC](https://forum.ansible.com/t/playbook-to-mount-cephfs-filesystem/45554/2 "2026-03-19T09:15:11Z")

</div>

Hi every body … stop 🙂  
I found my mistake. On one of my declaration … I miss `server_sics@.fs_i2bc` … now all works perfectly … sorry 🙂 for this false problem 🙂 Thank you
