Merge "Correct role rerun when using glance with NFS"

This commit is contained in:
Zuul 2018-06-28 22:39:10 +00:00 committed by Gerrit Code Review
commit 0642f458a9
3 changed files with 16 additions and 7 deletions

View File

@ -57,6 +57,8 @@
owner: "{{ item.owner|default(glance_system_user_name) }}"
group: "{{ item.group|default(glance_system_group_name) }}"
mode: "{{ item.mode|default(omit) }}"
when:
- item.path not in glance_mount_points
with_items:
- { path: "/openstack", mode: "0755", owner: "root", group: "root" }
- { path: "/etc/glance", mode: "0750" }
@ -73,6 +75,8 @@
owner: "{{ glance_system_user_name }}"
group: "{{ glance_system_group_name }}"
mode: "0755"
when:
- glance_system_user_home + '/images' not in glance_mount_points
- name: Test for log directory or link
shell: |
@ -93,7 +97,8 @@
owner: "{{ glance_system_user_name }}"
group: "{{ glance_system_group_name }}"
mode: "0755"
when: log_dir.rc != 0
when:
- log_dir.rc != 0
- name: Install distro packages
package:

View File

@ -78,12 +78,6 @@
- Manage LB
- Restart glance services
- name: Create nfs shares local path
file:
path: "{{ item.local_path }}"
state: directory
with_items: "{{ glance_nfs_client }}"
- name: Glance nfs mount(s)
config_template:
src: "glance-systemd-mount.j2"

View File

@ -29,3 +29,13 @@ filtered_glance_services: |-
{% endif %}
{% endfor %}
{{ services | sort(attribute='start_order') }}
# Define all glance mountpoints when using NFS. If defined
# the corresponding directory will only be created by the
# mount point task.
glance_mount_points: |-
{% set mps = [] %}
{% for mp in glance_nfs_client %}
{% set _ = mps.append(mp.local_path) %}
{% endfor %}
{{ mps }}