diff --git a/defaults/main.yml b/defaults/main.yml index cc60b684..225fe0e7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/handlers/main.yml b/handlers/main.yml index 94c28780..51a586ef 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -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 diff --git a/tasks/glance_post_install.yml b/tasks/glance_post_install.yml index afc350d8..6b48ceea 100644 --- a/tasks/glance_post_install.yml +++ b/tasks/glance_post_install.yml @@ -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