summaryrefslogtreecommitdiffstats
path: root/roles/openshift_nfs/tasks/setup.yml
blob: bd8fb44a282ec9d0b8b7e958e14af53ec7a7898f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
- name: setup firewall
  import_tasks: firewall.yml

- name: Install nfs-utils
  package: name=nfs-utils state=present
  register: result
  until: result is succeeded

- name: Configure NFS
  lineinfile:
    dest: /etc/sysconfig/nfs
    regexp: '^RPCNFSDARGS=.*$'
    line: 'RPCNFSDARGS="-N 2 -N 3"'
  register: nfs_config

- name: Restart nfs-config
  systemd: name=nfs-config state=restarted
  when: nfs_config is changed

- name: Ensure exports directory exists
  file:
    path: "{{ l_nfs_base_dir }}"
    state: directory

- name: Enable and start NFS services
  systemd:
    name: nfs-server
    state: started
    enabled: yes