summaryrefslogtreecommitdiff
path: root/playbooks/roles/ceph/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks/roles/ceph/tasks/main.yml')
-rw-r--r--playbooks/roles/ceph/tasks/main.yml44
1 files changed, 44 insertions, 0 deletions
diff --git a/playbooks/roles/ceph/tasks/main.yml b/playbooks/roles/ceph/tasks/main.yml
new file mode 100644
index 0000000..b554340
--- /dev/null
+++ b/playbooks/roles/ceph/tasks/main.yml
@@ -0,0 +1,44 @@
+---
+
+- name: Install Ceph Packages
+ ansible.builtin.apt:
+ name:
+ - ceph-common
+ - ceph-fuse
+ state: present
+
+- name: Copy Ceph Configuration
+ ansible.builtin.copy:
+ content: |
+ [global]
+ fsid = {{ ceph_fsid }}
+ mon_host = {{ ceph_mon_host }}
+ dest: /etc/ceph/ceph.conf
+ mode: '0644'
+
+- name: Copy Ceph Keyring
+ ansible.builtin.copy:
+ content: |
+ [client.{{ ceph_client_name }}]
+ key = {{ ceph_secret }}
+ dest: "/etc/ceph/ceph.client.{{ ceph_client_name }}.keyring"
+ mode: '0600'
+
+- name: Ensure Ceph Base Exists
+ ansible.builtin.file:
+ path: "{{ ceph_base }}"
+ owner: root
+ group: root
+ state: directory
+ recurse: true
+
+- name: Mount Ceph on Boot
+ ansible.builtin.lineinfile:
+ path: /etc/fstab
+ regexp: '{{ ceph_base }}\w+fuse.ceph'
+ line: "none {{ ceph_base }} fuse.ceph ceph.id={{ ceph_client_name }},_netdev,defaults 0 0"
+ create: true
+ mode: "0644"
+
+- name: Mount Ceph Now
+ ansible.builtin.command: mount -a