TCIB: Add cinder-backup extend_start.sh script

Add a kolla_extend_start script to the cinder-backup service that
ensures /var/lib/cinder is owned by the 'cinder' user. See
I2d82c1ca86735d2a8d69b3e28e8cea7acd637f0b for details on what was
done for the cinder-volume service. cinder-backup also needs to run
the script because there's no guarantee the cinder-volume service
is running on every cinder-backup node.

Resolves: rhbz#2167954
Related-Bug: #1908750
Change-Id: I7fcca9fbfea87ac4b245856a3aecae9ffd211938
This commit is contained in:
Alan Bishop 2023-02-07 13:05:47 -08:00
parent f15417d662
commit b6cf34a953
3 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1 @@
%kolla ALL=(root) NOPASSWD: /bin/chown -R cinder\:kolla /var/lib/cinder

View File

@ -0,0 +1,5 @@
#!/bin/bash
if [[ $(stat -c %U:%G /var/lib/cinder) != "cinder:kolla" ]]; then
sudo chown -R cinder:kolla /var/lib/cinder
fi

View File

@ -4,7 +4,9 @@ tcib_envs:
MALLOC_TRIM_THRESHOLD_: 262144 MALLOC_TRIM_THRESHOLD_: 262144
tcib_actions: tcib_actions:
- run: dnf -y install {{ tcib_packages.common | join(' ') }} && dnf clean all && rm -rf /var/cache/dnf - run: dnf -y install {{ tcib_packages.common | join(' ') }} && dnf clean all && rm -rf /var/cache/dnf
- run: mkdir -p /etc/libqb - run: cp /usr/share/openstack-tripleo-common-containers/container-images/kolla/cinder-backup/extend_start.sh /usr/local/bin/kolla_extend_start
- run: cp /usr/share/openstack-tripleo-common-containers/container-images/kolla/cinder-backup/cinder-backup-sudoers /etc/sudoers.d/cinder-backup-sudoers
- run: chmod 755 /usr/local/bin/kolla_extend_start && chmod 440 /etc/sudoers.d/cinder-backup-sudoers && mkdir -p /etc/libqb
- run: ln -s /usr/share/openstack-tripleo-common/healthcheck/cinder-backup /openstack/healthcheck && chmod a+rx /openstack/healthcheck - run: ln -s /usr/share/openstack-tripleo-common/healthcheck/cinder-backup /openstack/healthcheck && chmod a+rx /openstack/healthcheck
tcib_packages: tcib_packages:
common: common: