diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2021-12-11 11:56:27 +0000 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2021-12-11 11:56:27 +0000 |
commit | c1e3bbbe04863536e88d4d79afbbb85253e7d3b4 (patch) | |
tree | 9b9eecdef56cdf16dbef3e9b63e1e70312770a31 /roles/nfsd/tasks | |
parent | 13ef8e5744442b6a6d61a96888f87a1c96c44ba6 (diff) | |
download | rules-c1e3bbbe04863536e88d4d79afbbb85253e7d3b4.tar.gz |
roles/nfsd: Consistent configuration with other roles
Diffstat (limited to 'roles/nfsd/tasks')
-rw-r--r-- | roles/nfsd/tasks/main.yml | 26 | ||||
-rw-r--r-- | roles/nfsd/tasks/os_freebsd.yml (renamed from roles/nfsd/tasks/_freebsd.yml) | 9 |
2 files changed, 19 insertions, 16 deletions
diff --git a/roles/nfsd/tasks/main.yml b/roles/nfsd/tasks/main.yml index 7be5f2a..a8cabcf 100644 --- a/roles/nfsd/tasks/main.yml +++ b/roles/nfsd/tasks/main.yml @@ -1,6 +1,6 @@ - name: create nfsd data directory file: - path: "{{ nfsd_data_dir }}" + path: "{{ nfsd_dir }}" owner: 0 group: 0 mode: 0700 @@ -8,7 +8,7 @@ - name: create hosts directories file: - path: "{{ nfsd_data_dir }}/{{ item }}" + path: "{{ nfsd_dir }}/{{ item }}" owner: 0 group: 0 mode: 0777 @@ -19,17 +19,25 @@ template: src: exports.j2 dest: /etc/exports - owner: root + owner: 0 + group: 0 mode: 0640 register: result -- name: enable and start nfsd service - service: &nfsd_service - name: nfsd - state: "{{ 'restarted' if result.changed else 'started' }}" +- name: enable and restart portmap + service: &enable_and_restart + name: portmap + state: restarted enabled: true -- name: enable and restart mountd +- name: enable and reload/restart mountd service: - <<: *nfsd_service + <<: *enable_and_restart name: mountd + state: reloaded + +- name: enable and restart nfsd + service: + <<: *enable_and_restart + name: nfsd + state: restarted diff --git a/roles/nfsd/tasks/_freebsd.yml b/roles/nfsd/tasks/os_freebsd.yml index 2cae34a..2a8a8cd 100644 --- a/roles/nfsd/tasks/_freebsd.yml +++ b/roles/nfsd/tasks/os_freebsd.yml @@ -1,9 +1,4 @@ - -# nfsd ~~ roles/nfsd/tasks/_freebsd.yml - ---- - -- name: ensure daemons flag +- name: edit daemons flags lineinfile: path: /etc/rc.conf regexp: "^{{ item[0] }}=" @@ -13,7 +8,7 @@ - ["rpcbind_enable=", "YES"] - ["mountd_flags", "-r"] -- name: ensure rpcbind is enabled and restarted +- name: enable and restart rpcbind service: name: rpcbind state: restarted |