Adds support for specifying GID AND UID for cinder system user

Change-Id: I141509b9e2fdb132357542c6b5204ffaa6f33d56
This commit is contained in:
Marcus Murwall 2017-09-14 09:13:02 +00:00
parent 384e1ba690
commit e350f899ae
4 changed files with 43 additions and 0 deletions

View File

@ -79,6 +79,18 @@ cinder_system_comment: cinder system user
cinder_system_shell: /bin/false
cinder_system_home_folder: "/var/lib/{{ cinder_system_user_name }}"
## Manually specified cinder UID/GID
# Deployers can specify a UID for the cinder user as well as the GID for the
# cinder group if needed. This is commonly used in environments where shared
# storage is used, such as NFS or GlusterFS, and cinder UID/GID values must be
# in sync between multiple servers.
#
# WARNING: Changing these values on an existing deployment can lead to
# failures, errors, and instability.
#
# cinder_system_user_uid = <UID>
# cinder_system_group_gid = <GID>
cinder_lock_path: /var/lock/cinder
## Cinder Auth

View File

@ -627,3 +627,27 @@ the desired qos spec dictionary.
options:
consumer: front-end
write_iops_sec: 100
Shared storage and synchronized UID/GID
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specify a custom UID for the cinder user and GID for the cinder group
to ensure they are identical on each host. This is helpful when using shared
storage on Compute nodes because it allows instances to migrate without
filesystem ownership failures.
By default, Ansible creates the cidner user and group without specifying the
UID or GID. To specify custom values for the UID or GID, set the following
Ansible variables:
.. code-block:: yaml
cinder_system_user_uid = <specify a UID>
cinder_system_group_gid = <specify a GID>
.. warning::
Setting this value after deploying an environment with
OpenStack-Ansible can cause failures, errors, and general instability. These
values should only be set once before deploying an OpenStack environment
and then never changed.

View File

@ -0,0 +1,5 @@
---
other:
- Added support for specifying GID and UID for cinder system user by defining
``cinder_system_user_uid`` and ``cinder_system_group_gid``. This setting is
optional.

View File

@ -16,12 +16,14 @@
- name: create the system group
group:
name: "{{ cinder_system_group_name }}"
gid: "{{ cinder_system_group_gid|default(omit) }}"
state: "present"
system: "yes"
- name: Create the cinder system user
user:
name: "{{ cinder_system_user_name }}"
uid: "{{ cinder_system_user_uid|default(omit) }}"
group: "{{ cinder_system_group_name }}"
comment: "{{ cinder_system_comment }}"
shell: "{{ cinder_system_shell }}"