Fix glance_nfs_client setting
glance_nfs_client adds 2 fstab entries, with then handler entry being incorrectly ordered (src and name are the wrong way around). This patch removes the redundant handler and moves the existing fstab task to use the "mount" module which will add the entry to fstab and ensure the filesystems are mounted. Additionally this fixes a documentation bug where an incorrect variable is referenced (glance_nfs_mounts). Change-Id: I6e0f964d4279800d31119f380a239e2c4ae61cb5 Fixes-Bug: #1477081
This commit is contained in:
parent
4f405f4704
commit
c19915251f
@ -117,9 +117,9 @@ glance_policy_dirs: policy.d
|
||||
|
||||
## Define nfs information for glance. When the glance_nfs_client dictionary is
|
||||
## defined it will enable nfs shares as mounted directories. The
|
||||
## ``glance_nfs_mounts`` value is a list of dictionaries that must be filled
|
||||
## ``glance_nfs_client`` value is a list of dictionaries that must be filled
|
||||
## out completely to enable the persistent NFS mounts.
|
||||
# glance_nfs_mounts:
|
||||
# glance_nfs_client:
|
||||
# - server: "127.0.0.1" ## Hostname or IP address of NFS Server
|
||||
# remote_path: "/images" ## Remote path from the NFS server's export
|
||||
# local_path: "/var/lib/glance/images" ## Local path on machine
|
||||
|
@ -31,12 +31,3 @@
|
||||
state: "restarted"
|
||||
pattern: "{{ item }}"
|
||||
with_items: glance_service_names
|
||||
|
||||
- name: Glance mount nfs
|
||||
mount:
|
||||
name: "{{ item.server }}:{{ item.remote_path }}"
|
||||
src: "{{ item.local_path }}"
|
||||
fstype: "{{ item.type }}"
|
||||
opts: "{{ item.options }}"
|
||||
state: "present"
|
||||
with_items: glance_nfs_client
|
||||
|
@ -94,15 +94,16 @@
|
||||
- glance-nfs
|
||||
- glance-nfs-local-path
|
||||
|
||||
- name: Create nfs mounts
|
||||
lineinfile:
|
||||
dest: "/etc/fstab"
|
||||
line: "{{ item.server }}:{{ item.remote_path }} {{ item.local_path }} {{ item.type }} {{ item.options }} 0 0"
|
||||
backup: "true"
|
||||
- name: Glance mount nfs
|
||||
mount:
|
||||
name: "{{ item.local_path }}"
|
||||
src: "{{ item.server }}:{{ item.remote_path }}"
|
||||
fstype: "{{ item.type }}"
|
||||
opts: "{{ item.options }}"
|
||||
state: "mounted"
|
||||
with_items: glance_nfs_client
|
||||
when: >
|
||||
glance_nfs_client is defined
|
||||
notify: Glance mount nfs
|
||||
tags:
|
||||
- glance-nfs
|
||||
- glance-nfs-fstab
|
||||
- glance-nfs-local-path
|
||||
|
Loading…
Reference in New Issue
Block a user