Merge "Use systemd_mount native syntax for mounts"

This commit is contained in:
Zuul 2022-04-25 22:47:45 +00:00 committed by Gerrit Code Review
commit 1d8cb0dbd9
7 changed files with 32 additions and 21 deletions

View File

@ -207,17 +207,16 @@ glance_policy_dirs: policy.d
# Define nfs information to enable nfs shares as mounted directories for
# glance. The ``glance_nfs_client`` value is a list of dictionaries that must
# be filled out completely to enable the persistent NFS mounts.
glance_nfs_local_directory: "images"
glance_nfs_client: []
# glance. The ``glance_remote_client`` value is a list of dictionaries that must
# be filled out completely to enable the persistent remote FS mounts (like NFS).
glance_images_local_directory: "{{ glance_nfs_local_directory | default('images') }}"
glance_remote_client: "{{ glance_nfs_client | default([]) }}"
# Example of the expected dict structure:
#
# 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
# glance_remote_client:
# - what: "127.0.0.1:/images" ## Hostname or IP address of Server and path on it
# where: "/var/lib/glance/images" ## Local path on machine
# type: "nfs" ## This can be nfs or nfs4
# options: "_netdev,auto" ## Mount options
# config_overrides: "{}" ## Override dictionary for unit file

View File

@ -0,0 +1,13 @@
---
features:
deprecations:
- |
Variable ``glance_nfs_local_directory`` has been renamed to
``glance_images_local_directory`` to better reflect purpose of
the variable. ``glance_nfs_local_directory`` remains for backwards
compatability but will be removed in Zed release.
- |
Variable ``glance_nfs_client`` has been replaced with
``glance_remote_client``. New variable has new keys for defining mounts
to cover wider range of supported filesystems.
Compatability for ``glance_nfs_client`` has been kept until Zed release.

View File

@ -101,7 +101,7 @@
- path: "{{ glance_system_user_home }}/cache/api"
mode: "0700"
- path: "{{ glance_system_user_home }}/scrubber"
- path: "{{ glance_system_user_home }}/{{ glance_nfs_local_directory }}"
- path: "{{ glance_system_user_home }}/{{ glance_images_local_directory }}"
mode: "0755"
- name: Install distro packages

View File

@ -171,8 +171,8 @@
vars:
systemd_mounts:
- config_overrides: "{{ mount_var.config_overrides | default({}) }}"
what: "{{ mount_var.server }}:{{ mount_var.remote_path }}"
where: "{{ mount_var.local_path }}"
what: "{{ mount_var.what | default(mount_var.server ~ ':' ~ mount_var.remote_path) }}"
where: "{{ mount_var.where | default(mount_var.local_path) }}"
type: "{{ mount_var.type }}"
options: "{{ mount_var.options }}"
unit:
@ -184,9 +184,9 @@
- rpcbind.service rpc-statd.service
Before:
- glance-api.service
state: 'started'
enabled: true
with_items: "{{ glance_nfs_client }}"
state: "{{ mount_var.state | default('started') }}"
enabled: "{{ mount_var.enabled | default(True) }}"
with_items: "{{ glance_remote_client }}"
loop_control:
loop_var: mount_var
tags:

View File

@ -79,7 +79,7 @@ default_backend = {{ glance_default_store }}
{% if 'file' in _glance_available_stores %}
[file]
filesystem_store_datadir = {{ glance_system_user_home }}/{{ glance_nfs_local_directory }}/
filesystem_store_datadir = {{ glance_system_user_home }}/{{ glance_images_local_directory }}/
{% endif %}
{% if 'swift' in _glance_available_stores %}

View File

@ -15,9 +15,8 @@
# Force glance to use file by default which will be an NFS mount point.
glance_default_store: file
glance_nfs_client:
- server: "10.1.0.1"
remote_path: "/srv/nfs/glance"
local_path: "/var/lib/glance/images"
glance_remote_client:
- what: "10.1.0.1:/srv/nfs/glance"
where: "/var/lib/glance/images"
type: "nfs"
options: "_netdev,auto"

View File

@ -60,8 +60,8 @@ uwsgi_glance_services: |-
# mount point task.
glance_mount_points: |-
{% set mps = [] %}
{% for mp in glance_nfs_client %}
{% set _ = mps.append(mp.local_path) %}
{% for mp in glance_remote_client %}
{% set _ = mps.append(mp.where | default(mount_var.local_path)) %}
{% endfor %}
{{ mps }}