diff options
author | 2019-03-23 13:54:34 +0200 | |
---|---|---|
committer | 2019-04-01 20:41:43 +0300 | |
commit | 11ce29363400bfcc909c9b94eda01aeafc6c17dc (patch) | |
tree | dc0be6a94756946c249ce796b49bfb931b127dad /ansible/roles/nfs/templates | |
parent | dc924a0cb81e1eed9f5bf152bfba076a45fe91e1 (diff) |
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>
Diffstat (limited to 'ansible/roles/nfs/templates')
-rw-r--r-- | ansible/roles/nfs/templates/exports.j2 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ansible/roles/nfs/templates/exports.j2 b/ansible/roles/nfs/templates/exports.j2 index 1f6956c2..c605d9b8 100644 --- a/ansible/roles/nfs/templates/exports.j2 +++ b/ansible/roles/nfs/templates/exports.j2 @@ -1,3 +1,3 @@ -{% for host in groups.kubernetes[1:] -%} - {{ nfs_mount_path }} {{ hostvars[host].ansible_host }}(rw,sync,no_root_squash,no_subtree_check) +{% for host in groups.kubernetes -%} + {{ nfs_mount_path }} {{ hostvars[host].ansible_host | default(hostvars[host].inventory_hostname) }}(rw,sync,no_root_squash,no_subtree_check) {% endfor %} |