Updates cinder element
The previous cinder element was lacking a notty file and didn't open the required ports in iptables. This patch also allows a developer to install the minimum required components for a single cinder instance or (n) cinder-volume nodes. This update results in 3 elements cinder : common cinder element cinder-api : installs the cinder api and scheduler cinder-volume : installs the cinder volume service Change-Id: I1ed9f67848be5716135085b6eaebc1f381ad83f9
This commit is contained in:
parent
8eee067cf3
commit
3f34fc4d28
1
elements/cinder-api/README.md
Normal file
1
elements/cinder-api/README.md
Normal file
@ -0,0 +1 @@
|
||||
Installs cinder api and scheduler services.
|
4
elements/cinder-api/element-deps
Normal file
4
elements/cinder-api/element-deps
Normal file
@ -0,0 +1,4 @@
|
||||
os-svc-install
|
||||
os-refresh-config
|
||||
source-repositories
|
||||
use-ephemeral
|
5
elements/cinder-api/install.d/73-cinder-api
Executable file
5
elements/cinder-api/install.d/73-cinder-api
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
os-svc-daemon cinder-api cinder cinder-api "--config-dir /etc/cinder"
|
||||
os-svc-daemon cinder-scheduler cinder cinder-scheduler "--config-dir /etc/cinder"
|
@ -4,9 +4,6 @@ set -eu
|
||||
/opt/stack/venvs/cinder/bin/cinder-manage db sync
|
||||
|
||||
os-svc-enable -n cinder-api
|
||||
os-svc-enable -n cinder-volume
|
||||
os-svc-enable -n cinder-scheduler
|
||||
|
||||
service cinder-api restart
|
||||
service cinder-volume restart
|
||||
service cinder-scheduler restart
|
||||
service cinder-scheduler restart
|
1
elements/cinder-volume/README.md
Normal file
1
elements/cinder-volume/README.md
Normal file
@ -0,0 +1 @@
|
||||
Installs cinder volume service.
|
4
elements/cinder-volume/element-deps
Normal file
4
elements/cinder-volume/element-deps
Normal file
@ -0,0 +1,4 @@
|
||||
os-svc-install
|
||||
os-refresh-config
|
||||
source-repositories
|
||||
use-ephemeral
|
4
elements/cinder-volume/install.d/74-cinder-volume
Executable file
4
elements/cinder-volume/install.d/74-cinder-volume
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
os-svc-daemon cinder-volume cinder cinder-volume "--config-dir /etc/cinder"
|
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
os-svc-enable -n cinder-volume
|
||||
service cinder-volume restart
|
@ -7,4 +7,4 @@ cinder:
|
||||
verbose: False
|
||||
- Print more verbose output (set logging level to INFO instead of default WARNING level).
|
||||
debug: False
|
||||
- Print debugging output (set logging level to DEBUG instead of default WARNING level).
|
||||
- Print debugging output (set logging level to DEBUG instead of default WARNING level).
|
@ -5,9 +5,6 @@ install-packages lvm2 libssl-dev tgt
|
||||
echo "qpid-python" | tee -a /opt/stack/cinder/requirements.txt
|
||||
os-svc-install -n cinder -u cinder -r /opt/stack/cinder -c cinder-all
|
||||
|
||||
os-svc-daemon cinder-api cinder cinder-api "--config-dir /etc/cinder"
|
||||
os-svc-daemon cinder-volume cinder cinder-volume "--config-dir /etc/cinder"
|
||||
os-svc-daemon cinder-scheduler cinder cinder-scheduler "--config-dir /etc/cinder"
|
||||
mkdir -p /etc/tgt/conf.d
|
||||
install -d -o root -g cinder -m 0770 /var/lib/cinder/volumes
|
||||
register-state-path /var/lib/cinder
|
||||
@ -15,12 +12,11 @@ echo 'include /etc/tgt/conf.d/cinder_tgt.conf' > /etc/tgt/targets.conf
|
||||
echo 'include /mnt/state/var/lib/cinder/volumes/*' > /etc/tgt/conf.d/cinder_tgt.conf
|
||||
|
||||
cp -a /opt/stack/cinder/etc/cinder/rootwrap* /etc/cinder
|
||||
|
||||
ln -sf /opt/stack/venvs/cinder/bin/cinder-rootwrap /usr/local/bin/cinder-rootwrap
|
||||
|
||||
cp /opt/stack/cinder/etc/cinder/api-paste.ini /etc/cinder/api-paste.ini
|
||||
cp /opt/stack/cinder/etc/cinder/policy.json /etc/cinder/policy.json
|
||||
|
||||
ln -sf /opt/stack/venvs/cinder/bin/cinder-rootwrap /usr/local/bin/cinder-rootwrap
|
||||
|
||||
echo "cinder ALL=(root) NOPASSWD: /usr/local/bin/cinder-rootwrap" > /etc/sudoers.d/cinder
|
||||
chmod 0440 /etc/sudoers.d/cinder
|
||||
visudo -c
|
||||
|
@ -1,5 +1,6 @@
|
||||
[DEFAULT]
|
||||
|
||||
# allow metadata to override verbose and debug configuration
|
||||
{{#cinder.verbose}}
|
||||
# Print more verbose output (set logging level to INFO instead
|
||||
# of default WARNING level). (boolean value)
|
||||
@ -12,13 +13,8 @@ debug={{cinder.debug}}
|
||||
{{/cinder.debug}}
|
||||
|
||||
state_path = /mnt/state/var/lib/cinder
|
||||
|
||||
rootwrap_config=/etc/cinder/rootwrap.conf
|
||||
api_paste_config = /etc/cinder/api-paste.ini
|
||||
|
||||
iscsi_helper=tgtadm
|
||||
volume_name_template = volume-%s
|
||||
volume_group = cinder-volumes
|
||||
auth_strategy = keystone
|
||||
|
||||
sql_connection={{cinder.db}}
|
||||
@ -48,8 +44,6 @@ service_protocol = http
|
||||
service_host = {{keystone.host}}
|
||||
service_port = 5000
|
||||
auth_host = {{keystone.host}}
|
||||
auth_port = 35357
|
||||
auth_protocol = http
|
||||
admin_tenant_name = service
|
||||
admin_user = cinder
|
||||
admin_password = {{cinder.service-password}}
|
29
elements/cinder/os-refresh-config/pre-configure.d/97-cinder-fedora-iptables
Executable file
29
elements/cinder/os-refresh-config/pre-configure.d/97-cinder-fedora-iptables
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
OK=/var/run/cinder/fedora-iptables.ok
|
||||
|
||||
if [ -e $OK ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
DISTRO=`lsb_release -si` || true
|
||||
|
||||
if [[ "Fedora" = $DISTRO ]]; then
|
||||
|
||||
# Check if the iptables service is active
|
||||
if systemctl is-active iptables.service ; then
|
||||
IPT_FILE=/etc/sysconfig/iptables
|
||||
if [ -f $IPT_FILE ]; then
|
||||
iptables-restore < $IPT_FILE
|
||||
fi
|
||||
|
||||
# Openstack services
|
||||
iptables -I INPUT -p tcp -m multiport --dports 3260, 8776 -j ACCEPT
|
||||
|
||||
iptables-save > $IPT_FILE
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
touch $OK
|
8
elements/cinder/pre-install.d/00-cinder-disable-requiretty
Executable file
8
elements/cinder/pre-install.d/00-cinder-disable-requiretty
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -d /etc/sudoers.d ]; then
|
||||
echo "Defaults:cinder !requiretty" > /etc/sudoers.d/cinder-notty
|
||||
chmod 0440 /etc/sudoers.d/cinder-notty
|
||||
visudo -c
|
||||
fi
|
Loading…
Reference in New Issue
Block a user