Fix nfs role issues based on molecule testing
Based on Molecule testing fix following issues on
nfs role.
- enable nfs services (previously only started)
- create handler for exportfs to deal idempotency
- add all kubernetes nodes to exports as it was dependent on ansible inventory order wheather correct hosts was on the list
- add inventory_hostname as default host incase ansible_host variable not defined.
Issue-ID: OOM-1756
Change-Id: Ib93e9d2a9cf49003d04dd5f890294eda1eb966ff
Signed-off-by: Samuli Silvius <s.silvius@partner.samsung.com>
diff --git a/ansible/roles/nfs/handlers/main.yml b/ansible/roles/nfs/handlers/main.yml
new file mode 100644
index 0000000..4b8deae
--- /dev/null
+++ b/ansible/roles/nfs/handlers/main.yml
@@ -0,0 +1,3 @@
+---
+- name: reload nfs
+ command: exportfs -ra