You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.1 KiB
YAML

---
- name: Create user account for export
user:
state: present
name: "{{ squash_user }}"
system: yes
shell: "/bin/false"
create_home: no
when: squash_user != ""
register: user_info
- name: Create original export directory
file:
state: directory
path: "{{ real_path }}"
owner: "{{ squash_user | default('root') }}"
group: "{{ squash_user | default('root') }}"
mode: u=rwx,g=rx,o=rx
- name: Create directory for bind mount
file:
state: directory
path: "{{ export_path }}"
owner: "{{ squash_user | default('root') }}"
group: "{{ squash_user | default('root') }}"
mode: u=rwx,g=rx,o=rx
- name: Configure bind mount
template:
src: bind.mount
dest: "{{ global_systemd_configuration_directory }}/{{ mount_unit_name }}"
owner: root
group: root
mode: u=rw,g=r,o=r
notify:
- reload systemd
- mount export
- name: Configure export
template:
src: export.exports
dest: "{{ exports_config_directory }}/{{ export_config_name }}.exports"
owner: root
group: root
mode: u=rw,g=r,o=r
notify: reload nfs exports