diff --git a/handlers/main.yml b/handlers/main.yml index 8fed451..83b7bce 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,3 +1,4 @@ --- - name: restart nfs service: "name={{ nfs_server_daemon }} state=restarted" + when: nfs_exports|length diff --git a/tasks/main.yml b/tasks/main.yml index 9cb7bab..e0284f2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -19,8 +19,9 @@ when: ansible_os_family == 'Debian' - name: Ensure directories to export exist - file: path="{{ item.strip().split()[0] }}" state=directory + file: 'path="{{ item.strip().split()[0] }}" state=directory' with_items: nfs_exports + notify: restart nfs - name: Copy exports file. template: