Skip to content

Commit

Permalink
Start porting OpenStack to Ceph
Browse files Browse the repository at this point in the history
  • Loading branch information
milliams committed Oct 31, 2023
1 parent 05cb5c6 commit 71a4051
Showing 1 changed file with 14 additions and 40 deletions.
54 changes: 14 additions & 40 deletions roles/filesystem/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,4 @@
---
- name: Start nfs server
ansible.builtin.service:
name: nfs-server
state: started
enabled: true
when: slurm_role == "mgmt" and ansible_local.citc.csp == "openstack"

- name: Create shared FS
ansible.builtin.file:
path: /shared
state: directory
mode: o=rwx,g=rx,o=rx
when: slurm_role == "mgmt" and ansible_local.citc.csp == "openstack"

# TODO mount a Cinder volume
- name: Config nfs server
ansible.builtin.lineinfile:
path: /etc/exports
line: "/shared *(rw,sync,insecure,no_root_squash)"
regexp: "^/shared"
notify:
- Reload nfs-server
- Re-export shares
when: slurm_role == "mgmt" and ansible_local.citc.csp == "openstack"

- name: Open NFS port in firewall
ansible.posix.firewalld:
port: 2049/tcp
permanent: true
state: enabled
notify: Restart firewalld

- name: Flush handlers
ansible.builtin.meta: flush_handlers
when: slurm_role == "mgmt" and ansible_local.citc.csp == "openstack"

- name: Install nfs-utils
ansible.builtin.yum:
name: nfs-utils
Expand All @@ -53,6 +17,7 @@
host: "{{ ansible_local.citc.fileserver_ip }}"
port: 2049
state: started
when: ansible_local.citc.csp != "openstack"

- name: Mount shared file system now that fileserver is ready
ansible.posix.mount:
Expand All @@ -62,14 +27,23 @@
opts: defaults,nofail,nosuid
state: mounted
when:
ansible_local.citc.csp != "aws"
- ansible_local.citc.csp != "aws"
- ansible_local.citc.csp != "openstack"

- name: Mount shared file system
- name: Mount shared file system [aws]
ansible.posix.mount:
path: /mnt/shared
src: "{{ filesystem_target_address }}:/"
fstype: nfs
opts: defaults,nofail,nosuid
state: mounted
when:
ansible_local.citc.csp == "aws"
when: ansible_local.citc.csp == "aws"

- name: Mount shared file system [openstack]
ansible.posix.mount:
path: /mnt/shared

Check failure on line 44 in roles/filesystem/tasks/main.yml

View workflow job for this annotation

GitHub Actions / ansible_lint

jinja[invalid]

template error while templating string: Expected an expression, got 'end of print statement'. String: secret={{ }},name={{ }}. Expected an expression, got 'end of print statement'
src: "{{ filesystem_target_address }}:/"
fstype: ceph
opts: secret={{ }},name={{ }}
state: mounted
when: ansible_local.citc.csp == "openstack"

0 comments on commit 71a4051

Please sign in to comment.